diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-01 00:58:55 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-01 00:58:55 +0000 |
commit | 7d847c9fd81d10d3927bd47fd99133265c5d0ad4 (patch) | |
tree | 492c87da277c5c89906a1b44bede46aa6311111c /clang/lib/AST/DeclObjC.cpp | |
parent | e88632d66738689f6b7dd896d0aa0d7c4a2787c8 (diff) | |
download | bcm5719-llvm-7d847c9fd81d10d3927bd47fd99133265c5d0ad4.tar.gz bcm5719-llvm-7d847c9fd81d10d3927bd47fd99133265c5d0ad4.zip |
Support importing of ObjC categories from modules.
The initial incentive was to fix a crash when PCH chaining categories
to an interface, but the fix was done in the "modules way" that I hear
is popular with the kids these days.
Each module stores the local chain of categories and we combine them
when the interface is loaded. We also warn if non-dependent modules
introduce duplicate named categories.
llvm-svn: 138926
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index ad2fd289a7e..45e34811eab 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -14,6 +14,7 @@ #include "clang/AST/DeclObjC.h" #include "clang/AST/ASTContext.h" #include "clang/AST/Stmt.h" +#include "clang/AST/ASTMutationListener.h" #include "llvm/ADT/STLExtras.h" using namespace clang; @@ -918,7 +919,8 @@ ObjCCategoryDecl *ObjCCategoryDecl::Create(ASTContext &C, DeclContext *DC, // Link this category into its class's category list. CatDecl->NextClassCategory = IDecl->getCategoryList(); IDecl->setCategoryList(CatDecl); - IDecl->setChangedSinceDeserialization(true); + if (ASTMutationListener *L = C.getASTMutationListener()) + L->AddedObjCCategoryToInterface(CatDecl, IDecl); } return CatDecl; |