mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 10:57:35 +03:00
Move check for access of context for nested class from backend into frontend.
This commit is contained in:
parent
e2a1394ae8
commit
b3d4bc83f8
4 changed files with 27 additions and 7 deletions
|
@ -390,11 +390,15 @@ LLValue* DtoNestedContext(Loc loc, Dsymbol* sym)
|
|||
LOG_SCOPE;
|
||||
|
||||
IrFunction* irfunc = gIR->func();
|
||||
|
||||
|
||||
// if this func has its own vars that are accessed by nested funcs
|
||||
// use its own context
|
||||
if (irfunc->nestedVar)
|
||||
return irfunc->nestedVar;
|
||||
// otherwise, it may have gotten a context from the caller
|
||||
else if (irfunc->nestArg)
|
||||
return irfunc->nestArg;
|
||||
// or just have a this argument
|
||||
else if (irfunc->thisArg)
|
||||
{
|
||||
ClassDeclaration* cd = irfunc->decl->isMember2()->isClassDeclaration();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue