[PATCH] D104130: [flang] Handle multiple USE statements for the same module
Pete Steinfeld via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 11 12:02:27 PDT 2021
PeteSteinfeld 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)}) {
----------------
klausler wrote:
> `Symbol::name()` returns a ``SourceName` (== `parser::CharBlock`); how does this reference declaration even compile?
Good catch. I can only think that the C++ compiler was constructing a parser::Name in place and then creating a reference to it. I'll fix it.
================
Comment at: flang/lib/Semantics/resolve-names.cpp:6455
const std::list<parser::DeclarationConstruct> &decls) {
+ ClearUseRenames();
+ ClearUseOnly();
----------------
klausler wrote:
> 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.
Good idea. I'll make it happen.
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