Mercurial > projects > ldc
diff gen/toir.cpp @ 129:8096ba7082db trunk
[svn r133] Fixed some problems with inlining not happening :P
Fixed problems with certain cases of deeply nested classes/functions.
author | lindquist |
---|---|
date | Fri, 28 Dec 2007 22:55:24 +0100 |
parents | facc562f5674 |
children | 5825d48b27d1 |
line wrap: on
line diff
--- a/gen/toir.cpp Fri Nov 30 17:12:08 2007 +0100 +++ b/gen/toir.cpp Fri Dec 28 22:55:24 2007 +0100 @@ -1824,6 +1824,18 @@ idx += tc->sym->llvmIRStruct->interfaces.size(); DtoStore(thisval->getRVal(), DtoGEPi(emem,0,idx,"tmp")); } + else if (tc->sym->isNested()) + { + size_t idx = 2; + idx += tc->sym->llvmIRStruct->interfaces.size(); + llvm::Value* nest = p->func()->decl->llvmNested; + if (!nest) + nest = p->func()->decl->llvmThisVar; + assert(nest); + llvm::Value* gep = DtoGEPi(emem,0,idx,"tmp"); + nest = DtoBitCast(nest, gep->getType()->getContainedType(0)); + DtoStore(nest, gep); + } // then call constructor if (arguments) {