From f6546b38b2f598aa8387ea6106392861b83c53ec Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 27 Sep 2007 18:57:03 +0000 Subject: Patch for method implementation. It populates ObjcImplementationDecl object with method implementation declarations . It checks and warns on those methods declared in class interface and not implemented. llvm-svn: 42412 --- clang/AST/Decl.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'clang/AST/Decl.cpp') diff --git a/clang/AST/Decl.cpp b/clang/AST/Decl.cpp index 83762e94658..10da7b163ed 100644 --- a/clang/AST/Decl.cpp +++ b/clang/AST/Decl.cpp @@ -364,4 +364,23 @@ void ObjcCategoryDecl::ObjcAddCatMethods(ObjcMethodDecl **insMethods, } } +/// ObjcAddImplMethods - Insert instance and methods declarations into +/// ObjcImplementationDecl's InsMethods and ClsMethods fields. +/// +void ObjcImplementationDecl::ObjcAddImplMethods(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*)); + } +} + -- cgit v1.2.3