Page MenuHomePhabricator

[flang][nfc] Move `Semantics` from `FrontendAction` to `CompilerInstance`

Authored by awarzynski on Aug 13 2021, 7:06 AM.



CompilerInstance is a more appropriate place for a key component of
the frontend like Semantics.

This change opens a path for us to introduce new frontend actions that
will also run semantics, but for which inheriting from
PrescanAndSemaAction wouldn't make much sense. For example, for
code-gen actions we plan to introduce a dedicate hierarchy of action

I've also added a doxyment for CompilerInstance to add a bit of
context for this change (and also make future refactoring more informed).
As CompilerInstance in Flang has been inspired by its counterpart in
Clang, this comment is roughly a verbatim copy of the comment in Clang
(with some adjustments from me). Credits to Daniel Dunbar for the great
design and the original comment.

Diff Detail

Event Timeline

awarzynski created this revision.Aug 13 2021, 7:06 AM
awarzynski requested review of this revision.Aug 13 2021, 7:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 13 2021, 7:06 AM
ashermancinelli accepted this revision.Aug 13 2021, 10:18 AM

This introduces a very clean level of indirection imo. +1 for adapting the clang documentation as well!

This revision is now accepted and ready to land.Aug 13 2021, 10:18 AM
This revision was landed with ongoing or failed builds.Aug 15 2021, 2:34 AM
This revision was automatically updated to reflect the committed changes.