This is an archive of the discontinued LLVM Phabricator instance.

[flang] Accommodate module subprograms defined in the same module
ClosedPublic

Authored by klausler on Mar 2 2022, 11:22 AM.

Details

Summary

The symbol table, name resolution, and semantic checks for module
subprograms -- esp. for MODULE FUNCTION and MODULE SUBROUTINE, but
also MODULE PROCEDURE -- essentially assumed that the subprogram
would be defined in a submodule of the (sub)module containing its
interface. However, it is conforming to instead declare a module
subprogram in the *same* (sub)module as its interface, and we need
to handle that case.

Since this case involves two symbols in the same scope with the same
name, the symbol table details for subprograms have been extended
with a pointer to the original module interface, rather than relying
on searching in scopes.

Diff Detail

Event Timeline

klausler created this revision.Mar 2 2022, 11:22 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Mar 2 2022, 11:22 AM
PeteSteinfeld accepted this revision.Mar 2 2022, 12:29 PM

All builds and tests correctly and looks good.

This revision is now accepted and ready to land.Mar 2 2022, 12:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 2 2022, 1:07 PM