aboutsummaryrefslogtreecommitdiff
path: root/AST/Decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'AST/Decl.cpp')
-rw-r--r--AST/Decl.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index d45780043f..8208c02049 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -289,3 +289,23 @@ void ObjcInterfaceDecl::ObjcAddMethods(ObjcMethodDecl **insMethods,
}
}
+/// 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*));
+ }
+}
+
+