Used the DataLayout methods instead of the Module methods.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 9 Jan 2014 00:17:51 +0000 (00:17 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 9 Jan 2014 00:17:51 +0000 (00:17 +0000)
llvm-svn: 198815

clang/lib/CodeGen/CGObjCGNU.cpp

index fbeb08a..6cc8ab4 100644 (file)
@@ -947,8 +947,7 @@ CGObjCGNU::CGObjCGNU(CodeGenModule &cgm, unsigned runtimeABIVersion,
   Int32Ty = llvm::Type::getInt32Ty(VMContext);
   Int64Ty = llvm::Type::getInt64Ty(VMContext);
 
-  IntPtrTy =
-      TheModule.getPointerSize() == llvm::Module::Pointer32 ? Int32Ty : Int64Ty;
+  IntPtrTy = CGM.getDataLayout().getPointerSize() == 32 ? Int32Ty : Int64Ty;
 
   // Object type
   QualType UnqualIdTy = CGM.getContext().getObjCIdType();
@@ -1996,8 +1995,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 =
-        (TheModule.getPointerSize() == llvm::Module::Pointer32) ? 32 : 64;
+  int ptrBits = CGM.getDataLayout().getPointerSize();
   if (bitCount < ptrBits) {
     uint64_t val = 1;
     for (int i=0 ; i<bitCount ; ++i) {