Mercurial > projects > ldc
diff gen/llvmhelpers.cpp @ 639:8aebdf56c455
Move check for access of context for nested class from backend into frontend.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Thu, 02 Oct 2008 23:12:19 +0200 |
parents | df196c8dea26 |
children | 8d850fa25713 |
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp Thu Oct 02 03:38:29 2008 +0200 +++ b/gen/llvmhelpers.cpp Thu Oct 02 23:12:19 2008 +0200 @@ -390,11 +390,15 @@ 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();