[all-commits] [llvm/llvm-project] f9e24a: [flang] Bug fix for ambiguous references to data a...

Pete Steinfeld via All-commits all-commits at lists.llvm.org
Mon Jul 6 11:27:43 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: f9e24a563c36fc98860f4b282af5f6d034b2863c
      https://github.com/llvm/llvm-project/commit/f9e24a563c36fc98860f4b282af5f6d034b2863c
  Author: Pete Steinfeld <psteinfeld at nvidia.com>
  Date:   2020-07-06 (Mon, 06 Jul 2020)

  Changed paths:
    M flang/lib/Semantics/expression.cpp
    M flang/lib/Semantics/resolve-names.cpp
    A flang/test/Semantics/resolve93.f90

  Log Message:
  -----------
  [flang] Bug fix for ambiguous references to data and functions

Summary:
A program may erroneously 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.

Reviewers: tskeith, klausler, DavidTruby

Subscribers: llvm-commits

Tags: #llvm, #flang

Differential Revision: https://reviews.llvm.org/D82903




More information about the All-commits mailing list