Commit ab340f97 authored by Slava Zakharin's avatar Slava Zakharin
Browse files

[flang][hlfir] Support passing polymorphic expr for non-polymorphic dummy.

The actual polymorphic expression argument that is passed to a non-polymorphic
contiguous dummy has to be made a contiguous entity with the dynamic type
matching the declared type of the dummy argument.
The solution is to associate the expression with a temporary of the dynamic
type of the expression, then rebox the temporary to the declared type
of the dummy argument, and then, if necessary, make copy-in into another
temporary that is, finally, a contiguous entity with the required dynamic type.

With this change a single prepared argument may have up to two associated
clean-ups, so I had to change the clean-ups handling.

Reviewed By: tblah

Differential Revision: https://reviews.llvm.org/D157464
parent 15cfb449
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment