[PATCH] D93345: [flang] Handle undeclared names in EQUIVALENCE statements

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 16:22:02 PST 2020


tskeith added inline comments.


================
Comment at: flang/lib/Semantics/resolve-names.cpp:2024
+    return Resolve(name,
+        context().inEquivalenceStmt() ? scope.FindLocalSymbol(name.source)
+                                      : scope.FindSymbol(name.source));
----------------
`FindInScope(scope, name.source)` does the same thing, so you don't need the new function. (Or replace FindInScope with FindLocalSymbol everywhere.)


================
Comment at: flang/lib/Semantics/resolve-names.cpp:4358
   EquivalenceSets equivSets{context()};
+  context().set_inEquivalenceStmt(true);
   for (const auto *set : equivalenceSets_) {
----------------
I think it makes more sense for `inEquivalenceStmt_` to be recorded in `ScopeHandler` (like `inExecutionPart_`, for example). It doesn't really belong in SemanticsContext because it only applies to name resolution, not to the rest of semantic analysis.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93345/new/

https://reviews.llvm.org/D93345



More information about the llvm-commits mailing list