The polymorphic temporary array is created using the provided mold
and the shape of the hlfir.elemental. The array is allocated right away,
because it is going to be initialized element per element.
Depends on D157315
Reviewed By: clementval, tblah
Differential Revision: https://reviews.llvm.org/D157316
This patch sets 'polymorphic' attribute of hlfir::ExprType when
the value is created from a polymorphic entity.
Memoization of such ExprType involves creating a mutable descriptor
on the stack, which is initialized (as a null box) and passed to
AllocatableApplyMold with the mold being the entity from which
the ExprType value is being created.
This patch fixes "creating polymorphic temporary" TODO and also
several cases of "'fir.convert' op invalid type conversion" error.
Reviewed By: tblah
Differential Revision: https://reviews.llvm.org/D155541
In D144997, the dynamic type of polymorphic entities is reset to the declared
type when the FROM is deallocated. To do this, the declared type was passed as
a fir.type_desc op. For unlimited polymorphic entities, this should just be a
null pointer.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D145380
Update move_alloc to carry over the dyanmic type of `from` to `to`
and reset the dynamic type of `from` to its declared type when it
is polymorphic.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D144997
This patch relies on D141286 for the runtime implementation of
move_alloc.
Reviewed By: jeanPerier
Differential Revision: https://reviews.llvm.org/D141616