diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-08-30 19:43:26 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-08-30 19:43:26 +0000 |
commit | 3a5094b18c052eb8a519ac2249848ae77cad7c6e (patch) | |
tree | 681e6b583bf2b62151f0dbdfb2cebb6a247ee03b /clang/lib/AST/DeclObjC.cpp | |
parent | d3497db59b5706ba50b39403b1b7f5964b2bda53 (diff) | |
download | bcm5719-llvm-3a5094b18c052eb8a519ac2249848ae77cad7c6e.tar.gz bcm5719-llvm-3a5094b18c052eb8a519ac2249848ae77cad7c6e.zip |
Remove a few mutating ObjCCategoryDecl methods.
Remove
-setClassInterface
-setNextClassCategory
-insertNextClassCategory
and combine them in the Create function.
llvm-svn: 138817
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 09638fefbd3..ad2fd289a7e 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -909,8 +909,24 @@ ObjCCategoryDecl *ObjCCategoryDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation AtLoc, SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc, - IdentifierInfo *Id) { - return new (C) ObjCCategoryDecl(DC, AtLoc, ClassNameLoc, CategoryNameLoc, Id); + IdentifierInfo *Id, + ObjCInterfaceDecl *IDecl) { + ObjCCategoryDecl *CatDecl = new (C) ObjCCategoryDecl(DC, AtLoc, ClassNameLoc, + CategoryNameLoc, Id, + IDecl); + if (IDecl) { + // Link this category into its class's category list. + CatDecl->NextClassCategory = IDecl->getCategoryList(); + IDecl->setCategoryList(CatDecl); + IDecl->setChangedSinceDeserialization(true); + } + + return CatDecl; +} + +ObjCCategoryDecl *ObjCCategoryDecl::Create(ASTContext &C, EmptyShell Empty) { + return new (C) ObjCCategoryDecl(0, SourceLocation(), SourceLocation(), + SourceLocation(), 0, 0); } ObjCCategoryImplDecl *ObjCCategoryDecl::getImplementation() const { |