mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-08-03 04:50:05 +02:00
[svn r285] Fixed D -> bool LLVM helper for floating point values.
Changed the way D-style varargs are passed, now each param should be aligned to size_t.sizeof.
This commit is contained in:
@@ -330,14 +330,16 @@ LLValue* DtoBoolean(LLValue* val)
|
||||
return new llvm::ICmpInst(llvm::ICmpInst::ICMP_NE, val, zero, "tmp", gIR->scopebb());
|
||||
}
|
||||
}
|
||||
else if (t->isFloatingPoint())
|
||||
{
|
||||
LLValue* zero = llvm::Constant::getNullValue(t);
|
||||
return new llvm::FCmpInst(llvm::FCmpInst::FCMP_ONE, val, zero, "tmp", gIR->scopebb());
|
||||
}
|
||||
else if (isaPointer(t)) {
|
||||
LLValue* zero = llvm::Constant::getNullValue(t);
|
||||
return new llvm::ICmpInst(llvm::ICmpInst::ICMP_NE, val, zero, "tmp", gIR->scopebb());
|
||||
}
|
||||
else
|
||||
{
|
||||
Logger::cout() << *t << '\n';
|
||||
}
|
||||
std::cout << "unsupported -> bool : " << *t << '\n';
|
||||
assert(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user