Mercurial > projects > ldc
diff gen/toir.cpp @ 364:8014dbd24605 trunk
[svn r385] Fix lvalue cast problems with -= and friends.
Fix complex DtoBoolean.
author | ChristianK |
---|---|
date | Mon, 14 Jul 2008 22:48:03 +0200 |
parents | 4d7495038ae8 |
children | bfb9d28f045a |
line wrap: on
line diff
--- a/gen/toir.cpp Mon Jul 14 21:49:54 2008 +0200 +++ b/gen/toir.cpp Mon Jul 14 22:48:03 2008 +0200 @@ -665,8 +665,6 @@ } DtoAssign(l, res); - // might need to return l here if used as an lvalue - // but when can this ever happen? return res; } @@ -739,7 +737,7 @@ } DtoAssign(l, res); - return l; + return res; } ////////////////////////////////////////////////////////////////////////////////////////// @@ -778,7 +776,7 @@ } DtoAssign(l, res); - return l; + return res; } ////////////////////////////////////////////////////////////////////////////////////////// @@ -817,7 +815,7 @@ } DtoAssign(l, res); - return l; + return res; } ////////////////////////////////////////////////////////////////////////////////////////// @@ -846,7 +844,7 @@ DValue* res = DtoBinRem(l, r); DtoAssign(l, res); - return l; + return res; } ////////////////////////////////////////////////////////////////////////////////////////// @@ -1967,8 +1965,7 @@ llvm::BasicBlock* endbb = llvm::BasicBlock::Create("noassert", p->topfunc(), oldend); // test condition - LLValue* condval = cond->getRVal(); - condval = DtoBoolean(condval); + LLValue* condval = DtoBoolean(cond); // branch llvm::BranchInst::Create(endbb, assertbb, condval, p->scopebb()); @@ -1997,7 +1994,7 @@ DValue* u = e1->toElem(p); - LLValue* b = DtoBoolean(u->getRVal()); + LLValue* b = DtoBoolean(u); LLConstant* zero = llvm::ConstantInt::get(LLType::Int1Ty, 0, true); b = p->ir->CreateICmpEQ(b,zero); @@ -2023,14 +2020,14 @@ llvm::BasicBlock* andand = llvm::BasicBlock::Create("andand", gIR->topfunc(), oldend); llvm::BasicBlock* andandend = llvm::BasicBlock::Create("andandend", gIR->topfunc(), oldend); - LLValue* ubool = DtoBoolean(u->getRVal()); + LLValue* ubool = DtoBoolean(u); DtoStore(ubool,resval); llvm::BranchInst::Create(andand,andandend,ubool,p->scopebb()); p->scope() = IRScope(andand, andandend); DValue* v = e2->toElem(p); - LLValue* vbool = DtoBoolean(v->getRVal()); + LLValue* vbool = DtoBoolean(v); LLValue* uandvbool = llvm::BinaryOperator::create(llvm::BinaryOperator::And, ubool, vbool,"tmp",p->scopebb()); DtoStore(uandvbool,resval); llvm::BranchInst::Create(andandend,p->scopebb()); @@ -2059,14 +2056,14 @@ llvm::BasicBlock* oror = llvm::BasicBlock::Create("oror", gIR->topfunc(), oldend); llvm::BasicBlock* ororend = llvm::BasicBlock::Create("ororend", gIR->topfunc(), oldend); - LLValue* ubool = DtoBoolean(u->getRVal()); + LLValue* ubool = DtoBoolean(u); DtoStore(ubool,resval); llvm::BranchInst::Create(ororend,oror,ubool,p->scopebb()); p->scope() = IRScope(oror, ororend); DValue* v = e2->toElem(p); - LLValue* vbool = DtoBoolean(v->getRVal()); + LLValue* vbool = DtoBoolean(v); DtoStore(vbool,resval); llvm::BranchInst::Create(ororend,p->scopebb()); @@ -2321,7 +2318,7 @@ llvm::BasicBlock* condend = llvm::BasicBlock::Create("condend", gIR->topfunc(), oldend); DValue* c = econd->toElem(p); - LLValue* cond_val = DtoBoolean(c->getRVal()); + LLValue* cond_val = DtoBoolean(c); llvm::BranchInst::Create(condtrue,condfalse,cond_val,p->scopebb()); p->scope() = IRScope(condtrue, condfalse);