[all-commits] [llvm/llvm-project] a50bb8: [flang] Fix classification of shape inquiries in s...

Peter Klausler via All-commits all-commits at lists.llvm.org
Wed Jan 13 10:12:45 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a50bb84ec0c2d47a2a7403ad29842ca48cd6b828
      https://github.com/llvm/llvm-project/commit/a50bb84ec0c2d47a2a7403ad29842ca48cd6b828
  Author: peter klausler <pklausler at nvidia.com>
  Date:   2021-01-13 (Wed, 13 Jan 2021)

  Changed paths:
    M flang/include/flang/Evaluate/characteristics.h
    M flang/include/flang/Evaluate/fold.h
    M flang/include/flang/Evaluate/shape.h
    M flang/include/flang/Evaluate/tools.h
    M flang/include/flang/Evaluate/type.h
    M flang/include/flang/Semantics/tools.h
    M flang/lib/Evaluate/characteristics.cpp
    M flang/lib/Evaluate/check-expression.cpp
    M flang/lib/Evaluate/fold.cpp
    M flang/lib/Evaluate/intrinsics.cpp
    M flang/lib/Evaluate/shape.cpp
    M flang/lib/Evaluate/tools.cpp
    M flang/lib/Semantics/check-call.cpp
    M flang/lib/Semantics/check-declarations.cpp
    M flang/lib/Semantics/check-do-forall.cpp
    M flang/lib/Semantics/resolve-names.cpp
    M flang/lib/Semantics/semantics.cpp
    M flang/lib/Semantics/tools.cpp
    M flang/test/Semantics/data04.f90
    M flang/test/Semantics/resolve44.f90
    M flang/test/Semantics/shape.f90

  Log Message:
  -----------
  [flang] Fix classification of shape inquiries in specification exprs

In some contexts, including the motivating case of determining whether
the expressions that define the shape of a variable are "constant expressions"
in the sense of the Fortran standard, expression rewriting via Fold()
is not necessary, and should not be required.  The inquiry intrinsics LBOUND,
UBOUND, and SIZE work correctly now in specification expressions and are
classified correctly as being constant expressions (or not).  Getting this right
led to a fair amount of API clean-up as a consequence, including the
folding of shapes and TypeAndShape objects, and new APIs for shapes
that do not fold for those cases where folding isn't needed.  Further,
the symbol-testing predicate APIs in Evaluate/tools.h now all resolve any
associations of their symbols and work transparently on use-, host-, and
construct-association symbols; the tools used to resolve those associations have
been defined and documented more precisely, and their clients adjusted as needed.

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




More information about the All-commits mailing list