[flang] Carry dynamic type when emboxing polymorphic pointer
authorValentin Clement <clementval@gmail.com>
Thu, 27 Oct 2022 18:56:39 +0000 (20:56 +0200)
committerValentin Clement <clementval@gmail.com>
Thu, 27 Oct 2022 18:57:09 +0000 (20:57 +0200)
commitea1e767a060ca2c9deb0326f20ccc5291100e530
tree0ee13cd41829c55af8d812c1090d5d0f909f0036
parent06fcd149d176e87188801e77433c731013b32d74
[flang] Carry dynamic type when emboxing polymorphic pointer

In order to be passed as passed-object in the dynamic dispatch, the
polymorphic pointer entity are emboxed. In this process, the dynamic
type must be preserve and pass to fir.embox as the tdesc operand. This
patch introduce a new ExtendedValue that allow to carry over the
dynamic type when the value is unboxed.

Depends on D136820

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D136824
flang/include/flang/Optimizer/Builder/BoxValue.h
flang/lib/Frontend/CompilerInvocation.cpp
flang/lib/Lower/ConvertExpr.cpp
flang/lib/Optimizer/Builder/BoxValue.cpp
flang/lib/Optimizer/Builder/FIRBuilder.cpp
flang/lib/Optimizer/Builder/MutableBox.cpp
flang/test/Lower/allocatable-polymorphic.f90