|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4 |
|
| #
1e462faf |
| 29-Apr-2022 |
Andrzej Warzynski <[email protected]> |
[flang][driver] Switch to the MLIR coding style in the driver (nfc)
This patch re-factors the driver code in LLVM Flang (frontend + compiler) to use the MLIR style. For more context, please see: htt
[flang][driver] Switch to the MLIR coding style in the driver (nfc)
This patch re-factors the driver code in LLVM Flang (frontend + compiler) to use the MLIR style. For more context, please see: https://discourse.llvm.org/t/rfc-coding-style-in-the-driver/
Most changes here are rather self-explanatory. Accessors are renamed to be more consistent with the rest of LLVM (e.g. allSource --> getAllSources). Additionally, MLIR clang-tidy files are added in the affected directories.
clang-tidy and clang-format files were copied from MLIR. Small additional changes are made to silence clang-tidy/clang-format warnings.
[1] https://mlir.llvm.org/getting_started/DeveloperGuide/
Differential Revision: https://reviews.llvm.org/D125007
show more ...
|
|
Revision tags: llvmorg-14.0.3, llvmorg-14.0.2 |
|
| #
d902dd01 |
| 22-Apr-2022 |
Andrzej Warzynski <[email protected]> |
[flang][driver] NFC: Make code more in line with LLVM style
This patch basically implements [1] in ExecuteCompilerInvocation.cpp. It also: * replaces `CreateFrontendBaseAction` with `CreateFronten
[flang][driver] NFC: Make code more in line with LLVM style
This patch basically implements [1] in ExecuteCompilerInvocation.cpp. It also: * replaces `CreateFrontendBaseAction` with `CreateFrontendAction` (only one method is needed ATM, this change removes the extra indirection) * removes `InvalidAction` from the `ActionKind` enum (I don't think it adds much and keeping it would mean adding a new void case in `CreateFrontendAction`) * sets the default frontend action in FrontendOptions.h to `ParseSyntaxOnly` (note that this is still overridden independently in `ParseFrontendArg` in CompilerInvocation.cpp)
No new functionality is added, hence no tests.
[1] https://llvm.org/docs/CodingStandards.html#don-t-use-default-labels-in-fully-covered-switches-over-enumerations
Differential Revision: https://reviews.llvm.org/D124245
show more ...
|
|
Revision tags: llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2 |
|
| #
16a91a1c |
| 17-Feb-2022 |
Andrzej Warzynski <[email protected]> |
[flang][driver] Make `flang-new` always generate run-time type info
Currently, the driver generates the tables with "run-time type information for derived types" only when specific actions are run.
[flang][driver] Make `flang-new` always generate run-time type info
Currently, the driver generates the tables with "run-time type information for derived types" only when specific actions are run. However, the corresponding data might be required by the subsequent compilation stages (e.g. lowering, code-gen) and should be generated unconditionally. Note that this is only possible once the semantic checks have been run.
Note that when generating these tables, extra semantic errors might be generated. The driver will always report these and in most cases such semantic errors will cause the driver to exit immediately. The only exception are actions inheriting from `PrescanAndSemaDebugAction`. Currently, there's only one such action: `DebugDumpAllAction` (corresponds to `-fdebug-dump-all` command-line flag). I've updated the comments for this action to clarify this.
This change will mostly affect lowering, which currently is only available for most basic examples (e.g. empty programs). I wasn't able to find a working case that would demonstrate the new behaviour. I hope that this change is straightforward enough and am submitting it without a test.
Differential Revision: https://reviews.llvm.org/D120051
show more ...
|
|
Revision tags: llvmorg-14.0.0-rc1, llvmorg-15-init |
|
| #
4606f838 |
| 27-Jan-2022 |
Andrzej Warzynski <[email protected]> |
[flang][driver][nfc] Fix capitalisation
As pointed out in https://reviews.llvm.org/D93401, some methods in the Flang driver are named inconsistently. The driver strives to follow Flang's C++ style [
[flang][driver][nfc] Fix capitalisation
As pointed out in https://reviews.llvm.org/D93401, some methods in the Flang driver are named inconsistently. The driver strives to follow Flang's C++ style [1] and this patch updates these methods accordingly.
[1] https://github.com/llvm/llvm-project/blob/main/flang/docs/C%2B%2Bstyle.md
Differential Revision: https://reviews.llvm.org/D118381
show more ...
|
|
Revision tags: llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2 |
|
| #
4f21e6ae |
| 13-Aug-2021 |
Andrzej Warzynski <[email protected]> |
[flang][nfc] Tweak the FrontendAction class
This patch refactors the `FrontendAction` class. It merely moves code around so that re-using it is easier. No new functionality is introduced.
1. Three
[flang][nfc] Tweak the FrontendAction class
This patch refactors the `FrontendAction` class. It merely moves code around so that re-using it is easier. No new functionality is introduced.
1. Three new member methods are introduced: `RunPrescan`, `RunParse`, `RunSemanticChecks`. 2. The following free functions are re-implemented as member methods: * `reportFatalSemanticErrors` * `reportFatalScanningErrors` * `reportFatalParsingErrors` * `reportFatalErrors` `reportFatalSemanticErrors` is updated to resemble the other error reporting functions and to make the API more consistent. 3. The `BeginSourceFileAction` methods are simplified and the unused input argument is deleted.
Differential Revision: https://reviews.llvm.org/D108130
show more ...
|
| #
f52fc591 |
| 12-Aug-2021 |
Stuart Ellis <[email protected]> |
[flang][driver] Add support for Frontend Plugins
Introducing a plugin API and a simple HelloWorld Plugin example. This patch adds the `-load` and `-plugin` flags to frontend driver and the code arou
[flang][driver] Add support for Frontend Plugins
Introducing a plugin API and a simple HelloWorld Plugin example. This patch adds the `-load` and `-plugin` flags to frontend driver and the code around using custom frontend actions from within a plugin shared library object.
It also adds to the Driver-help test to check the help option with the updated driver flags.
Additionally, the patch creates a plugin-example test to check the HelloWorld plugin example runs correctly. As part of this, a new CMake flag (`FLANG_BUILD_EXAMPLES`) is added to allow the example to be built and for the test to run.
This Plugin API has only been tested on Linux.
Reviewed By: awarzynski
Differential Revision: https://reviews.llvm.org/D106137
show more ...
|
|
Revision tags: llvmorg-13.0.0-rc1 |
|
| #
23d4c4f3 |
| 29-Jul-2021 |
Andrzej Warzynski <[email protected]> |
[flang][nfc] Fix variable names in `FrontendOptions` & `PreprocessorOptions`
As all member variables in `FrontendOptions` and `PreprocessorOptions` are public, we should be naming them as `variable`
[flang][nfc] Fix variable names in `FrontendOptions` & `PreprocessorOptions`
As all member variables in `FrontendOptions` and `PreprocessorOptions` are public, we should be naming them as `variable` rather than `variable_` [1]. This patch fixes that.
Also, `FrontendOptions` & `PreprocessorOptions` are re-defined as a structs rather than classes (all fields are meant to be public).
[1] https://github.com/llvm/llvm-project/blob/main/flang/docs/C%2B%2Bstyle.md#naming
Differential Revision: https://reviews.llvm.org/D107062
show more ...
|
|
Revision tags: llvmorg-14-init |
|
| #
c1f068b8 |
| 01-Jul-2021 |
Andrzej Warzynski <[email protected]> |
[flang] Revert "PoC for Flang Driver Plugins"
This patch has not been reviewed and was commited by accident.
This reverts commit 788a5d4afe6407e647454a9832a7b4a27fba06bf.
|
|
Revision tags: llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3 |
|
| #
788a5d4a |
| 23-Jun-2021 |
Stuart Ellis <[email protected]> |
PoC for Flang Driver Plugins
|
|
Revision tags: llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1 |
|
| #
b83a4450 |
| 07-Apr-2021 |
Andrzej Warzynski <[email protected]> |
[flang][driver] Add support for `-cpp/-nocpp`
This patch adds support for the `-cpp` and `-nocpp` flags. The implemented semantics match f18 (i.e. the "throwaway" driver), but are different to gfort
[flang][driver] Add support for `-cpp/-nocpp`
This patch adds support for the `-cpp` and `-nocpp` flags. The implemented semantics match f18 (i.e. the "throwaway" driver), but are different to gfortran. In Flang the preprocessor is always run. Instead, `-cpp/-nocpp` are used to control whether predefined and command-line preprocessor macro definitions are enabled or not. In practice this is sufficient to model gfortran`s `-cpp/-nocpp`.
In the absence of `-cpp/-nocpp`, the driver will use the extension of the input file to decide whether to include the standard macro predefinitions. gfortran's documentation [1] was used to decide which file extension to use for this.
The logic mentioned above was added in FrontendAction::BeginSourceFile. That's relatively late in the driver set-up, but this roughly where the name of the input file becomes available. The logic for deciding between fixed and free form works in a similar way and was also moved to FrontendAction::BeginSourceFile for consistency (and to reduce code-duplication).
The `-cpp/-nocpp` flags are respected also when the input is read from stdin. This is different to: * gfortran (behaves as if `-cpp` was used) * f18 (behaves as if `-nocpp` was used)
Starting with this patch, file extensions are significant and some test files had to be renamed to reflect that. Where possible, preprocessor tests were updated so that they can be shared between `f18` and `flang-new`. This was implemented on top of adding new test for `-cpp/-nocpp`.
[1] https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D99292
show more ...
|
|
Revision tags: llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2 |
|
| #
d06e9403 |
| 04-Feb-2021 |
Andrzej Warzynski <[email protected]> |
[flang][driver] Add PrescanAction frontend action (nfc)
This new action encapsulates all actions that require the prescanner to be run before proceeding with other processing. By adding this new act
[flang][driver] Add PrescanAction frontend action (nfc)
This new action encapsulates all actions that require the prescanner to be run before proceeding with other processing. By adding this new action, we are better equipped to control which actions _do_ run the prescanner and which _do not_.
The following actions that require the prescanner are refactored to inherit from `PrescanAction`: * `PrintPreprocessedAction` * `ParseSyntaxOnlyAction` .
New virtual method is introduced to facilitate all this: * `BeginSourceFileAction` Like in Clang, this method is run inside `BeginSourceFile`. In other words, it is invoked before `ExecuteAction` for the corresponding frontend action is run. This method allows us to: * carry out any processing that is always required by the action (e.g. run the prescanner) * fine tune the settings/options on a file-by-file basis (e.g. to decide between fixed-form and free-form based on file extension)
This patch implements non-functional-changes.
Reviewed By: FarisRehman
Differential Revision: https://reviews.llvm.org/D95464
show more ...
|
|
Revision tags: llvmorg-11.1.0, llvmorg-11.1.0-rc3 |
|
| #
760e6c4c |
| 02-Feb-2021 |
Andrzej Warzynski <[email protected]> |
[flang][driver] Disallow non-existent input files in the frontend driver
This patch adds a check that verifies that the input file used when calling the frontend driver (i.e. `flang-new -fc1`) actua
[flang][driver] Disallow non-existent input files in the frontend driver
This patch adds a check that verifies that the input file used when calling the frontend driver (i.e. `flang-new -fc1`) actually exists. This was not required for the compiler driver, `flang-new`, as that's already handled in libclangDriver.
Once all input/output file management is moved to the driver, we should also check that for input from `stdin` the corresponding file descriptor was successfully acquired.
This patch also makes sure that the default action in the frontend is `ParseSyntaxOnly`. This is consistent with Clang. Before this change `flang-new -fc1` would do nothing, which makes testing changes like the one introduced here a bit tricky.
Reviewed By: SouraVX
Differential Revision: https://reviews.llvm.org/D95127
show more ...
|
|
Revision tags: llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2 |
|
| #
aba24c15 |
| 21-Jan-2021 |
Andrzej Warzynski <[email protected]> |
[flang][driver] Move fixed/free from detection out of FrontendAction API
All Fortran options should be set in `CompilerInstance` (via its `CompilerInvocation`) before any of `FrontendAction` is ente
[flang][driver] Move fixed/free from detection out of FrontendAction API
All Fortran options should be set in `CompilerInstance` (via its `CompilerInvocation`) before any of `FrontendAction` is entered - that's one of the tasks of the driver. However, this is a bit tricky with fixed and free from detection introduced in https://reviews.llvm.org/D94228.
Fixed-free form detection needs to happen: * before any frontend action (we need to specify `isFixedForm` in `Fortran::parser::Options` before running any actions) * separately for every input file (we might be compiling multiple Fortran files, some in free form, some in fixed form) In other words, we need this to happen early (before any `FrontendAction`), but not too early (we need to know what the current input file is). In practice, `isFixedForm` can only be set later than other options (other options are inferred from compiler flags). So we can't really set all of them in one place, which is not ideal.
All changes in this patch are NFCs (hence no new tests). Quick summary: * move fixed/free form detection from `FrontendAction::ExecuteAction` to `CompilerInstance::ExecuteAction` * add a bool flag in `FrontendInputFile` to mark a file as fixed/free form * updated a few comments
Differential Revision: https://reviews.llvm.org/D95042
show more ...
|
| #
cea3abc2 |
| 19-Jan-2021 |
Andrzej Warzynski <[email protected]> |
[flang][driver] Move isFixedFormSuffix and isFreeFormSuffix to flangFrontend
isFixedFormSuffix and isFreeFormSuffix should be defined in flangFrontend rather than flangFrontendTool library. That's f
[flang][driver] Move isFixedFormSuffix and isFreeFormSuffix to flangFrontend
isFixedFormSuffix and isFreeFormSuffix should be defined in flangFrontend rather than flangFrontendTool library. That's for 2 reasons: * these methods are used in flangFrontend rather than flangFrontendTool * flangFrontendTool depends on flangFrontend
As mentioned in the post-commit review for D94228, without this change shared library builds fail.
Differential Revision: https://reviews.llvm.org/D94968
show more ...
|
|
Revision tags: llvmorg-11.1.0-rc1 |
|
| #
443d6957 |
| 04-Jan-2021 |
Faris Rehman <[email protected]> |
[flang][driver] Add support for fixed form detection
Currently the new flang driver always runs in free form mode. This patch adds support for fixed form mode detection based on the file extensions.
[flang][driver] Add support for fixed form detection
Currently the new flang driver always runs in free form mode. This patch adds support for fixed form mode detection based on the file extensions.
Like `f18`, `flang-new` will treat files ending with ".f", ".F" and ".ff" as fixed form. Additionally, ".for", ".FOR", ".fpp" and ".FPP" file extensions are recognised as fixed form files. This is consistent with gfortran [1]. In summary, files with the following extensions are treated as fixed-form: * ".f", ".F", ".ff", ".for", ".FOR", ".fpp", ".FPP"
For consistency with flang/test/lit.cfg.py and f18, this patch also adds support for the following file extensions: * ".ff", ".FOR", ".for", ".ff90", ".fpp", ".FPP" This is added in flang/lib/Frontend/FrontendOptions.cpp. Additionally, the following extensions are included: * ".f03", ".F03", ".f08", ".F08" This is for compatibility with gfortran [1] and other popular Fortran compilers [2].
NOTE: internally Flang will only differentiate between fixed and free form files. Currently Flang does not support switching between language standards, so in this regard file extensions are irrelevant. More specifically, both `file.f03` and `file.f18` are represented with `Language::Fortran` (as opposed to e.g. `Language::Fortran03`).
Summary of changes: - Set Fortran::parser::Options::sFixedForm according to the file type - Add isFixedFormSuffix and isFreeFormSuffix helper functions to FrontendTool/Utils.h - Change FrontendOptions::GetInputKindForExtension to support the missing file extensions that f18 supports and some additional ones - FrontendActionTest.cpp is updated to make sure that the test input is treated as free-form
[1] https://gcc.gnu.org/onlinedocs/gfortran/GNU-Fortran-and-GCC.html [2] https://github.com/llvm/llvm-project/blob/master/flang/docs/OptionComparison.md#notes
Differential Revision: https://reviews.llvm.org/D94228
show more ...
|
| #
fa1e543e |
| 06-Jan-2021 |
Andrzej Warzynski <[email protected]> |
[flang][driver] Update error messages (nfc)
As per Flang's coding guidelines (flang/docs/C++style.md#error-messages): ``` Messages should start with a capital letter. ```
This patch updates error m
[flang][driver] Update error messages (nfc)
As per Flang's coding guidelines (flang/docs/C++style.md#error-messages): ``` Messages should start with a capital letter. ```
This patch updates error messages in the driver (new and old) so that they conform with the guideline above.
This change was suggested in one of the recent reviews: https://reviews.llvm.org/D93712. It felt like this deserved a dedicated patch, so sending it separately.
show more ...
|
| #
e49dc298 |
| 06-Jan-2021 |
Andrzej Warzynski <[email protected]> |
[flang][driver] Add checks for errors from `Prescan` and `Parse`
If either `Prescan` or `Parse` generate any fatal errors, the new driver will: * report it (i.e. issue an error diagnostic) * exi
[flang][driver] Add checks for errors from `Prescan` and `Parse`
If either `Prescan` or `Parse` generate any fatal errors, the new driver will: * report it (i.e. issue an error diagnostic) * exit early * return non-zero exit code This behaviour is consistent with f18 (i.e. the old driver).
Reviewed By: sameeranjoshi
Differential Revision: https://reviews.llvm.org/D93712
show more ...
|
|
Revision tags: llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1 |
|
| #
d28de0d7 |
| 27-Oct-2020 |
Caroline Concatto <[email protected]> |
[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 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 <[email protected]>
Differential Revision: https://reviews.llvm.org/D88381
show more ...
|
| #
9ffb5b04 |
| 28-Oct-2020 |
Andrzej Warzynski <[email protected]> |
[flang][driver] Rename the accessors/mutators (NFC)
As per point 3 in [1]:
``` Accessor member functions are named with the non-public data member's name, less the trailing underscore. Mutator mem
[flang][driver] Rename the accessors/mutators (NFC)
As per point 3 in [1]:
``` Accessor member functions are named with the non-public data member's name, less the trailing underscore. Mutator member functions are named set_... ```
Originally we just followed the LLVM's style, which is incompatible with Flang. This patch renames the accessors and mutators accordingly.
`getDiagnostics` and `GetDiagnostics` are replaced with one accessor: `diagnostics`. `SetDiagnostics` was neither implemented nor used, so it's deleted.
[1] https://github.com/llvm/llvm-project/blob/master/flang/docs/C++style.md#naming
Differential Revision: https://reviews.llvm.org/D90300
show more ...
|
| #
4c5906cf |
| 24-Oct-2020 |
Caroline Concatto <[email protected]> |
[Flang][Driver] Add infrastructure for basic frontend actions and file I/O
This patch introduces the dependencies required to read and manage input files provided by the command line option. It also
[Flang][Driver] Add infrastructure for basic frontend actions and file I/O
This patch introduces the dependencies required to read and manage input files provided by the command line option. It also adds the infrastructure to create and 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 adds infrastructure to create frontend actions. As a basic testable example, it adds the `InputOutputTest` FrontendAction. The sole purpose of this action is to read a file from the command line and print it either to stdout or the output file. This action is run by using the `-test-io` flag also introduced in this patch (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 to facilitate 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 frontend driver. 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
show more ...
|