]> granicus.if.org Git - clang/commitdiff
switch ObjcCategoryImplDecl over to being a NamedDecl, remove dead ctor argument.
authorChris Lattner <sabre@nondot.org>
Sat, 6 Oct 2007 23:12:31 +0000 (23:12 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 6 Oct 2007 23:12:31 +0000 (23:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42711 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaDecl.cpp
include/clang/AST/DeclObjC.h

index 41c04b9ff8ae1838b02385cf6246c5c54bd60583..76c00029eb8fd0a878e82afb21ac9875a9ac3ae1 100644 (file)
@@ -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;
         }
index 77aadcd8a2a6c733a962478e5eaf91efb97ef6b1..62633fb62cbff888897c2182fba6cb1899fedab6 100644 (file)
@@ -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; }