]> granicus.if.org Git - clang/commitdiff
type of last arg of objc_assign_ivar is ptrdiff_t.
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 5 May 2011 22:00:38 +0000 (22:00 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 5 May 2011 22:00:38 +0000 (22:00 +0000)
// rdar://9362887

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130956 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGObjCMac.cpp

index 0675f0df05969f7b74d7bbb1d36a5043a4a7db2d..6473bb224cc99cc717efe7ef18536efc4a5b58d3 100644 (file)
@@ -324,7 +324,11 @@ public:
     // id objc_assign_ivar(id, id *, ptrdiff_t)
     std::vector<const llvm::Type*> Args(1, ObjectPtrTy);
     Args.push_back(ObjectPtrTy->getPointerTo());
-    Args.push_back(LongTy);
+    const llvm::Type *PtrDiffTy =
+      CGM.getTypes().ConvertType(
+        CGM.getContext().getPointerDiffType()->getCanonicalTypeUnqualified());
+
+    Args.push_back(PtrDiffTy);
     llvm::FunctionType *FTy =
       llvm::FunctionType::get(ObjectPtrTy, Args, false);
     return CGM.CreateRuntimeFunction(FTy, "objc_assign_ivar");