This is an archive of the discontinued LLVM Phabricator instance.

[flang] Handle non derived-type unlimited polymorphic allocation
ClosedPublic

Authored by clementval on Nov 3 2022, 1:24 PM.

Details

Summary

Runtime call to PointerNullifyDerived or AllocatableInitDerived
should only be generated for derived-type allocation of polymorphic entities.
With unlimited polymorphic entities, it is possible that the type spec is not
a derived-type. Avoid failure in that case.

Diff Detail

Event Timeline

clementval created this revision.Nov 3 2022, 1:24 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 3 2022, 1:24 PM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Nov 3 2022, 1:24 PM
PeteSteinfeld accepted this revision.Nov 3 2022, 3:03 PM

Aside from that one nit, all builds and tests correctly and looks good.

flang/lib/Lower/Allocatable.cpp
485

Should read "calls" rather than "call".

This revision is now accepted and ready to land.Nov 3 2022, 3:03 PM
clementval marked an inline comment as done.Nov 4 2022, 12:29 AM