[flang] Introduce FortranVariableOpInterface for ops creating variable
authorJean Perier <jperier@nvidia.com>
Wed, 19 Oct 2022 06:55:02 +0000 (08:55 +0200)
committerJean Perier <jperier@nvidia.com>
Wed, 19 Oct 2022 06:56:47 +0000 (08:56 +0200)
commit875fd9df76ded4a88a3a44b690f290ea98f91705
tree4e967812f8079f27f94b62588b86ebb8d63ac4c1
parentfce33e1140bbf5ddf2afa5c3be89433ed2a70e4d
[flang] Introduce FortranVariableOpInterface for ops creating variable

HLFIR will rely on certain operations to create SSA memory values
that correspond to a Fortran variable. They will hold bounds and type
parameters information as well as metadata (like Fortran attributes).

This patch adds an interface that for such operations so that Fortran
variable can be stored, manipulated, and queried regardless of what
created them. This is so far intended for fir.declare, hlfir.designate
and hlfir.associate operations.
It is added to FIR and not HLFIR because fir.declare needs it and it
does not itself needs any HLFIR concepts.

Unit tests for the interface methods will be added alongside
fir.declare in the next patch.

Differential Revision: https://reviews.llvm.org/D136151
flang/include/flang/Optimizer/Dialect/CMakeLists.txt
flang/include/flang/Optimizer/Dialect/FortranVariableInterface.h [new file with mode: 0644]
flang/include/flang/Optimizer/Dialect/FortranVariableInterface.td [new file with mode: 0644]
flang/lib/Optimizer/Dialect/CMakeLists.txt
flang/lib/Optimizer/Dialect/FortranVariableInterface.cpp [new file with mode: 0644]