This is an archive of the discontinued LLVM Phabricator instance.

[flang] Update to fir::isUnlimitedPolymorphicType and fir::isPolymorphicType functions
ClosedPublic

Authored by clementval on Oct 4 2022, 4:33 AM.

Details

Summary

This patch update the fir::isUnlimitedPolymorphicType function
to reflect the chosen design. It adds also a fir::isPolymorphicType
function.

Diff Detail

Event Timeline

clementval created this revision.Oct 4 2022, 4:33 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Oct 4 2022, 4:33 AM

Looks good to me, but logic depends on your answer about TYPE(*) in D135141 (if should be fir.box<None> or fir.class<None, assumed type>).

Looks good to me, but logic depends on your answer about TYPE(*) in D135141 (if should be fir.box<None> or fir.class<None, assumed type>).

So in that case, if we use fir.box<none> for TYPE(*), the function should return true since assumed type entities are unlimited polymorphic. Since we are using fir.box<none> in the lowering currently with any boxed entities, they will all get a true return for isUnlimitedPolymorphic. I don't think that is a real issue but I just wanted to raise it.

Looks good to me, but logic depends on your answer about TYPE(*) in D135141 (if should be fir.box<None> or fir.class<None, assumed type>).

So in that case, if we use fir.box<none> for TYPE(*), the function should return true since assumed type entities are unlimited polymorphic. Since we are using fir.box<none> in the lowering currently with any boxed entities, they will all get a true return for isUnlimitedPolymorphic. I don't think that is a real issue but I just wanted to raise it.

Good point. On our current usage of fir.box<None>, I think this is OK.

Update after change in D135141. Also add isPolymorphicType

clementval retitled this revision from [flang] Update fir::isUnlimitedPolymorphicType function to [flang] Update to fir::isUnlimitedPolymorphicType and fir::isPolymorphicType functions.Oct 4 2022, 12:22 PM
clementval edited the summary of this revision. (Show Details)
jeanPerier accepted this revision.Oct 5 2022, 12:11 AM

Looks good

This revision is now accepted and ready to land.Oct 5 2022, 12:11 AM