Mercurial > projects > ldc
comparison gen/toir.cpp @ 197:bfcb657756f6 trunk
[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.
author | lindquist |
---|---|
date | Mon, 12 May 2008 20:02:52 +0200 |
parents | aca17e55b7a5 |
children | 8f9191180c7a |
comparison
equal
deleted
inserted
replaced
196:48bebfd701a5 | 197:bfcb657756f6 |
---|---|
1508 if (VarDeclaration* vd = var->isVarDeclaration()) { | 1508 if (VarDeclaration* vd = var->isVarDeclaration()) { |
1509 llvm::Value* v; | 1509 llvm::Value* v; |
1510 v = p->func()->decl->ir.irFunc->thisVar; | 1510 v = p->func()->decl->ir.irFunc->thisVar; |
1511 if (llvm::isa<llvm::AllocaInst>(v)) | 1511 if (llvm::isa<llvm::AllocaInst>(v)) |
1512 v = new llvm::LoadInst(v, "tmp", p->scopebb()); | 1512 v = new llvm::LoadInst(v, "tmp", p->scopebb()); |
1513 const llvm::Type* t = DtoType(type); | |
1514 if (v->getType() != t) | |
1515 v = DtoBitCast(v, t, "tmp"); | |
1513 return new DThisValue(vd, v); | 1516 return new DThisValue(vd, v); |
1514 } | 1517 } |
1515 | 1518 |
1516 assert(0); | 1519 assert(0); |
1517 return 0; | 1520 return 0; |
1678 DValue* l = e1->toElem(p); | 1681 DValue* l = e1->toElem(p); |
1679 DValue* r = e2->toElem(p); | 1682 DValue* r = e2->toElem(p); |
1680 | 1683 |
1681 Type* t = DtoDType(e1->type); | 1684 Type* t = DtoDType(e1->type); |
1682 Type* e2t = DtoDType(e2->type); | 1685 Type* e2t = DtoDType(e2->type); |
1683 assert(t == e2t); | 1686 assert(DtoType(t) == DtoType(e2t)); |
1684 | 1687 |
1685 llvm::Value* eval = 0; | 1688 llvm::Value* eval = 0; |
1686 | 1689 |
1687 if (t->isintegral() || t->ty == Tpointer) | 1690 if (t->isintegral() || t->ty == Tpointer) |
1688 { | 1691 { |