[all-commits] [llvm/llvm-project] dc256a: [flang][driver] Add support for `-fget-definition`

Andrzej WarzyƄski via All-commits all-commits at lists.llvm.org
Wed Apr 21 02:32:10 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dc256a443a456a8e0e4d72736fee1c9442bcf4bd
      https://github.com/llvm/llvm-project/commit/dc256a443a456a8e0e4d72736fee1c9442bcf4bd
  Author: Andrzej Warzynski <andrzej.warzynski at arm.com>
  Date:   2021-04-21 (Wed, 21 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/get-definition.f90
    M flang/test/Semantics/getdefinition01.f90
    M flang/test/Semantics/getdefinition02.f
    M flang/test/Semantics/getdefinition03-a.f90
    M flang/test/Semantics/getdefinition04.f90
    M flang/test/Semantics/getdefinition05.f90
    M flang/tools/f18/f18.cpp

  Log Message:
  -----------
  [flang][driver] Add support for `-fget-definition`

This patch adds `-fget-definition` to `flang-new`. The semantics of this
option are identical in both drivers. The error message in the
"throwaway" driver is updated so that it matches the one from
`flang-new` (which is auto-generated and cannot be changed easily).

Tests are updated accordingly. A dedicated test for error handling was
added: get-definition.f90 (for the sake of simplicity,
getdefinition01.f90 no longer tests for errors).

The `ParseFrontendArgs` function is updated so that it can return
errors. This change is required in order to report invalid values
following `-fget-definition`.

The actual implementation of `GetDefinitionAction::ExecuteAction()` was
extracted from f18.cpp (i.e. the bit that deals with
`-fget-definition`).

Depends on: https://reviews.llvm.org/D100556

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




More information about the All-commits mailing list