This is an archive of the discontinued LLVM Phabricator instance.

[flang] Handle polymorphic passed object in host association
ClosedPublic

Authored by clementval on Dec 6 2022, 6:00 AM.

Details

Summary

Polymorphic entities are always emboxed. This patch
handles host association of polyrmophic entities as passed object.

Diff Detail

Event Timeline

clementval created this revision.Dec 6 2022, 6:00 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 6 2022, 6:00 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Dec 6 2022, 6:00 AM

Other than the nit about the edge case, looks good to me.

flang/lib/Lower/HostAssociations.cpp
248

Can you add a TODO if this is a polymorphic array with non default lower bounds ?

I think this code would not handle it correctly since the fir.class may not contain the lower bound values (and cares needs to be taken to shoe them in if the fir.class is OPTIONAL). HLFIR variables will probably help because the lower bound "shoe-horning" will be handled in the hlfir.declare.

Add TODO for polymorphic array with non default lower bound

All builds and tests correctly and is formatted correctly.

Fix patch application

jeanPerier accepted this revision.Dec 7 2022, 12:46 AM

LGTM, thanks

This revision is now accepted and ready to land.Dec 7 2022, 12:46 AM
This revision was landed with ongoing or failed builds.Dec 7 2022, 3:01 AM
This revision was automatically updated to reflect the committed changes.