aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-03 01:58:37 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-10-03 01:58:37 +0000
commit72d1aa3cff68617e40260dddbc5be002e8c1c7a2 (patch)
tree62b32d609f81269da946d6407552f1ea1fc2161b /clang/lib/Frontend/CompilerInstance.cpp
parente514b200aa6770b9a0516f4185744974cf17cff6 (diff)
downloadllvm-72d1aa3cff68617e40260dddbc5be002e8c1c7a2.zip
llvm-72d1aa3cff68617e40260dddbc5be002e8c1c7a2.tar.gz
llvm-72d1aa3cff68617e40260dddbc5be002e8c1c7a2.tar.bz2
Introduce ASTConsumer::HandleImplicitImportDecl() callback that is invoked
when an ImportDecl that was implicitly created due to an inclusion directive. llvm-svn: 165084
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 4cc46b8..bf46e549 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/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;