[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:
Tomas Lindquist Olsen
2008-06-14 17:28:13 +02:00
parent d85267ef5a
commit c2430c713b
5 changed files with 31 additions and 15 deletions

View File

@@ -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;
}