aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Semantics/mod-file.cpp
diff options
context:
space:
mode:
authorPeter Klausler <35819229+klausler@users.noreply.github.com>2024-05-24 14:26:54 -0700
committerGitHub <noreply@github.com>2024-05-24 14:26:54 -0700
commit82bd7adb97e41fa6b6150942ae55ef35efb63e2b (patch)
tree8a96d08a1d4ad57fd39d9107b6104ef71f14d363 /flang/lib/Semantics/mod-file.cpp
parent90e33e20a594b8a404af1df93b629137cb605a21 (diff)
downloadllvm-82bd7adb97e41fa6b6150942ae55ef35efb63e2b.zip
llvm-82bd7adb97e41fa6b6150942ae55ef35efb63e2b.tar.gz
llvm-82bd7adb97e41fa6b6150942ae55ef35efb63e2b.tar.bz2
[flang] Fix bug introduced by PR#93106 (#93326)
https://github.com/llvm/llvm-project/pull/93106 introduced some necessary fixes to module file generation, but has also caused a regression. The module file output can include bogus attempts to USE-associate symbols local to derived type scopes, like components and bindings. Fix, and extend a test.
Diffstat (limited to 'flang/lib/Semantics/mod-file.cpp')
-rw-r--r--flang/lib/Semantics/mod-file.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/flang/lib/Semantics/mod-file.cpp b/flang/lib/Semantics/mod-file.cpp
index 67523c4..d7f1494 100644
--- a/flang/lib/Semantics/mod-file.cpp
+++ b/flang/lib/Semantics/mod-file.cpp
@@ -290,6 +290,9 @@ void ModFileWriter::PrepareRenamings(const Scope &scope) {
// to their names in this scope, creating those new names when needed.
auto &renamings{context_.moduleFileOutputRenamings()};
for (SymbolRef s : symbolsNeeded) {
+ if (s->owner().kind() == Scope::Kind::DerivedType) {
+ continue; // component or binding: ok
+ }
const Scope *sMod{FindModuleContaining(s->owner())};
if (!sMod || sMod == &scope) {
continue;