aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAndrzej Warzynski <andrzej.warzynski@arm.com>2021-03-30 10:35:42 +0000
committerAndrzej Warzynski <andrzej.warzynski@arm.com>2021-04-08 09:44:19 +0000
commite81b3401177a67481605447ea5250d8345cb4341 (patch)
tree8fd92df50ee929a1f143f426e71c461e3f33db65 /flang/lib/Frontend/CompilerInvocation.cpp
parent8675ef100f8cbf59f2e90f4836fb92db83b6062e (diff)
downloadllvm-e81b3401177a67481605447ea5250d8345cb4341.zip
llvm-e81b3401177a67481605447ea5250d8345cb4341.tar.gz
llvm-e81b3401177a67481605447ea5250d8345cb4341.tar.bz2
[flang][driver] Add debug options not requiring semantic checks
This patch adds two debugging options in the new Flang driver (flang-new): *fdebug-unparse-no-sema *fdebug-dump-parse-tree-no-sema Each of these options combines two options from the "throwaway" driver (left: f18, right: flang-new): * `-fdebug-uparse -fdebug-no-semantics` --> `-fdebug-unparse-no-sema` * `-fdebug-dump-parse-tree -fdebug-no-semantics` --> `-fdebug-dump-parse-tree-no-sema` There are no plans to implement `-fdebug-no-semantics` in the new driver. Such option would be too powerful. Also, it would only make sense when combined with specific frontend actions (`-fdebug-unparse` and `-fdebug-dump-parse-tree`). Instead, this patch adds 2 specialised options listed above. Each of these is implemented through a dedicated FrontendAction (also added). The new frontend actions are implemented in terms of a new abstract base action: `PrescanAndSemaAction`. This new base class was required so that we can have finer control over what steps within the frontend are executed: * `PrescanAction`: run the _prescanner_ * `PrescanAndSemaAction`: run the _prescanner_ and the _parser_ (new in this patch) * `PrescanAndSemaAction`: run the _prescanner_, _parser_ and run the _semantic checks_ This patch introduces `PrescanAndParseAction::BeginSourceFileAction`. Apart from the semantic checks removed at the end, it is similar to `PrescanAndSemaAction::BeginSourceFileAction`. Differential Revision: https://reviews.llvm.org/D99645
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--flang/lib/Frontend/CompilerInvocation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index 43d9d41..d1203c7 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -127,6 +127,9 @@ static InputKind ParseFrontendArgs(FrontendOptions &opts,
case clang::driver::options::OPT_fdebug_unparse:
opts.programAction_ = DebugUnparse;
break;
+ case clang::driver::options::OPT_fdebug_unparse_no_sema:
+ opts.programAction_ = DebugUnparseNoSema;
+ break;
case clang::driver::options::OPT_fdebug_unparse_with_symbols:
opts.programAction_ = DebugUnparseWithSymbols;
break;
@@ -136,6 +139,9 @@ static InputKind ParseFrontendArgs(FrontendOptions &opts,
case clang::driver::options::OPT_fdebug_dump_parse_tree:
opts.programAction_ = DebugDumpParseTree;
break;
+ case clang::driver::options::OPT_fdebug_dump_parse_tree_no_sema:
+ opts.programAction_ = DebugDumpParseTreeNoSema;
+ break;
case clang::driver::options::OPT_fdebug_dump_provenance:
opts.programAction_ = DebugDumpProvenance;
break;