Mercurial > projects > ldc
diff gen/tollvm.cpp @ 611:83ca663ecc20
Backed out changeset 1b62222581fb
Do not use i8 for bool. Instead rely on the target to store i1 as i8.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sun, 21 Sep 2008 14:45:41 +0200 |
parents | 1b62222581fb |
children | c9aa338280ed |
line wrap: on
line diff
--- a/gen/tollvm.cpp Sat Sep 20 10:13:15 2008 +0200 +++ b/gen/tollvm.cpp Sun Sep 21 14:45:41 2008 +0200 @@ -77,7 +77,7 @@ return (const LLType*)LLType::Int64Ty; case Tbool: - return (const LLType*)LLType::Int8Ty; + return (const LLType*)llvm::ConstantInt::getTrue()->getType(); // floats case Tfloat32: @@ -462,11 +462,11 @@ assert(fn != NULL); LLSmallVector<LLValue*, 5> llargs; - llargs.push_back(DtoConstI1(ll)); - llargs.push_back(DtoConstI1(ls)); - llargs.push_back(DtoConstI1(sl)); - llargs.push_back(DtoConstI1(ss)); - llargs.push_back(DtoConstI1(device)); + llargs.push_back(DtoConstBool(ll)); + llargs.push_back(DtoConstBool(ls)); + llargs.push_back(DtoConstBool(sl)); + llargs.push_back(DtoConstBool(ss)); + llargs.push_back(DtoConstBool(device)); llvm::CallInst::Create(fn, llargs.begin(), llargs.end(), "", gIR->scopebb()); } @@ -487,10 +487,6 @@ } LLConstant* DtoConstBool(bool b) { - return llvm::ConstantInt::get(LLType::Int8Ty, b, false); -} -LLConstant* DtoConstI1(bool b) -{ return llvm::ConstantInt::get(LLType::Int1Ty, b, false); } llvm::ConstantInt* DtoConstUbyte(unsigned char i)