[cfe-commits] r128102 - /cfe/trunk/lib/CodeGen/CGObjCGNU.cpp

David Chisnall csdavec at swan.ac.uk
Tue Mar 22 12:57:52 PDT 2011


Author: theraven
Date: Tue Mar 22 14:57:51 2011
New Revision: 128102

URL: http://llvm.org/viewvc/llvm-project?rev=128102&view=rev
Log:
Make the ivar offset always be a ptrdiff_t, because stuff in CGObjC.cpp expects this.  Actually, it expects a long, but that's a bug that will be fixed in the next commit...


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=128102&r1=128101&r2=128102&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCGNU.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCGNU.cpp Tue Mar 22 14:57:51 2011
@@ -2451,11 +2451,13 @@
                          const ObjCIvarDecl *Ivar) {
   if (CGM.getLangOptions().ObjCNonFragileABI) {
     Interface = FindIvarInterface(CGM.getContext(), Interface, Ivar);
-    return CGF.Builder.CreateLoad(CGF.Builder.CreateLoad(
-                ObjCIvarOffsetVariable(Interface, Ivar), false, "ivar"));
+    return CGF.Builder.CreateZExtOrBitCast(
+        CGF.Builder.CreateLoad(CGF.Builder.CreateLoad(
+                ObjCIvarOffsetVariable(Interface, Ivar), false, "ivar")),
+        PtrDiffTy);
   }
   uint64_t Offset = ComputeIvarBaseOffset(CGF.CGM, Interface, Ivar);
-  return llvm::ConstantInt::get(LongTy, Offset, "ivar");
+  return llvm::ConstantInt::get(PtrDiffTy, Offset, "ivar");
 }
 
 CodeGen::CGObjCRuntime *





More information about the cfe-commits mailing list