[svn r122] Fixed temporary delegates can now alloca their own storage.

This commit is contained in:
Tomas Lindquist Olsen
2007-11-26 05:50:33 +01:00
parent e0176785c7
commit 26beb7f43d
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -2079,8 +2079,14 @@ DValue* DelegateExp::toElem(IRState* p)
const llvm::Type* int8ptrty = llvm::PointerType::get(llvm::Type::Int8Ty);
assert(p->topexp() && p->topexp()->e2 == this && p->topexp()->v);
llvm::Value* lval = p->topexp()->v->getLVal();
llvm::Value* lval;
if (p->topexp() && p->topexp()->e2 == this) {
assert(p->topexp()->v);
lval = p->topexp()->v->getLVal();
}
else {
lval = new llvm::AllocaInst(DtoType(type), "tmpdelegate", p->topallocapoint());
}
llvm::Value* context = DtoGEP(lval,zero,zero,"tmp",p->scopebb());
llvm::Value* castcontext = new llvm::BitCastInst(u->getRVal(),int8ptrty,"tmp",p->scopebb());