Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] Fix regression in submodule symbol checking #69778

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

klausler
Copy link
Contributor

The change #67361 removed submodule name symbols from the name dictionaries of their parent (sub)modules to prevent needless errors about name clashes, but these symbols still need to be checked for things like excessive length.

@klausler klausler requested a review from psteinfeld October 20, 2023 20:50
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:semantics labels Oct 20, 2023
@llvmbot
Copy link
Member

llvmbot commented Oct 20, 2023

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

Changes

The change #67361 removed submodule name symbols from the name dictionaries of their parent (sub)modules to prevent needless errors about name clashes, but these symbols still need to be checked for things like excessive length.


Full diff: https://github.com/llvm/llvm-project/pull/69778.diff

1 Files Affected:

  • (modified) flang/lib/Semantics/check-declarations.cpp (+4)
diff --git a/flang/lib/Semantics/check-declarations.cpp b/flang/lib/Semantics/check-declarations.cpp
index 2c2866d590ae5a4..c3a333b5917d2fd 100644
--- a/flang/lib/Semantics/check-declarations.cpp
+++ b/flang/lib/Semantics/check-declarations.cpp
@@ -2395,6 +2395,10 @@ void CheckHelper::Check(const Scope &scope) {
     for (const auto &pair : scope) {
       Check(*pair.second);
     }
+    if (scope.IsSubmodule() && scope.symbol()) {
+      // Submodule names are not in their parent's scopes
+      Check(*scope.symbol());
+    }
     for (const auto &pair : scope.commonBlocks()) {
       CheckCommonBlock(*pair.second);
     }

Copy link
Contributor

@psteinfeld psteinfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All builds and tests correctly and looks good.

Thanks for the fix!

The change llvm#67361 removed
submodule name symbols from the name dictionaries of their parent
(sub)modules to prevent needless errors about name clashes, but
these symbols still need to be checked for things like excessive
length.
@klausler klausler merged commit a9b3f20 into llvm:main Oct 31, 2023
@klausler klausler deleted the bug1409 branch October 31, 2023 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants