Skip to content

Commit 6b4b66c

Browse files
committed
[flang] Silence warnings from hermetic module files
Modules read from module files must have their symbols tagged with the ModFile flag to suppress all warnings messages that might be emitted for their contents. (Actionable warnings will have been emitted when the modules were originally compiled, so we don't want to repeat them later when the modules are USE'd.) The module symbols of the additional modules in hermetic module files were not being tagged with that flag; fix.
1 parent 9884803 commit 6b4b66c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

flang/lib/Semantics/mod-file.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,6 +1563,10 @@ Scope *ModFileReader::Read(SourceName name, std::optional<bool> isIntrinsic,
15631563
Scope &hermeticScope{topScope.MakeScope(Scope::Kind::Global)};
15641564
context_.set_currentHermeticModuleFileScope(&hermeticScope);
15651565
ResolveNames(context_, hermeticModules, hermeticScope);
1566+
for (auto &[_, ref] : hermeticScope) {
1567+
CHECK(ref->has<ModuleDetails>());
1568+
ref->set(Symbol::Flag::ModFile);
1569+
}
15661570
}
15671571
GetModuleDependences(context_.moduleDependences(), sourceFile->content());
15681572
ResolveNames(context_, parseTree, topScope);

0 commit comments

Comments
 (0)