diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-10-28 07:38:51 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-10-28 07:38:51 +0000 |
commit | 01c2df45ff5b9f755c85a77f069e23a127d0d016 (patch) | |
tree | a7542ed9a4a977359ef4b2dff2886ecc5875abf2 /clang/lib/AST/DeclBase.cpp | |
parent | ef80a01d046962d9a9bee00c3b62d8029c8db864 (diff) | |
download | bcm5719-llvm-01c2df45ff5b9f755c85a77f069e23a127d0d016.tar.gz bcm5719-llvm-01c2df45ff5b9f755c85a77f069e23a127d0d016.zip |
Use the ASTMutationListener to track when a named decl gets added to a DeclContext,
meaning we need to rewrite its name lookup table in a chained PCH.
llvm-svn: 117536
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 5606d54478f..5ba6623b20b 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/lib/AST/DeclBase.cpp @@ -24,6 +24,7 @@ #include "clang/AST/Type.h" #include "clang/AST/Stmt.h" #include "clang/AST/StmtCXX.h" +#include "clang/AST/ASTMutationListener.h" #include "llvm/ADT/DenseMap.h" #include "llvm/Support/raw_ostream.h" #include <algorithm> @@ -952,6 +953,12 @@ void DeclContext::makeDeclVisibleInContext(NamedDecl *D, bool Recoverable) { // parent context, too. This operation is recursive. if (isTransparentContext() || isInlineNamespace()) getParent()->makeDeclVisibleInContext(D, Recoverable); + + Decl *DCAsDecl = cast<Decl>(this); + // Notify that a decl was made visible unless it's a Tag being defined. + if (!(isa<TagDecl>(DCAsDecl) && cast<TagDecl>(DCAsDecl)->isBeingDefined())) + if (ASTMutationListener *L = DCAsDecl->getASTMutationListener()) + L->AddedVisibleDecl(this, D); } void DeclContext::makeDeclVisibleInContextImpl(NamedDecl *D) { |