llvm-project/flang/lib/Frontend
Caroline Concatto d28de0d7f2 [Flang][Driver] Add PrintPreprocessedInput FrontendAction (`flang-new -E`)
This patch implements the first frontend action for the Flang parser (i.e.
Fortran::parser). This action runs the preprocessor and is invoked with the
`-E` flag. (i.e. `flang-new -E <input-file>). The generated output is printed
to either stdout or the output file (specified with `-` or `-o <output-file>`).

Note that currently there is no mechanism to map options for the
frontend driver (i.e. Fortran::frontend::FrontendOptions) to options for
the parser (i.e. Fortran::parser::Options). Instead,
Frotran::parser::options are hard-coded to:

```
std::vector<std::string> searchDirectories{"."s};
searchDirectories = searchDirectories;
isFixedForm = false;
_encoding(Fortran::parser::Encoding::UTF_8);
```

These default settings are compatible with the current Flang driver. Further
work is required in order for CompilerInvocation to read and map
clang::driver::options to Fortran::parser::options.

Co-authored-by: Andrzej Warzynski <andrzej.warzynski@arm.com>

Differential Revision: https://reviews.llvm.org/D88381
2020-11-02 14:03:35 +00:00
..
CMakeLists.txt [Flang][Driver] Add infrastructure for basic frontend actions and file I/O 2020-10-24 14:58:32 +01:00
CompilerInstance.cpp [Flang][Driver] Add PrintPreprocessedInput FrontendAction (`flang-new -E`) 2020-11-02 14:03:35 +00:00
CompilerInvocation.cpp [Flang][Driver] Add PrintPreprocessedInput FrontendAction (`flang-new -E`) 2020-11-02 14:03:35 +00:00
FrontendAction.cpp [Flang][Driver] Add PrintPreprocessedInput FrontendAction (`flang-new -E`) 2020-11-02 14:03:35 +00:00
FrontendActions.cpp [Flang][Driver] Add PrintPreprocessedInput FrontendAction (`flang-new -E`) 2020-11-02 14:03:35 +00:00
FrontendOptions.cpp [Flang][Driver] Add infrastructure for basic frontend actions and file I/O 2020-10-24 14:58:32 +01: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