llvm-project/flang/lib/Frontend
Andrzej Warzynski 6f8ef1d6e8 [flang][driver] Add actions that execute despite semantic errors
This patch adds a new abstract class for frontend actions:
`PrescanAndSemaDebugAction`. It's almost identical to
`PrescanAndSemaAction`, but in the presence of semantic errors it does
not skip the corresponding `ExecuteAction` specialisation. Instead, it
runs it as if there were no semantic errors. This class is for developer
actions only (i.e.  front-end driver options).

The new behaviour does not affect the return code from `flang-new -fc1`
when the input file is semantically incorrect. The return code is
inferred from the number of driver diagnostics generated in
`CompilerInstance::ExecuteAction` and this patch does not change that.
More specifically, the semantic errors are still reported and hence the
driver is able to correctly report that the compilation has failed (with
a non-zero return code).

This new base class is meant for debug actions only and
`DebugDumpAllAction` is updated to demonstrate the new behaviour. With
this change, `flang-new -fc1 -fdebug-dump-all` dumps the parse tree and
symbols for all input files, regardless of whether any semantic errors
were found.

This patch addresses https://bugs.llvm.org/show_bug.cgi?id=52097.

Differential Revision: https://reviews.llvm.org/D111308
2021-10-11 11:52:05 +00:00
..
CMakeLists.txt [flang][driver] Add debug measure-parse-tree and pre-fir-tree options 2021-02-19 11:27:54 +00:00
CompilerInstance.cpp [flang] Refine output file generation 2021-08-21 15:18:48 +00:00
CompilerInvocation.cpp [flang][driver] Add support for Frontend Plugins 2021-08-12 11:42:16 +01:00
FrontendAction.cpp [flang][nfc] Tweak the FrontendAction class 2021-08-17 07:36:44 +00:00
FrontendActions.cpp [flang][driver] Add actions that execute despite semantic errors 2021-10-11 11:52:05 +00:00
FrontendOptions.cpp [flang] Produce proper "preprocessor output" for -E option 2021-07-30 15:13:56 -07:00
TextDiagnostic.cpp [flang] Introduce DiagnosticConsumer classes in libflangFrontend 2020-10-05 17:46:44 +01:00
TextDiagnosticBuffer.cpp [flang] Introduce DiagnosticConsumer classes in libflangFrontend 2020-10-05 17:46:44 +01:00
TextDiagnosticPrinter.cpp [flang] Introduce DiagnosticConsumer classes in libflangFrontend 2020-10-05 17:46:44 +01:00