diff options
| -rw-r--r-- | clang/Sema/SemaDecl.cpp | 5 | ||||
| -rw-r--r-- | clang/include/clang/AST/DeclObjC.h | 13 |
2 files changed, 5 insertions, 13 deletions
diff --git a/clang/Sema/SemaDecl.cpp b/clang/Sema/SemaDecl.cpp index 41c04b9ff8a..76c00029eb8 100644 --- a/clang/Sema/SemaDecl.cpp +++ b/clang/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/clang/include/clang/AST/DeclObjC.h b/clang/include/clang/AST/DeclObjC.h index 77aadcd8a2a..62633fb62cb 100644 --- a/clang/include/clang/AST/DeclObjC.h +++ b/clang/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; } |

