This is an archive of the discontinued LLVM Phabricator instance.

[flang][NFC] Centralize fir.class addition in ConvertType
ClosedPublic

Authored by clementval on Feb 7 2023, 5:05 AM.

Details

Summary

fir.class type is always needed for polymorphic and unlimited
polymorphic entities. Wrapping the element type with a fir.class
type was done in ConvertType for some case and else where in the
code for other. Centralize this in ConvertType when converting
from expr or symbol.

Diff Detail

Event Timeline

clementval created this revision.Feb 7 2023, 5:05 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 7 2023, 5:05 AM
clementval requested review of this revision.Feb 7 2023, 5:05 AM
jeanPerier accepted this revision.Feb 7 2023, 6:27 AM

LGTM

flang/lib/Lower/ConvertType.cpp
293

Will this also fir.class for TYPE(*) ? Until now, fir.box<None> was used for them, right ?
I am not opposed using fir.class for them too, the fallout is just not 100% clear in my mind.

This revision is now accepted and ready to land.Feb 7 2023, 6:27 AM
clementval added inline comments.Feb 7 2023, 6:39 AM
flang/lib/Lower/ConvertType.cpp
293

It's not clear in my mind as well and I think for the time being keeping them as fir.box<none> might be safer. I'll update the boolean value to get rid of assumed type.

Remove Assumed Type

clementval marked an inline comment as done.Feb 8 2023, 12:45 AM