[all-commits] [llvm/llvm-project] 031b4e: [flang] Support SELECT RANK on allocatables & poin...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Aug 29 14:56:46 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 031b4e5e795a72e23c69da3d06ae7a958d217a8e
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2023-08-29 (Tue, 29 Aug 2023)

  Changed paths:
    M flang/include/flang/Evaluate/tools.h
    M flang/include/flang/Semantics/symbol.h
    M flang/include/flang/Semantics/tools.h
    M flang/lib/Evaluate/intrinsics.cpp
    M flang/lib/Evaluate/tools.cpp
    M flang/lib/Lower/Bridge.cpp
    M flang/lib/Lower/ConvertExprToHLFIR.cpp
    M flang/lib/Lower/IO.cpp
    M flang/lib/Lower/Mangler.cpp
    M flang/lib/Lower/OpenMP.cpp
    M flang/lib/Semantics/check-allocate.cpp
    M flang/lib/Semantics/check-call.cpp
    M flang/lib/Semantics/check-deallocate.cpp
    M flang/lib/Semantics/check-declarations.cpp
    M flang/lib/Semantics/check-omp-structure.cpp
    M flang/lib/Semantics/check-select-rank.cpp
    M flang/lib/Semantics/definable.cpp
    M flang/lib/Semantics/resolve-directives.cpp
    M flang/lib/Semantics/resolve-names.cpp
    M flang/lib/Semantics/tools.cpp
    A flang/test/Semantics/select-rank03.f90

  Log Message:
  [flang] Support SELECT RANK on allocatables & pointers

Unlike other executable constructs with associating selectors, the
selector of a SELECT RANK construct can have the ALLOCATABLE or POINTER
attribute, and will work as an allocatable or object pointer within
each rank case, so long as there is no RANK(*) case.

Getting this right exposed a correctness risk with the popular
predicate IsAllocatableOrPointer() -- it will be true for procedure
pointers as well as object pointers, and in many contexts, a procedure
pointer should not be acceptable.  So this patch adds the new predicate
IsAllocatableOrObjectPointer(), and updates some call sites of the original
function to use the new one.

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

More information about the All-commits mailing list