[cfe-commits] r128102 - /cfe/trunk/lib/CodeGen/CGObjCGNU.cpp
Douglas Gregor
dgregor at apple.com
Wed Mar 23 09:44:22 PDT 2011
Bill, please pull this patch into the 2.9 release branch.
Thanks!
- Doug
On Mar 22, 2011, at 8:57 PM, David Chisnall wrote:
> 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 *
>
>
> _______________________________________________
> 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