Mercurial > projects > ldc
diff gen/tollvm.cpp @ 610:1b62222581fb
Change bool type to i8
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 20 Sep 2008 10:13:15 +0200 |
parents | fbb1a366cfbc |
children | 83ca663ecc20 |
line wrap: on
line diff
--- a/gen/tollvm.cpp Fri Sep 19 21:45:05 2008 +0200 +++ b/gen/tollvm.cpp Sat Sep 20 10:13:15 2008 +0200 @@ -77,7 +77,7 @@ return (const LLType*)LLType::Int64Ty; case Tbool: - return (const LLType*)llvm::ConstantInt::getTrue()->getType(); + return (const LLType*)LLType::Int8Ty; // floats case Tfloat32: @@ -462,11 +462,11 @@ assert(fn != NULL); LLSmallVector<LLValue*, 5> llargs; - 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)); + 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)); llvm::CallInst::Create(fn, llargs.begin(), llargs.end(), "", gIR->scopebb()); } @@ -487,6 +487,10 @@ } 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)