[flang] Lower component-ref to hlfir.designate
authorJean Perier <jperier@nvidia.com>
Thu, 12 Jan 2023 09:08:16 +0000 (10:08 +0100)
committerJean Perier <jperier@nvidia.com>
Thu, 12 Jan 2023 09:12:54 +0000 (10:12 +0100)
commitffc3051d0fb7ef32e0af86571251d1f35eb191bd
tree034c403bbe1a164a3ddc2f63e55d0c911ff6afec
parentdf1a74ac3c6407d0658c46c859c4a07974af3293
[flang] Lower component-ref to hlfir.designate

Implement the visit of component refs in DesignatorBuilder.
The ArrayRef code has to be updated a bit to cope with the
case where the base is an array and the component is also an
array.

Improve the result type of array sections designators (only return
a fir.box if the array section is not contiguous/has dynamic extent).
This required exposing IsContiguous entry point for different
front-end designator nodes (the implementation already existed,
but was internal to check-expression.cpp).

Differential Revision: https://reviews.llvm.org/D141470
flang/include/flang/Evaluate/check-expression.h
flang/include/flang/Optimizer/Builder/HLFIRTools.h
flang/lib/Evaluate/check-expression.cpp
flang/lib/Lower/ConvertExprToHLFIR.cpp
flang/lib/Lower/ConvertType.cpp
flang/lib/Optimizer/Builder/HLFIRTools.cpp
flang/test/Lower/HLFIR/designators-component-ref.f90 [new file with mode: 0644]