diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Basic/Module.cpp | 8 | ||||
-rw-r--r-- | clang/lib/Sema/SemaModule.cpp | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 3f9b8d0..2bdbe8d2 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -695,6 +695,14 @@ void VisibleModuleSet::setVisible(Module *M, SourceLocation Loc, VisitModule({M, nullptr}); } +void VisibleModuleSet::makeTransitiveImportsVisible(Module *M, + SourceLocation Loc, + VisibleCallback Vis, + ConflictCallback Cb) { + for (auto *I : M->Imports) + setVisible(I, Loc, Vis, Cb); +} + ASTSourceDescriptor::ASTSourceDescriptor(Module &M) : Signature(M.Signature), ClangModule(&M) { if (M.Directory) diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp index 9b2982e..2ffb0db 100644 --- a/clang/lib/Sema/SemaModule.cpp +++ b/clang/lib/Sema/SemaModule.cpp @@ -397,6 +397,7 @@ Sema::ActOnModuleDecl(SourceLocation StartLoc, SourceLocation ModuleLoc, if (Interface) { VisibleModules.setVisible(Interface, ModuleLoc); + VisibleModules.makeTransitiveImportsVisible(Interface, ModuleLoc); // Make the import decl for the interface in the impl module. ImportDecl *Import = ImportDecl::Create(Context, CurContext, ModuleLoc, |