[flang] Use fir.type_desc and delay type desc address resolution
authorValentin Clement <clementval@gmail.com>
Tue, 31 Jan 2023 19:09:56 +0000 (20:09 +0100)
committerValentin Clement <clementval@gmail.com>
Tue, 31 Jan 2023 19:11:35 +0000 (20:11 +0100)
commit16bd0fe56c386de0bed33e3a29d6a4c5c6dc009e
tree13fbfeb156d3d48ab357d9af7249fadc51a45005
parenta125659f5e8a2eb6aa1174209f5fd1ab8e8cdec4
[flang] Use fir.type_desc and delay type desc address resolution

Makes use of fir.type_desc in order to delay the type desc address
resolution. The lowering inserts fir.type_desc operation instead of fir.addr_of
operation pointing to the fir.global type descriptor. The fir.type_desc
operation is then lowered in code gen to an address of operation in the LLVM
dialect. At this stage, the type descriptor is generated in all cases.

Reviewed By: vdonaldson

Differential Revision: https://reviews.llvm.org/D142920
flang/include/flang/Lower/Allocatable.h
flang/include/flang/Optimizer/Dialect/FIROps.td
flang/lib/Lower/Allocatable.cpp
flang/lib/Lower/ConvertVariable.cpp
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/lib/Optimizer/Dialect/FIROps.cpp
flang/test/Fir/Todo/gentypedesc.fir [deleted file]
flang/test/Fir/fir-ops.fir
flang/test/Lower/allocatable-polymorphic.f90
flang/test/Lower/intentout-deallocate.f90