[PATCH] D108035: [flang][nfc] Move `Semantics` from `FrontendAction` to `CompilerInstance`

Andrzej Warzynski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 13 07:06:18 PDT 2021


awarzynski created this revision.
Herald added a reviewer: sscalpone.
awarzynski requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108035

Files:
  flang/include/flang/Frontend/CompilerInstance.h
  flang/include/flang/Frontend/FrontendActions.h
  flang/lib/Frontend/FrontendActions.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108035.366272.patch
Type: text/x-patch
Size: 7623 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210813/e5a3f397/attachment.bin>


More information about the llvm-commits mailing list