Mercurial > projects > ldc
diff gen/statements.cpp @ 778:4adf0f742896
Get rid of DtoBoolean - use DtoCast(... Type::tbool) instead.
Fixed some casts to bool that were using truncation.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 22 Nov 2008 18:35:52 +0100 |
parents | 9688da40cd4d |
children | 340acf1535d0 |
line wrap: on
line diff
--- a/gen/statements.cpp Sat Nov 22 13:41:36 2008 +0100 +++ b/gen/statements.cpp Sat Nov 22 18:35:52 2008 +0100 @@ -168,7 +168,7 @@ if (cond_val->getType() != LLType::Int1Ty) { if (Logger::enabled()) Logger::cout() << "if conditional: " << *cond_val << '\n'; - cond_val = DtoBoolean(loc, cond_e); + cond_val = DtoCast(loc, cond_e, Type::tbool)->getRVal(); } LLValue* ifgoback = llvm::BranchInst::Create(ifbb, elsebb, cond_val, gIR->scopebb()); @@ -256,7 +256,7 @@ // create the condition DValue* cond_e = condition->toElem(p); - LLValue* cond_val = DtoBoolean(loc, cond_e); + LLValue* cond_val = DtoCast(loc, cond_e, Type::tbool)->getRVal(); delete cond_e; // conditional branch @@ -312,7 +312,7 @@ // create the condition DValue* cond_e = condition->toElem(p); - LLValue* cond_val = DtoBoolean(loc, cond_e); + LLValue* cond_val = DtoCast(loc, cond_e, Type::tbool)->getRVal(); delete cond_e; // conditional branch @@ -357,7 +357,7 @@ if (condition) { DValue* cond_e = condition->toElem(p); - cond_val = DtoBoolean(loc, cond_e); + cond_val = DtoCast(loc, cond_e, Type::tbool)->getRVal(); delete cond_e; } else