Skip to content

Commit 161d002

Browse files
authored
[flang] Silence warnings from hermetic module files (#128763)
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 fce2948 commit 161d002

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
@@ -1546,6 +1546,10 @@ Scope *ModFileReader::Read(SourceName name, std::optional<bool> isIntrinsic,
15461546
Scope &hermeticScope{topScope.MakeScope(Scope::Kind::Global)};
15471547
context_.set_currentHermeticModuleFileScope(&hermeticScope);
15481548
ResolveNames(context_, hermeticModules, hermeticScope);
1549+
for (auto &[_, ref] : hermeticScope) {
1550+
CHECK(ref->has<ModuleDetails>());
1551+
ref->set(Symbol::Flag::ModFile);
1552+
}
15491553
}
15501554
GetModuleDependences(context_.moduleDependences(), sourceFile->content());
15511555
ResolveNames(context_, parseTree, topScope);

0 commit comments

Comments
 (0)