llvm-project/flang/lib/Frontend
Andrzej Warzynski d18a9aeae9 [flang] Make the frontend driver error out when requesting multiple actions
With this change, the following invocations will be treated as errors
(multiple actions are specified):
```
$ flang-new -fc1 -E -fsyntax-only file.95
$ flang-new -fc1 -fsyntax-only -fdebug-dump-symbols file.95
```
In the examples above it is not clear whether it is `-fsyntax-only` or
the other action that is run (i.e. `-E` or `-fdebug-dump-symbols`). It
makes sense to disallow such usage. This should also lead to cleaner and
clearer tests (the `RUN` lines using `%flang_fc1` will only allow one
action).

This change means that `flang-new -fc1` and `clang -cc1` will behave
differently when multiple action options are specified. As frontend
drivers are mostly used by compiler developers, this shouldn't affect or
confuse the compiler end-users. Also, `flang-new` and `clang` remain
consistent.

Tests are updated accordingly. More specifically, I've made sure that
every test specifies only one action. I've also taken the opportunity to
simplify "multiple-input-files.f90" a bit.

Differential Revision: https://reviews.llvm.org/D111781
2021-12-17 10:05:28 +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] Make the frontend driver error out when requesting multiple actions 2021-12-17 10:05:28 +00: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