This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix SELECT TYPE lowering when CLASS DEFAULT is not the last type guard
ClosedPublic

Authored by clementval on Jan 19 2023, 1:28 AM.

Details

Summary

CLASS DEFAULT needs to be the last attribute when fir.select_type op is created.
It needs to be at its actual position in the Fortran code when the TypeGuardStmt
are processed. The current lowering was crashing when CLASS DEFAULT was not at
the last position.
This patch fixes the issue by tracking the actual position of the CLASS DEFAULT
type guard and set it at the correct position after the fir.select_type op
is created.

Diff Detail

Event Timeline

clementval created this revision.Jan 19 2023, 1:28 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 19 2023, 1:28 AM
clementval requested review of this revision.Jan 19 2023, 1:28 AM
jeanPerier accepted this revision.Jan 19 2023, 5:27 AM

LGTM, I think the bot failure is unrelated.

This revision is now accepted and ready to land.Jan 19 2023, 5:27 AM
PeteSteinfeld accepted this revision.Jan 19 2023, 6:27 AM

All builds and tests correctly and looks good.

This revision was landed with ongoing or failed builds.Jan 19 2023, 8:32 AM
This revision was automatically updated to reflect the committed changes.