[PATCH] D100558: [flang][driver] Add support for `-fget-definition`

Andrzej Warzynski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 15 06:51:27 PDT 2021


awarzynski created this revision.
Herald added a reviewer: sscalpone.
Herald added subscribers: jansvoboda11, dang.
awarzynski requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

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


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100558

Files:
  clang/include/clang/Driver/Options.td
  flang/include/flang/Frontend/FrontendActions.h
  flang/include/flang/Frontend/FrontendOptions.h
  flang/lib/Frontend/CompilerInvocation.cpp
  flang/lib/Frontend/FrontendActions.cpp
  flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
  flang/test/Driver/driver-help.f90
  flang/test/Driver/get-definition.f90
  flang/test/Semantics/getdefinition01.f90
  flang/test/Semantics/getdefinition02.f
  flang/test/Semantics/getdefinition03-a.f90
  flang/test/Semantics/getdefinition04.f90
  flang/test/Semantics/getdefinition05.f90
  flang/tools/f18/f18.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100558.337745.patch
Type: text/x-patch
Size: 15305 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210415/2bc0a0a9/attachment.bin>


More information about the cfe-commits mailing list