aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/FrontendTool
diff options
context:
space:
mode:
authorAndrzej Warzynski <andrzej.warzynski@arm.com>2021-04-14 10:43:14 +0000
committerAndrzej Warzynski <andrzej.warzynski@arm.com>2021-04-21 09:31:36 +0000
commitdc256a443a456a8e0e4d72736fee1c9442bcf4bd (patch)
treeb7b681db5ad7291ecf8b8fab9299c5fb5a4497e2 /flang/lib/FrontendTool
parentcd64273f5ed39ec697ff1e20a1fe25ebd3502629 (diff)
downloadllvm-dc256a443a456a8e0e4d72736fee1c9442bcf4bd.zip
llvm-dc256a443a456a8e0e4d72736fee1c9442bcf4bd.tar.gz
llvm-dc256a443a456a8e0e4d72736fee1c9442bcf4bd.tar.bz2
[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
Diffstat (limited to 'flang/lib/FrontendTool')
-rw-r--r--flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index 462de52..93bbf4f 100644
--- a/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -67,6 +67,9 @@ static std::unique_ptr<FrontendAction> CreateFrontendBaseAction(
case DebugPreFIRTree:
return std::make_unique<DebugPreFIRTreeAction>();
break;
+ case GetDefinition:
+ return std::make_unique<GetDefinitionAction>();
+ break;
case GetSymbolsSources:
return std::make_unique<GetSymbolsSourcesAction>();
break;