[all-commits] [llvm/llvm-project] e81b34: [flang][driver] Add debug options not requiring se...

Andrzej WarzyƄski via All-commits all-commits at lists.llvm.org
Thu Apr 8 02:45:24 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e81b3401177a67481605447ea5250d8345cb4341
      https://github.com/llvm/llvm-project/commit/e81b3401177a67481605447ea5250d8345cb4341
  Author: Andrzej Warzynski <andrzej.warzynski at arm.com>
  Date:   2021-04-08 (Thu, 08 Apr 2021)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M flang/include/flang/Frontend/FrontendActions.h
    M flang/include/flang/Frontend/FrontendOptions.h
    M flang/lib/Frontend/CompilerInvocation.cpp
    M flang/lib/Frontend/FrontendActions.cpp
    M flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
    M flang/test/Driver/driver-help.f90
    A flang/test/Driver/dump-parse-tree-no-sema.f90
    M flang/test/Parser/omp-allocate-unparse.f90
    M flang/test/Parser/omp-atomic-unparse.f90
    M flang/tools/f18/f18.cpp

  Log Message:
  -----------
  [flang][driver] Add debug options not requiring semantic checks

This patch adds two debugging options in the new Flang driver
(flang-new):
  *fdebug-unparse-no-sema
  *fdebug-dump-parse-tree-no-sema
Each of these options combines two options from the "throwaway" driver
(left: f18, right: flang-new):
  * `-fdebug-uparse -fdebug-no-semantics` --> `-fdebug-unparse-no-sema`
  * `-fdebug-dump-parse-tree -fdebug-no-semantics` -->
    `-fdebug-dump-parse-tree-no-sema`

There are no plans to implement `-fdebug-no-semantics` in the new
driver.  Such option would be too powerful. Also, it would only make
sense when combined with specific frontend actions (`-fdebug-unparse`
and `-fdebug-dump-parse-tree`). Instead, this patch adds 2 specialised
options listed above. Each of these is implemented through a dedicated
FrontendAction (also added).

The new frontend actions are implemented in terms of a new abstract base
action: `PrescanAndSemaAction`. This new base class was required so that
we can have finer control over what steps within the frontend are
executed:
  * `PrescanAction`: run the _prescanner_
  * `PrescanAndSemaAction`: run the _prescanner_ and the _parser_ (new
     in this patch)
  * `PrescanAndSemaAction`: run the _prescanner_, _parser_ and run the
    _semantic checks_

This patch introduces `PrescanAndParseAction::BeginSourceFileAction`.
Apart from the semantic checks removed at the end, it is similar to
`PrescanAndSemaAction::BeginSourceFileAction`.

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




More information about the All-commits mailing list