diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-03 01:58:37 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-10-03 01:58:37 +0000 |
commit | d3d981627c375b187f33cc92a034a77ac329ec47 (patch) | |
tree | 05cae8705d7922a70572701f55c67a2e45cb41ce /lib/Frontend/CompilerInstance.cpp | |
parent | 95c579cae01118eadd311d445ff7f491d0011fb0 (diff) |
Introduce ASTConsumer::HandleImplicitImportDecl() callback that is invoked
when an ImportDecl that was implicitly created due to an inclusion directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165084 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | lib/Frontend/CompilerInstance.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp index 4cc46b8ab7..bf46e549b5 100644 --- a/lib/Frontend/CompilerInstance.cpp +++ b/lib/Frontend/CompilerInstance.cpp @@ -1082,9 +1082,12 @@ Module *CompilerInstance::loadModule(SourceLocation ImportLoc, // implicit import declaration to capture it in the AST. if (IsInclusionDirective && hasASTContext()) { TranslationUnitDecl *TU = getASTContext().getTranslationUnitDecl(); - TU->addDecl(ImportDecl::CreateImplicit(getASTContext(), TU, - ImportLoc, Module, - Path.back().second)); + ImportDecl *ImportD = ImportDecl::CreateImplicit(getASTContext(), TU, + ImportLoc, Module, + Path.back().second); + TU->addDecl(ImportD); + if (Consumer) + Consumer->HandleImplicitImportDecl(ImportD); } LastModuleImportLoc = ImportLoc; |