Skip to content

Commit d313760

Browse files
committed
[Frontend] Report Swift overlays loaded for indirect cland dependencies
1 parent ed877ff commit d313760

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,8 +989,9 @@ REMARK(cross_import_added,none,
989989
(Identifier, Identifier, Identifier))
990990

991991
REMARK(module_loaded,none,
992-
"loaded module at %0",
993-
(StringRef))
992+
"loaded module at %0"
993+
"%select{|; overlay for a clang dependency}1",
994+
(StringRef, unsigned))
994995

995996
REMARK(explicit_interface_build_skipped,none,
996997
"Skipped rebuilding module at %0 - up-to-date",

lib/AST/ASTContext.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2471,7 +2471,8 @@ ASTContext::getModule(ImportPath::Module ModulePath, bool AllowMemoryCached) {
24712471
if (LangOpts.EnableModuleLoadingRemarks) {
24722472
Diags.diagnose(ModulePath.getSourceRange().Start,
24732473
diag::module_loaded,
2474-
M->getModuleFilename());
2474+
M->getModuleFilename(),
2475+
/*overlay=*/false);
24752476
}
24762477
return M;
24772478
}
@@ -2499,8 +2500,15 @@ ModuleDecl *ASTContext::getOverlayModule(const FileUnit *FU) {
24992500
for (auto &importer : getImpl().ModuleLoaders) {
25002501
if (importer.get() == getClangModuleLoader())
25012502
continue;
2502-
if (ModuleDecl *M = importer->loadModule(SourceLoc(), ModPath))
2503+
if (ModuleDecl *M = importer->loadModule(SourceLoc(), ModPath)) {
2504+
if (LangOpts.EnableModuleLoadingRemarks) {
2505+
Diags.diagnose(SourceLoc(),
2506+
diag::module_loaded,
2507+
M->getModuleFilename(),
2508+
/*overlay=*/true);
2509+
}
25032510
return M;
2511+
}
25042512
}
25052513

25062514
return nullptr;

0 commit comments

Comments
 (0)