Early patch to collect objective-c methods inserts them in
class object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41801 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index 5f87d93..0e6c218 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -163,3 +163,23 @@
   }
   return 0;
 }
+
+/// addObjcMethods - Insert instance and methods declarations into
+/// ObjcInterfaceDecl's InsMethods and ClsMethods fields.
+///
+void ObjcInterfaceDecl::ObjcAddMethods(ObjcMethodDecl **insMethods, 
+				       unsigned numInsMembers,
+                                       ObjcMethodDecl **clsMethods,
+                                       unsigned numClsMembers) {
+  NumInsMethods = numInsMembers;
+  if (numInsMembers) {
+    InsMethods = new ObjcMethodDecl*[numInsMembers];
+    memcpy(InsMethods, insMethods, numInsMembers*sizeof(ObjcMethodDecl*));
+  }
+  NumClsMethods = numClsMembers;
+  if (numClsMembers) {
+    ClsMethods = new ObjcMethodDecl*[numClsMembers];
+    memcpy(ClsMethods, clsMethods, numClsMembers*sizeof(ObjcMethodDecl*));
+  }
+}
+