[all-commits] [llvm/llvm-project] 2a7bb8: [flang][driver] Add `-fno-analyzed-objects-for-unp...

Andrzej WarzyƄski via All-commits all-commits at lists.llvm.org
Fri Jun 25 05:31:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2a7bb8494e9c58b44ad7142d8d309455cd669603
      https://github.com/llvm/llvm-project/commit/2a7bb8494e9c58b44ad7142d8d309455cd669603
  Author: Andrzej Warzynski <andrzej.warzynski at arm.com>
  Date:   2021-06-25 (Fri, 25 Jun 2021)

  Changed paths:
    M clang/include/clang/Driver/Options.td
    M flang/include/flang/Frontend/CompilerInvocation.h
    M flang/lib/Frontend/CompilerInvocation.cpp
    M flang/lib/Frontend/FrontendActions.cpp
    M flang/lib/Frontend/FrontendOptions.cpp
    M flang/test/Driver/driver-help.f90
    A flang/test/Driver/unparse-use-analyzed.f95
    M flang/tools/f18/f18.cpp
    M flang/tools/f18/flang

  Log Message:
  -----------
  [flang][driver] Add `-fno-analyzed-objects-for-unparse`

This patch adds a new option for the new Flang driver:
`-fno-analyzed-objects-for-unparse`. The semantics are similar to
`-funparse-typed-exprs-to-f18-fc` from `f18`. For consistency, the
latter is replaced with `-fno-analyzed-objects-for-unparse`.

The new option controls the behaviour of the unparser (i.e. the action
corresponding to `-fdebug-unparse`). The default behaviour is to use the
analyzed objects when unparsing. The new flag can be used to turn this
off, so that the original parse-tree objects are used. The analyzed
objects are generated during the semantic checks [1].

This patch also updates the semantics of
`-fno-analyzed-objects-for-unparse`/`-funparse-typed-exprs-to-f18-fc`
in `f18`, so that this flag is always taken into account when `Unparse`
is used (this way the semantics in `f18` and `flang-new` are identical).

The added test file is based on example from Peter Steinfeld.

[1]
https://github.com/llvm/llvm-project/blob/main/flang/docs/Semantics.md

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




More information about the All-commits mailing list