[svn r213] Fixed: foreach on an object seems to have been broken, the issue was that DMD generates an implicit delegate with conflicting types for 'this'.

Fixed: string switch runtime support had wrong param types.
Fixed: string switch on a temporary slice was broken.
This commit is contained in:
Tomas Lindquist Olsen
2008-05-12 20:02:52 +02:00
parent 300fb29905
commit 941e36fa47
3 changed files with 35 additions and 5 deletions
+4 -1
View File
@@ -1510,6 +1510,9 @@ DValue* ThisExp::toElem(IRState* p)
v = p->func()->decl->ir.irFunc->thisVar;
if (llvm::isa<llvm::AllocaInst>(v))
v = new llvm::LoadInst(v, "tmp", p->scopebb());
const llvm::Type* t = DtoType(type);
if (v->getType() != t)
v = DtoBitCast(v, t, "tmp");
return new DThisValue(vd, v);
}
@@ -1680,7 +1683,7 @@ DValue* CmpExp::toElem(IRState* p)
Type* t = DtoDType(e1->type);
Type* e2t = DtoDType(e2->type);
assert(t == e2t);
assert(DtoType(t) == DtoType(e2t));
llvm::Value* eval = 0;