Mercurial > projects > ldc
comparison 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 |
comparison
equal
deleted
inserted
replaced
128:e5fe8521bbfa | 129:8096ba7082db |
---|---|
1821 if (thisexp) { | 1821 if (thisexp) { |
1822 DValue* thisval = thisexp->toElem(p); | 1822 DValue* thisval = thisexp->toElem(p); |
1823 size_t idx = 2; | 1823 size_t idx = 2; |
1824 idx += tc->sym->llvmIRStruct->interfaces.size(); | 1824 idx += tc->sym->llvmIRStruct->interfaces.size(); |
1825 DtoStore(thisval->getRVal(), DtoGEPi(emem,0,idx,"tmp")); | 1825 DtoStore(thisval->getRVal(), DtoGEPi(emem,0,idx,"tmp")); |
1826 } | |
1827 else if (tc->sym->isNested()) | |
1828 { | |
1829 size_t idx = 2; | |
1830 idx += tc->sym->llvmIRStruct->interfaces.size(); | |
1831 llvm::Value* nest = p->func()->decl->llvmNested; | |
1832 if (!nest) | |
1833 nest = p->func()->decl->llvmThisVar; | |
1834 assert(nest); | |
1835 llvm::Value* gep = DtoGEPi(emem,0,idx,"tmp"); | |
1836 nest = DtoBitCast(nest, gep->getType()->getContainedType(0)); | |
1837 DtoStore(nest, gep); | |
1826 } | 1838 } |
1827 | 1839 |
1828 // then call constructor | 1840 // then call constructor |
1829 if (arguments) { | 1841 if (arguments) { |
1830 assert(member); | 1842 assert(member); |