[flang-commits] [PATCH] D159043: [flang] Support SELECT RANK on allocatables & pointers

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Aug 28 17:16:05 PDT 2023


klausler created this revision.
klausler added a reviewer: vzakhari.
klausler added a project: Flang.
Herald added subscribers: mehdi_amini, jdoerfert.
Herald added a reviewer: sscalpone.
Herald added a reviewer: kiranchandramohan.
Herald added a project: All.
klausler requested review of this revision.

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.


https://reviews.llvm.org/D159043

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159043.554112.patch
Type: text/x-patch
Size: 29002 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230829/1b7aab6d/attachment-0001.bin>


More information about the flang-commits mailing list