This is an archive of the discontinued LLVM Phabricator instance.

[flang][driver] Add support for `-fget-definition`

Authored by awarzynski on Apr 15 2021, 6:51 AM.



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

Depends on:

Diff Detail

Event Timeline

awarzynski created this revision.Apr 15 2021, 6:51 AM
awarzynski requested review of this revision.Apr 15 2021, 6:51 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 15 2021, 6:51 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Rebase on top of D100556

This revision is now accepted and ready to land.Apr 20 2021, 3:45 AM
This revision was landed with ongoing or failed builds.Apr 21 2021, 2:31 AM
This revision was automatically updated to reflect the committed changes.