Patch to add objective-c's @protocl type declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42060 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index d457800..8208c02 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -289,3 +289,23 @@
   }
 }
 
+/// ObjcAddProtoMethods - Insert instance and methods declarations into
+/// ObjcProtocolDecl's ProtoInsMethods and ProtoClsMethods fields.
+///
+void ObjcProtocolDecl::ObjcAddProtoMethods(ObjcMethodDecl **insMethods, 
+					   unsigned numInsMembers,
+					   ObjcMethodDecl **clsMethods,
+					   unsigned numClsMembers) {
+  NumProtoInsMethods = numInsMembers;
+  if (numInsMembers) {
+    ProtoInsMethods = new ObjcProtoMethodDecl*[numInsMembers];
+    memcpy(ProtoInsMethods, insMethods, numInsMembers*sizeof(ObjcMethodDecl*));
+  }
+  NumProtoClsMethods = numClsMembers;
+  if (numClsMembers) {
+    ProtoClsMethods = new ObjcProtoMethodDecl*[numClsMembers];
+    memcpy(ProtoClsMethods, clsMethods, numClsMembers*sizeof(ObjcMethodDecl*));
+  }
+}
+
+