[all-commits] [llvm/llvm-project] 82edd4: [flang] Fix check for distinguishable operators/as...

Tim Keith via All-commits all-commits at lists.llvm.org
Thu Sep 10 07:40:04 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 82edd428f1856ff386716b4f836194252458d001
      https://github.com/llvm/llvm-project/commit/82edd428f1856ff386716b4f836194252458d001
  Author: Tim Keith <tkeith at nvidia.com>
  Date:   2020-09-10 (Thu, 10 Sep 2020)

  Changed paths:
    M flang/include/flang/Semantics/tools.h
    M flang/lib/Evaluate/tools.cpp
    M flang/lib/Semantics/check-declarations.cpp
    M flang/lib/Semantics/resolve-names-utils.cpp
    M flang/lib/Semantics/resolve-names-utils.h
    M flang/lib/Semantics/resolve-names.cpp
    M flang/lib/Semantics/tools.cpp
    M flang/test/Semantics/resolve11.f90
    M flang/test/Semantics/resolve13.f90
    M flang/test/Semantics/resolve15.f90
    M flang/test/Semantics/resolve25.f90
    M flang/test/Semantics/resolve53.f90
    A flang/test/Semantics/resolve96.f90
    M flang/test/Semantics/test_errors.sh

  Log Message:
  -----------
  [flang] Fix check for distinguishable operators/assignments

Change how generic operators and assignments are checked for
distinguishable procedures. Because of how they are invoked, available
type-bound generics and normal generics all have to be considered
together. This is different from how generic names are checked.

Move common part of checking into DistinguishabilityHelper so that it
can be used in both cases after the appropriate procedures have been
added.

Cache result of Procedure::Characterize(Symbol) in a map in
CheckHelper so that we don't have to worry about passing the
characterized Procedures around or the cost of recomputing them.

Add MakeOpName() to construct names for defined operators and assignment
for using in error messages. This eliminates the need for different
messages in those cases.

When the procedures for a defined operator or assignment are undistinguishable,
include the type name in the error message, otherwise it may be ambiguous.

Add missing check that procedures for defined operators are functions
and that their dummy arguments are INTENT(IN) or VALUE.

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




More information about the All-commits mailing list