Page MenuHomePhabricator

[flang] simplify derived type info table format

Authored by jeanPerier on May 19 2021, 6:25 AM.


  • Replace class(*) member by a c_ptr member to avoid having to handle polymorphic components in the type info table generation. Polymorphic entity handling will require these very tables to be lowered properly. Note: keep the init as NullPointer/Designators. This is technically invalid Fortran, the init should have c_ptr type. But wrapping this in a C_LOC intrinsic call would make runtime generation and lowering more complex with no real benefits.
  • ComponentIterator is crashing when used on the generated derived types in GetScope. This patch makes GetScope more robust, but it is not entirely clear to me why this is only happening with the generated derived types.
  • The type of generated character globals was incorrect because Scope::FindType was matching character types with different length. Add a CharacterTypeSpec == operator to fix this.

Diff Detail

Event Timeline

jeanPerier created this revision.May 19 2021, 6:25 AM
jeanPerier requested review of this revision.May 19 2021, 6:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 19 2021, 6:25 AM
PeteSteinfeld accepted this revision.May 19 2021, 6:40 AM

All builds, tests, and looks good.

This revision is now accepted and ready to land.May 19 2021, 6:40 AM
klausler accepted this revision.May 19 2021, 8:37 AM
klausler added inline comments.

The "true" part of the conditional expression needs no DEREF protection.

DEREF only the false part of introduced ternary.

jeanPerier marked an inline comment as done.May 20 2021, 9:23 AM
This revision was landed with ongoing or failed builds.May 20 2021, 9:28 AM
This revision was automatically updated to reflect the committed changes.