[all-commits] [llvm/llvm-project] 265a99: [flang][nfc] Move `Semantics` from `FrontendAction...

Andrzej WarzyƄski via All-commits all-commits at lists.llvm.org
Sun Aug 15 02:34:37 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 265a9961d13e78fc1a5f4b478ac9651fcccdf92b
      https://github.com/llvm/llvm-project/commit/265a9961d13e78fc1a5f4b478ac9651fcccdf92b
  Author: Andrzej Warzynski <andrzej.warzynski at arm.com>
  Date:   2021-08-15 (Sun, 15 Aug 2021)

  Changed paths:
    M flang/include/flang/Frontend/CompilerInstance.h
    M flang/include/flang/Frontend/FrontendActions.h
    M flang/lib/Frontend/FrontendActions.cpp

  Log Message:
  -----------
  [flang][nfc] Move `Semantics` from `FrontendAction` to `CompilerInstance`

`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
classes.

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.

Differential Revision: https://reviews.llvm.org/D108035




More information about the All-commits mailing list