[cfe-commits] r126990 - /cfe/trunk/lib/CodeGen/CGObjCMac.cpp

John McCall rjmccall at apple.com
Fri Mar 4 00:25:59 PST 2011


Author: rjmccall
Date: Fri Mar  4 02:25:59 2011
New Revision: 126990

URL: http://llvm.org/viewvc/llvm-project?rev=126990&view=rev
Log:
Access ivars with inbounds GEPs, even in -fwrapv.  It's unlikely that
this can have any optimization effect, given the opacity of objects pointers,
but you never know.


Modified:
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=126990&r1=126989&r2=126990&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Fri Mar  4 02:25:59 2011
@@ -115,7 +115,7 @@
   QualType IvarTy = Ivar->getType();
   const llvm::Type *LTy = CGF.CGM.getTypes().ConvertTypeForMem(IvarTy);
   llvm::Value *V = CGF.Builder.CreateBitCast(BaseValue, I8Ptr);
-  V = CGF.Builder.CreateGEP(V, Offset, "add.ptr");
+  V = CGF.Builder.CreateInBoundsGEP(V, Offset, "add.ptr");
   V = CGF.Builder.CreateBitCast(V, llvm::PointerType::getUnqual(LTy));
 
   if (!Ivar->isBitField()) {





More information about the cfe-commits mailing list