[svn r385] Fix lvalue cast problems with -= and friends.

Fix complex DtoBoolean.
This commit is contained in:
Christian Kamm
2008-07-14 22:48:03 +02:00
parent 27674069e7
commit 25dea7a16e
6 changed files with 36 additions and 28 deletions

View File

@@ -320,10 +320,14 @@ LLValue* DtoComplexEquals(TOK op, DValue* lhs, DValue* rhs)
else
cmpop = llvm::FCmpInst::FCMP_UNE;
// (l.re==r.re && l.im==r.im)
// (l.re==r.re && l.im==r.im) or (l.re!=r.re || l.im!=r.im)
LLValue* b1 = new llvm::FCmpInst(cmpop, a, c, "tmp", gIR->scopebb());
LLValue* b2 = new llvm::FCmpInst(cmpop, b, d, "tmp", gIR->scopebb());
return gIR->ir->CreateAnd(b1,b2,"tmp");
if (op == TOKequal)
return gIR->ir->CreateAnd(b1,b2,"tmp");
else
return gIR->ir->CreateOr(b1,b2,"tmp");
}
//////////////////////////////////////////////////////////////////////////////////////////