[PATCH] D104130: [flang] Handle multiple USE statements for the same module

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 11 11:02:07 PDT 2021


klausler added inline comments.


================
Comment at: flang/lib/Semantics/resolve-names.cpp:2530
+void ModuleVisitor::EraseRenamedSymbol(const Symbol &useSymbol) {
+  const parser::Name &name{useSymbol.name()};
+  if (const Symbol * symbol{FindInScope(name)}) {
----------------
`Symbol::name()` returns a ``SourceName` (== `parser::CharBlock`); how does this reference declaration even compile?


================
Comment at: flang/lib/Semantics/resolve-names.cpp:6455
     const std::list<parser::DeclarationConstruct> &decls) {
+  ClearUseRenames();
+  ClearUseOnly();
----------------
Might be better in ` ResolveNamesVisitor::Pre(const parser::SpecificationPart &x)` after (or before) the walk of the useStmts.  `FinishSpecificationPart()` has multiple call sites and things might be more clear if you did this use-stmt clean-up (or set-up) at the one place that deals with the list of use-stmts.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104130



More information about the llvm-commits mailing list