aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-03 00:30:27 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-03 00:30:27 +0000
commite664977aca2a05a77abab5a06dc0fb69e870cfb9 (patch)
tree654ca3bf80083d7959029009b263314b6c6dbd29 /lib/AST/DeclBase.cpp
parent93ebfa6139bbca4d446c7343e3afc8e5ec777484 (diff)
Keep track of all of the import declarations that are parsed or
implicitly generated in a translation unit. Modules will need this information to identify the actual imports that occurred. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145734 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index f4507e3603..37e0892c5c 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -1010,6 +1010,13 @@ void DeclContext::addHiddenDecl(Decl *D) {
// update it's class-specific state.
if (CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(this))
Record->addedMember(D);
+
+ // If this is a newly-created (not de-serialized) import declaration, wire
+ // it in to the list of local import declarations.
+ if (!D->isFromASTFile()) {
+ if (ImportDecl *Import = dyn_cast<ImportDecl>(D))
+ D->getASTContext().addedLocalImportDecl(Import);
+ }
}
void DeclContext::addDecl(Decl *D) {