Patch for building method declaration nodes. Also fixed a segfault in cocoa.m due
to use of @property.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41880 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/Decl.cpp b/AST/Decl.cpp
index 0e6c218..e845329 100644
--- a/AST/Decl.cpp
+++ b/AST/Decl.cpp
@@ -164,6 +164,22 @@
return 0;
}
+void ObjcMethodDecl::setMethodParams(ParmVarDecl **NewParamInfo,
+ unsigned NumParams) {
+ assert(ParamInfo == 0 && "Already has param info!");
+
+ // Zero params -> null pointer.
+ if (NumParams) {
+ ParamInfo = new ParmVarDecl*[NumParams];
+ memcpy(ParamInfo, NewParamInfo, sizeof(ParmVarDecl*)*NumParams);
+ NumMethodParams = NumParams;
+ }
+}
+
+ObjcMethodDecl::~ObjcMethodDecl() {
+ delete[] ParamInfo;
+}
+
/// addObjcMethods - Insert instance and methods declarations into
/// ObjcInterfaceDecl's InsMethods and ClsMethods fields.
///