mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-11-27 19:33:51 +01:00
[svn r375] Make DeclarationExp reuse storage if already allocated.
This commit is contained in:
+2
-4
@@ -69,9 +69,8 @@ DValue* DeclarationExp::toElem(IRState* p)
|
||||
assert(vd->ir.irLocal->value);
|
||||
assert(vd->ir.irLocal->nestedIndex >= 0);
|
||||
}
|
||||
// normal stack variable
|
||||
else {
|
||||
// allocate storage on the stack
|
||||
// normal stack variable, allocate storage on the stack if it has not already been done
|
||||
else if(!vd->ir.irLocal) {
|
||||
const LLType* lltype = DtoType(vd->type);
|
||||
|
||||
llvm::Value* allocainst;
|
||||
@@ -81,7 +80,6 @@ DValue* DeclarationExp::toElem(IRState* p)
|
||||
allocainst = new llvm::AllocaInst(lltype, vd->toChars(), p->topallocapoint());
|
||||
|
||||
//allocainst->setAlignment(vd->type->alignsize()); // TODO
|
||||
assert(!vd->ir.irLocal);
|
||||
vd->ir.irLocal = new IrLocal(vd);
|
||||
vd->ir.irLocal->value = allocainst;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user