]> granicus.if.org Git - clang/commitdiff
Use getPointerSizeInBits.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 9 Jan 2014 21:32:51 +0000 (21:32 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 9 Jan 2014 21:32:51 +0000 (21:32 +0000)
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

lib/CodeGen/CGObjCGNU.cpp

index 6cc8ab4dd2194ba23a96f7de1e9a0e3f6ff3987c..9504d7dd116a891f0686f6aca2cfa33dbd42e6f8 100644 (file)
@@ -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<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) {