From: Rafael Espindola Date: Thu, 9 Jan 2014 21:32:51 +0000 (+0000) Subject: Use getPointerSizeInBits. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e232ece6b79f035caf0c0d13d1c3f3505c9e9276;p=clang Use getPointerSizeInBits. I introduced this bug in 198815. Thanks for Mark Lacey for noticing. Unfortunately, I have no idea how to test this code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198891 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index 6cc8ab4dd2..9504d7dd11 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -947,7 +947,8 @@ CGObjCGNU::CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion, 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::GenerateProtocolHolderCategory() { /// bitfield / with the 63rd bit set will be 1<<64. llvm::Constant *CGObjCGNU::MakeBitField(ArrayRef 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