switch ObjcCategoryImplDecl over to being a NamedDecl, remove dead ctor argument.

llvm-svn: 42711
This commit is contained in:
Chris Lattner 2007-10-06 23:12:31 +00:00
parent a4016555d2
commit 6a2b09ecd9
2 changed files with 5 additions and 13 deletions

View 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;
}

View 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; }