]> granicus.if.org Git - clang/commitdiff
CodeGen: make the type match the comment for a libcall
authorSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 17 Jun 2017 17:30:31 +0000 (17:30 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Sat, 17 Jun 2017 17:30:31 +0000 (17:30 +0000)
Fix the type for a (runtime) library call to match both the comment and
the runtime implementation.  As it happens, the type being used matched,
this just makes it more precise.

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

lib/CodeGen/CGObjCMac.cpp
test/CodeGenObjC/objc_copyStruct.m [new file with mode: 0644]

index c78d3febd4cd76fd70474a3d9e87754fdbb3572b..7976c53d9e989ea6702ddd104c6c8c5694ad0474 100644 (file)
@@ -308,7 +308,7 @@ public:
     SmallVector<CanQualType,5> Params;
     Params.push_back(Ctx.VoidPtrTy);
     Params.push_back(Ctx.VoidPtrTy);
-    Params.push_back(Ctx.LongTy);
+    Params.push_back(Ctx.getSizeType());
     Params.push_back(Ctx.BoolTy);
     Params.push_back(Ctx.BoolTy);
     llvm::FunctionType *FTy =
diff --git a/test/CodeGenObjC/objc_copyStruct.m b/test/CodeGenObjC/objc_copyStruct.m
new file mode 100644 (file)
index 0000000..7fa0ad5
--- /dev/null
@@ -0,0 +1,16 @@
+// RUN: %clang -target x86_64-unknown-windows-msvc -fobjc-runtime=ios -Wno-objc-root-class -S -o - -emit-llvm %s | FileCheck %s
+// RUN: %clang -target x86_64-apple-ios -fobjc-runtime=ios -Wno-objc-root-class -S -o - -emit-llvm %s | FileCheck %s
+
+struct S {
+  float f, g;
+};
+
+@interface I
+@property struct S s;
+@end
+
+@implementation I
+@end
+
+// CHECK: declare {{.*}}void @objc_copyStruct(i8*, i8*, i64, i1, i1)
+