Add setter/getter methods to the list of methods
of class's meta-data (related to objc2 nonfragile abi).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63251 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp
index acd5315..8ffed61 100644
--- a/lib/CodeGen/CGObjCMac.cpp
+++ b/lib/CodeGen/CGObjCMac.cpp
@@ -3189,6 +3189,21 @@
       // Instance methods should always be defined.
       Methods.push_back(GetMethodConstant(*i));
     }
+    for (ObjCImplementationDecl::propimpl_iterator i = ID->propimpl_begin(),
+         e = ID->propimpl_end(); i != e; ++i) {
+      ObjCPropertyImplDecl *PID = *i;
+      
+      if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize){
+        ObjCPropertyDecl *PD = PID->getPropertyDecl();
+        
+        if (ObjCMethodDecl *MD = PD->getGetterMethodDecl())
+          if (llvm::Constant *C = GetMethodConstant(MD))
+            Methods.push_back(C);
+        if (ObjCMethodDecl *MD = PD->getSetterMethodDecl())
+          if (llvm::Constant *C = GetMethodConstant(MD))
+            Methods.push_back(C);
+      }
+    }
   }
   // FIXME. Section may always be .data
   Values[ 5] = EmitMethodList(MethodListName,