[PATCH] D82903: [flang] Bug fix for ambiguous references to data and functions

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 2 15:08:30 PDT 2020


PeteSteinfeld marked 2 inline comments as done.
PeteSteinfeld added inline comments.


================
Comment at: flang/lib/Semantics/resolve-names.cpp:5907
+  if (!symbol) {
+    symbol = currScope().FindSymbol(name.source);
+  }
----------------
tskeith wrote:
> I think if you do this in `ResolveDataRef` when we see an `ArrayElement` you don't need to call `FindScope`. The name will be resolved if it can be.
Good thought.  But I checked, and the `symbol` field of the `parser::Name` has not yet been filled in at the point.  On the other hand, I realized that  the lookup via the call to `FindSymbol()` always succeeds at the point because the current scope is correctly set.  This let me simplify the code by eliminating the unnecessary reference to `name.symbol`.


================
Comment at: flang/lib/Semantics/resolve-names.cpp:5910
+  if (symbol) {
+    if (symbol->detailsIf<ProcEntityDetails>()) {
+      if (!context().HasError(*symbol)) {
----------------
tskeith wrote:
> `symbol->has<ProcEntityDetails>()` is better.
Thanks, Tim.  I'll change it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82903





More information about the llvm-commits mailing list