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 | 72d1aa3cff68617e40260dddbc5be002e8c1c7a2 (patch) | |
tree | 62b32d609f81269da946d6407552f1ea1fc2161b /clang/lib/Frontend/CompilerInstance.cpp | |
parent | e514b200aa6770b9a0516f4185744974cf17cff6 (diff) | |
download | llvm-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.cpp | 9 |
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; |