mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-05 01:20:51 +03:00
Get rid of DtoBoolean - use DtoCast(... Type::tbool) instead.
Fixed some casts to bool that were using truncation.
This commit is contained in:
parent
660ca009b9
commit
6efc9a3324
7 changed files with 50 additions and 80 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue