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

Mark Lacey mark.lacey at apple.com
Thu Jan 9 13:05:11 PST 2014


Hi Rafael,

On Jan 8, 2014, at 4:17 PM, Rafael Espindola <rafael.espindola at gmail.com> wrote:

> 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;

Shouldn’t both this line and the line below actually call getPointerSizeInBits()?

Mark

> 
>   // 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) {
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits





More information about the cfe-commits mailing list