[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
Tue Jun 30 12:29:22 PDT 2020


PeteSteinfeld created this revision.
PeteSteinfeld added reviewers: tskeith, klausler.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
PeteSteinfeld added a project: Flang.
Herald added a reviewer: jdoerfert.

A program can reference the same name as both a data object and as a function.  Some of these references were causing an internal error in expression analysis.

It was already the case that a symbol referenced in a parse tree for a call was changed from an `Entity` to a `ProcEntity`.  I added code to detect when a symbol was referenced in a parse tree as an array element gets changed from an `Entity` to an `ObjectEntity`.  Then, if an `ObjectEntity` gets called as a function or a `ProcEntity` gets referenced as a data object, errors get emitted.

This analysis was previously confined to the name resolution of the
specification part of a `ProgramTree`.  I added a pass to the execution part of
a `ProgramTree` to catch names declared in blocks.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82903

Files:
  flang/lib/Semantics/expression.cpp
  flang/lib/Semantics/resolve-names.cpp
  flang/test/Semantics/resolve93.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82903.274576.patch
Type: text/x-patch
Size: 4588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200630/443ab8cb/attachment.bin>


More information about the llvm-commits mailing list