r198815 - Used the DataLayout methods instead of the Module methods.

Rafael Espindola rafael.espindola at gmail.com
Wed Jan 8 16:17:51 PST 2014


Author: rafael
Date: Wed Jan  8 18:17:51 2014
New Revision: 198815

URL: http://llvm.org/viewvc/llvm-project?rev=198815&view=rev
Log:
Used the DataLayout methods instead of the Module methods.

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=198815&r1=198814&r2=198815&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Wed Jan  8 18:17:51 2014
@@ -947,8 +947,7 @@ CGObjCGNU::CGObjCGNU(CodeGenModule &cgm,
   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::GenerateProtocolHolderCa
 /// 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) {





More information about the cfe-commits mailing list