[PATCH] D120973: [flang] Allow to use already existing names for contruct-name
Peter Klausler via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 4 08:58:42 PST 2022
klausler added inline comments.
================
Comment at: flang/lib/Semantics/resolve-names.cpp:614
bool CheckPossibleBadForwardRef(const Symbol &);
+ bool isSameSymbolNameAllowed(Symbol &symbol, MiscDetails details) {
+ if (details.kind() == MiscDetails::Kind::ConstructName &&
----------------
"details" is being passed by value; perhaps a const reference would be better.
================
Comment at: flang/lib/Semantics/resolve-names.cpp:615
+ bool isSameSymbolNameAllowed(Symbol &symbol, MiscDetails details) {
+ if (details.kind() == MiscDetails::Kind::ConstructName &&
+ symbol.has<ObjectEntityDetails>()) {
----------------
Two things here: first, this doesn't need to be an if statement, it can be just a simple return statement.
Second, why allow this only for object entities? Wouldn't any symbol other than another construct name be allowable?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120973/new/
https://reviews.llvm.org/D120973
More information about the llvm-commits
mailing list