[flang][driver] Remove `%flang-new` from the LIT configuration`%flang-new` was introduced in the early days of the new driver to makea clear distinction between the tests for the current and the n
[flang][driver] Remove `%flang-new` from the LIT configuration`%flang-new` was introduced in the early days of the new driver to makea clear distinction between the tests for the current and the newdriver. We have since introduced `%flang` (compiler driver) and`%flang_fc1` (frontend driver) as the long term solution. This has allowedus to share tests between `flang-new` and `f18`. This patch replacesall uses of `%flang-new` with `%flang` and `%flang_fc1`.Some tests are reformatted so that all tests look uniform and are easierto follow. Where possible, `! REQUIRES: new-flang-driver` is deleted sothat more tests can be shared with `f18`. To facilitate this,`f{no-}implicit-none` are introduced in `f18` with semantics identicalto `flang-new`.Two tests are deleted rather than updated: * flang/test/Frontend/print-preprocess-C-file.f90 * flang/test/Frontend/print-preprocessed-file.f90Instead, there is plenty of preprocessor tests inflang/test/Preprocessing/.Differential Revision: https://reviews.llvm.org/D100174
show more ...
[flang][driver] Make the driver report diagnostics from the prescannerThis patch makes sure that diagnostics from the prescanner are reportedwhen running `flang-new -E` (i.e. only the preprocessor
[flang][driver] Make the driver report diagnostics from the prescannerThis patch makes sure that diagnostics from the prescanner are reportedwhen running `flang-new -E` (i.e. only the preprocessor phase isrequested). More specifically, the `PrintPreprocessedAction` action isupdated.With this patch we make sure that the `f18` and `flang-new` provideidentical output when running the preprocessor and the prescannergenerates diagnostics.Differential Revision: https://reviews.llvm.org/D94782
[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 preproces
[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 printedto either stdout or the output file (specified with `-` or `-o <output-file>`).Note that currently there is no mechanism to map options for thefrontend driver (i.e. Fortran::frontend::FrontendOptions) to options forthe 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. Furtherwork is required in order for CompilerInvocation to read and mapclang::driver::options to Fortran::parser::options.Co-authored-by: Andrzej Warzynski <[email protected]>Differential Revision: https://reviews.llvm.org/D88381
[Flang][Driver] Add infrastructure for basic frontend actions and file I/OThis patch introduces the dependencies required to read and manage input filesprovided by the command line option. It also
[Flang][Driver] Add infrastructure for basic frontend actions and file I/OThis patch introduces the dependencies required to read and manage input filesprovided by the command line option. It also adds the infrastructure to createand write to output files. The output is sent to either stdout or a file(specified with the `-o` flag).Separately, in order to be able to test the code for file I/O, it addsinfrastructure to create frontend actions. As a basic testable example, it addsthe `InputOutputTest` FrontendAction. The sole purpose of this action is toread a file from the command line and print it either to stdout or the outputfile. This action is run by using the `-test-io` flag also introduced in thispatch (available for `flang-new` and `flang-new -fc1`). With this patch:```flang-new -test-io input-file.f90```will read input-file.f90 and print it in the output file.The `InputOutputTest` frontend action has been introduced primarily tofacilitate testing. It is hidden from users (i.e. it's only displayed with`--help-hidden`). Currently Clang doesn’t have an equivalent action.`-test-io` is used to trigger the InputOutputTest action in the Flang frontenddriver. This patch makes sure that “flang-new” forwards it to “flang-new -fc1"by creating a preprocessor job. However, in Flang.cpp, `-test-io` is passed to“flang-new -fc1” without `-E`. This way we make sure that the preprocessor is_not_ run in the frontend driver. This is the desired behaviour: `-test-io`should only read the input file and print it to the output stream.co-authored-by: Andrzej Warzynski <[email protected]>Differential Revision: https://reviews.llvm.org/D87989