[flang] Add fir.dispatch code generation
authorValentin Clement <clementval@gmail.com>
Wed, 19 Oct 2022 07:41:23 +0000 (09:41 +0200)
committerValentin Clement <clementval@gmail.com>
Wed, 19 Oct 2022 07:41:47 +0000 (09:41 +0200)
commit6e85b8807fd473f58ac6a9a58a400a50c5c3c76e
tree644cb64a20eb123367a9d22ffb253a11e74c8d40
parent2e73129483c4be78d32f4bbe3f9a3130d9fc83b7
[flang] Add fir.dispatch code generation

fir.dispatch code generation uses the binding table stored in the
type descriptor. There is no runtime call involved. The binding table
is always build from the parent type so the index of a specific binding
is the same in the parent derived-type or in the extended type.

Follow-up patches will deal cases not present here such as allocatable
polymorphic entities or pointers.

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D136189
flang/include/flang/Optimizer/CodeGen/CGOps.td
flang/lib/Lower/ConvertExpr.cpp
flang/lib/Optimizer/CodeGen/CodeGen.cpp
flang/lib/Optimizer/CodeGen/PreCGRewrite.cpp
flang/lib/Optimizer/CodeGen/TypeConverter.h
flang/test/Fir/Todo/dispatch.fir [deleted file]
flang/test/Fir/dispatch.f90 [new file with mode: 0644]