This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix some module file issues exposed by Whizard
ClosedPublic

Authored by klausler on Jan 13 2021, 2:16 PM.

Details

Summary
Generic type-bound interfaces for user-defined operators need to be formatted
as "OPERATOR(.op.)", not just ".op."

PRIVATE generics need to be marked as such.

Declaration ordering: when a generic interface shadows a
derived type of the same name, it needs to be emitted to the
module file at the point of definition of the derived type;
otherwise, the derived type's definition may appear after its
first use.

The module symbol for a module read from a module file needs
to be marked as coming from a module file before semantic
processing is performed on the contents of the module so that
any special handling for declarations in module files can be
properly activated.

IMPORT statements were sometimes missing for use-associated
symbols in surrounding scopes; fine-tune NeedImport().

Diff Detail

Event Timeline

klausler created this revision.Jan 13 2021, 2:16 PM
klausler requested review of this revision.Jan 13 2021, 2:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2021, 2:16 PM
klausler updated this revision to Diff 316519.Jan 13 2021, 2:33 PM

Merged with Tim's fix from earlier today (test was failing)

tskeith accepted this revision.Jan 13 2021, 4:14 PM
This revision is now accepted and ready to land.Jan 13 2021, 4:14 PM
This revision was automatically updated to reflect the committed changes.