[flang] Add hlfir.declare codegen
authorJean Perier <jperier@nvidia.com>
Mon, 14 Nov 2022 10:19:21 +0000 (11:19 +0100)
committerJean Perier <jperier@nvidia.com>
Mon, 14 Nov 2022 10:19:35 +0000 (11:19 +0100)
commit3b29159da0945cd657aa4ef4ca52c7a386dd72b3
tree244174637d8451320d55069be3769f914e3b00a3
parent7e4cfcdb6f701e8ab08256686408b3c2b99d4fc8
[flang] Add hlfir.declare codegen

hlfir.declare codegen generates a fir.declare, and may generate a
fir.embox/fir.rebox/fir.emboxchar if the base value does not convey
all the variable bounds and length parameter information.

Leave OPTIONAL as a TODO to keep this patch simple. It will require
making the embox/rebox optional to preserve the optionality aspects.

Differential Revision: https://reviews.llvm.org/D137789
13 files changed:
flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td
flang/include/flang/Optimizer/HLFIR/CMakeLists.txt
flang/include/flang/Optimizer/HLFIR/Passes.h [new file with mode: 0644]
flang/include/flang/Optimizer/HLFIR/Passes.td [new file with mode: 0644]
flang/lib/Frontend/CMakeLists.txt
flang/lib/Optimizer/HLFIR/CMakeLists.txt
flang/lib/Optimizer/HLFIR/Transforms/CMakeLists.txt [new file with mode: 0644]
flang/lib/Optimizer/HLFIR/Transforms/ConvertToFIR.cpp [new file with mode: 0644]
flang/test/HLFIR/declare-codegen.fir [new file with mode: 0644]
flang/tools/bbc/CMakeLists.txt
flang/tools/fir-opt/CMakeLists.txt
flang/tools/fir-opt/fir-opt.cpp
flang/tools/tco/CMakeLists.txt