Get rid of DtoBoolean - use DtoCast(... Type::tbool) instead.

Fixed some casts to bool that were using truncation.
This commit is contained in:
Christian Kamm 2008-11-22 18:35:52 +01:00
parent 660ca009b9
commit 6efc9a3324
7 changed files with 50 additions and 80 deletions

View file

@ -945,6 +945,12 @@ DValue* DtoCastArray(Loc& loc, DValue* u, Type* to)
Logger::cout() << "to sarray" << '\n';
assert(0);
}
else if (totype->ty == Tbool) {
// return (arr.ptr !is null)
LLValue* ptr = DtoArrayPtr(u);
LLConstant* nul = getNullPtr(ptr->getType());
rval = gIR->ir->CreateICmpNE(ptr, nul, "tmp");
}
else {
assert(0);
}