This is an archive of the discontinued LLVM Phabricator instance.

[flang] Carry the whole polymorphic box in PolymorphicValue
ClosedPublic

Authored by clementval on Jan 12 2023, 6:57 AM.

Details

Summary

Until now, only the address of the type descriptor was hold in
a PolymorphicValue. In some cases, the element size and the
type code are also needed when creating new polymorphic
descriptors from an element of a polymorphic entity.

This patch updates PolymorphicValue to carry the source
descriptor from which the element is extracted. The source
descriptor is then used when emboxing the element to a new
polymorphic descriptor.

This simplify the code done in D141274 and will be used
when creating polymorphic temporary as well.

Diff Detail

Event Timeline

clementval created this revision.Jan 12 2023, 6:57 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 12 2023, 6:57 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Jan 12 2023, 6:57 AM
jeanPerier accepted this revision.Jan 12 2023, 7:49 AM

Thanks for the clean-up, this looks great to me.

This revision is now accepted and ready to land.Jan 12 2023, 7:49 AM
PeteSteinfeld accepted this revision.Jan 12 2023, 8:49 AM

All builds and tests correctly and looks good.