diff options
author | Peter Klausler <pklausler@nvidia.com> | 2025-02-27 14:29:35 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-27 14:29:35 -0800 |
commit | 161d002a0949046131ecaa6574ddfece5cfd225e (patch) | |
tree | 7d6f45989a81ddd803d976380c0a16d15ef513dd /flang/lib/Semantics/mod-file.cpp | |
parent | fce29486ac109fbf8b543c24c763703839278457 (diff) | |
download | llvm-161d002a0949046131ecaa6574ddfece5cfd225e.zip llvm-161d002a0949046131ecaa6574ddfece5cfd225e.tar.gz llvm-161d002a0949046131ecaa6574ddfece5cfd225e.tar.bz2 |
[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.
Diffstat (limited to 'flang/lib/Semantics/mod-file.cpp')
-rw-r--r-- | flang/lib/Semantics/mod-file.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/flang/lib/Semantics/mod-file.cpp b/flang/lib/Semantics/mod-file.cpp index 82c43d9..1dfd9c3 100644 --- a/flang/lib/Semantics/mod-file.cpp +++ b/flang/lib/Semantics/mod-file.cpp @@ -1546,6 +1546,10 @@ Scope *ModFileReader::Read(SourceName name, std::optional<bool> isIntrinsic, Scope &hermeticScope{topScope.MakeScope(Scope::Kind::Global)}; context_.set_currentHermeticModuleFileScope(&hermeticScope); ResolveNames(context_, hermeticModules, hermeticScope); + for (auto &[_, ref] : hermeticScope) { + CHECK(ref->has<ModuleDetails>()); + ref->set(Symbol::Flag::ModFile); + } } GetModuleDependences(context_.moduleDependences(), sourceFile->content()); ResolveNames(context_, parseTree, topScope); |