From: Chris Lattner Date: Sat, 6 Oct 2007 23:12:31 +0000 (+0000) Subject: switch ObjcCategoryImplDecl over to being a NamedDecl, remove dead ctor argument. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a0e89eece63e238ce873810f6f9bb50822e0296;p=clang switch ObjcCategoryImplDecl over to being a NamedDecl, remove dead ctor argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42711 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index 41c04b9ff8..76c00029eb 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -1107,8 +1107,7 @@ Sema::DeclTy *Sema::ActOnStartCategoryImplementation(Scope* S, IdentifierInfo *CatName, SourceLocation CatLoc) { ObjcInterfaceDecl *IDecl = getObjCInterfaceDecl(ClassName); ObjcCategoryImplDecl *CDecl = new ObjcCategoryImplDecl(AtCatImplLoc, - ClassName, IDecl, - CatName); + CatName, IDecl); /// Check that class of this category is already completely declared. if (!IDecl || IDecl->isForwardDecl()) Diag(ClassLoc, diag::err_undef_interface, ClassName->getName()); @@ -1809,7 +1808,7 @@ void Sema::ActOnAddMethodsToObjcDecl(Scope* S, DeclTy *classDecl, if (IDecl) { for (ObjcCategoryDecl *Categories = IDecl->getListCategories(); Categories; Categories = Categories->getNextClassCategory()) { - if (Categories->getIdentifier() == CatImplClass->getObjcCatName()) { + if (Categories->getIdentifier() == CatImplClass->getIdentifier()) { ImplCategoryMethodsVsIntfMethods(CatImplClass, Categories); break; } diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index 77aadcd8a2..62633fb62c 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -499,13 +499,10 @@ public: /// ObjcCategoryImplDecl - An object of this class encapsulates a category /// @implementation declaration. -class ObjcCategoryImplDecl : public Decl { +class ObjcCategoryImplDecl : public NamedDecl { /// Class interface for this category implementation ObjcInterfaceDecl *ClassInterface; - /// Category name - IdentifierInfo *ObjcCatName; - /// category instance methods being implemented ObjcMethodDecl **InstanceMethods; // Null if category is not implementing any int NumInstanceMethods; // -1 if category is not implementing any @@ -516,11 +513,9 @@ class ObjcCategoryImplDecl : public Decl { public: ObjcCategoryImplDecl(SourceLocation L, IdentifierInfo *Id, - ObjcInterfaceDecl *classInterface, - IdentifierInfo *catName) - : Decl(ObjcCategoryImpl, L), + ObjcInterfaceDecl *classInterface) + : NamedDecl(ObjcCategoryImpl, L, Id), ClassInterface(classInterface), - ObjcCatName(catName), InstanceMethods(0), NumInstanceMethods(-1), ClassMethods(0), NumClassMethods(-1) {} @@ -528,8 +523,6 @@ class ObjcCategoryImplDecl : public Decl { return ClassInterface; } - IdentifierInfo *getObjcCatName() const { return ObjcCatName; } - ObjcMethodDecl **getInstanceMethods() const { return InstanceMethods; } int getNumInstanceMethods() const { return NumInstanceMethods; }