Add support for GNU runtime property set / get structure functions.  Minor refactoring of Mac runtime (returns the same function for both, as the Mac runtimes currently only provide a single entry point for setting and getting struct properties, although this will presumably be fixed at some point).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122569 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp
index 91042da..456aced 100644
--- a/lib/CodeGen/CGObjC.cpp
+++ b/lib/CodeGen/CGObjC.cpp
@@ -222,11 +222,11 @@
       bool IsStrong = false;
       if ((IsAtomic || (IsStrong = IvarTypeWithAggrGCObjects(Ivar->getType())))
           && CurFnInfo->getReturnInfo().getKind() == ABIArgInfo::Indirect
-          && CGM.getObjCRuntime().GetCopyStructFunction()) {
+          && CGM.getObjCRuntime().GetGetStructFunction()) {
         LValue LV = EmitLValueForIvar(TypeOfSelfObject(), LoadObjCSelf(), 
                                       Ivar, 0);
         llvm::Value *GetCopyStructFn =
-          CGM.getObjCRuntime().GetCopyStructFunction();
+          CGM.getObjCRuntime().GetGetStructFunction();
         CodeGenTypes &Types = CGM.getTypes();
         // objc_copyStruct (ReturnValue, &structIvar, 
         //                  sizeof (Type of Ivar), isAtomic, false);
@@ -353,11 +353,11 @@
   } else if (IsAtomic && hasAggregateLLVMType(Ivar->getType()) &&
              !Ivar->getType()->isAnyComplexType() &&
              IndirectObjCSetterArg(*CurFnInfo)
-             && CGM.getObjCRuntime().GetCopyStructFunction()) {
+             && CGM.getObjCRuntime().GetSetStructFunction()) {
     // objc_copyStruct (&structIvar, &Arg, 
     //                  sizeof (struct something), true, false);
     llvm::Value *GetCopyStructFn =
-      CGM.getObjCRuntime().GetCopyStructFunction();
+      CGM.getObjCRuntime().GetSetStructFunction();
     CodeGenTypes &Types = CGM.getTypes();
     CallArgList Args;
     LValue LV = EmitLValueForIvar(TypeOfSelfObject(), LoadObjCSelf(), Ivar, 0);