From 4bd08dab5ff99d094513f4adf4bf16bbce8f5a1f Mon Sep 17 00:00:00 2001 From: Faris Rehman Date: Wed, 17 Feb 2021 15:55:56 +0000 Subject: [flang][driver] Add debug dump options Add the following options: * -fdebug-dump-symbols * -fdebug-dump-parse-tree * -fdebug-dump-provenance Summary of changes: - Add 3 new frontend actions: DebugDumpSymbolsAction, DebugDumpParseTreeAction and DebugDumpProvenanceAction - Add a unique pointer to the Semantics instance created in PrescanAndSemaAction - Move fatal semantic error reporting to its own method, FrontendActions#reportFatalSemanticErrors - Port most tests using `-fdebug-dump-symbols` and `-fdebug-dump-parse-tree` to the new driver if built, otherwise default to f18 Differential Revision: https://reviews.llvm.org/D96716 --- flang/lib/Frontend/CompilerInvocation.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index cd104d3..ecc0fda 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -116,6 +116,15 @@ static InputKind ParseFrontendArgs(FrontendOptions &opts, case clang::driver::options::OPT_fdebug_unparse_with_symbols: opts.programAction_ = DebugUnparseWithSymbols; break; + case clang::driver::options::OPT_fdebug_dump_symbols: + opts.programAction_ = DebugDumpSymbols; + break; + case clang::driver::options::OPT_fdebug_dump_parse_tree: + opts.programAction_ = DebugDumpParseTree; + break; + case clang::driver::options::OPT_fdebug_dump_provenance: + opts.programAction_ = DebugDumpProvenance; + break; // TODO: // case calng::driver::options::OPT_emit_llvm: -- cgit v1.1