r198891 - Use getPointerSizeInBits.
Rafael Espindola
rafael.espindola at gmail.com
Thu Jan 9 13:32:51 PST 2014
Author: rafael
Date: Thu Jan 9 15:32:51 2014
New Revision: 198891
URL: http://llvm.org/viewvc/llvm-project?rev=198891&view=rev
Log:
Use getPointerSizeInBits.
I introduced this bug in 198815. Thanks for Mark Lacey for noticing.
Unfortunately, I have no idea how to test this code.
Modified:
cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
Modified: cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCGNU.cpp?rev=198891&r1=198890&r2=198891&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Thu Jan 9 15:32:51 2014
@@ -947,7 +947,8 @@ CGObjCGNU::CGObjCGNU(CodeGenModule &cgm,
Int32Ty = llvm::Type::getInt32Ty(VMContext);
Int64Ty = llvm::Type::getInt64Ty(VMContext);
- IntPtrTy = CGM.getDataLayout().getPointerSize() == 32 ? Int32Ty : Int64Ty;
+ IntPtrTy =
+ CGM.getDataLayout().getPointerSizeInBits() == 32 ? Int32Ty : Int64Ty;
// Object type
QualType UnqualIdTy = CGM.getContext().getObjCIdType();
@@ -1995,7 +1996,7 @@ void CGObjCGNU::GenerateProtocolHolderCa
/// bitfield / with the 63rd bit set will be 1<<64.
llvm::Constant *CGObjCGNU::MakeBitField(ArrayRef<bool> bits) {
int bitCount = bits.size();
- int ptrBits = CGM.getDataLayout().getPointerSize();
+ int ptrBits = CGM.getDataLayout().getPointerSizeInBits();
if (bitCount < ptrBits) {
uint64_t val = 1;
for (int i=0 ; i<bitCount ; ++i) {
More information about the cfe-commits
mailing list