[flang][driver] Add `-fdebug-dump-parsing-log`
authorAndrzej Warzynski <andrzej.warzynski@arm.com>
Tue, 23 Feb 2021 17:59:17 +0000 (17:59 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Wed, 10 Mar 2021 12:09:16 +0000 (12:09 +0000)
commit523d7bc6f427f9ae32e54dbf1764826cfb269d21
tree0b384bb7d6aa24471b1c42e7055180cfffb56fc1
parenta776942ba1aa0e381dd41a01de4b54fc5dc431cd
[flang][driver] Add `-fdebug-dump-parsing-log`

This patch adds `-fdebug-dump-parsing-log` in the new driver. This option is
semantically identical to `-fdebug-instrumented-parse` in `f18` (the
former is added as an alias in `f18`).

As dumping the parsing log makes only sense for instrumented parses, we
set Fortran::parser::Options::instrumentedParse to `True` when
`-fdebug-dump-parsing-log` is used. This is consistent with `f18`.

To facilitate tweaking the configuration of the frontend based on the
action being requested, `setUpFrontendBasedOnAction` is introduced in
CompilerInvocation.cpp.

Differential Revision: https://reviews.llvm.org/D97457
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/debug-parsing-log.f90 [new file with mode: 0644]
flang/test/Driver/driver-help.f90
flang/tools/f18/f18.cpp