aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/CMakeLists.txt
AgeCommit message (Collapse)AuthorFilesLines
2021-08-05[flang][driver] Delete `f18` (i.e. the old Flang driver)Andrzej Warzynski1-5/+2
This patch removes `f18`, a.k.a. the old driver. It is being replaced with the new driver, `flang-new`, which has reached feature parity with `f18` a while ago. This was discussed in [1] and also in [2]. With this change, `FLANG_BUILD_NEW_DRIVER` is no longer needed and is also deleted. This means that we are making the dependency on Clang permanent (i.e. it cannot be disabled with a CMake flag). LIT set-up is updated accordingly. All references to `f18` or `f18.cpp` are either updated or removed. The `F18_FC` variable from the `flang` bash script is replaced with `FLANG_FC`. The former is still supported for backwards compatibility. [1] https://lists.llvm.org/pipermail/flang-dev/2021-June/000742.html [2] https://reviews.llvm.org/D103177 Differential Revision: https://reviews.llvm.org/D105811
2021-02-11[flang] Remove `LINK_WITH_FIR` cmake switchSourabh Singh Tomar1-3/+1
Most components required for this are already there. Build and Testing clean. ninja check-flang Reviewed By: clementval, tskeith Differential Revision: https://reviews.llvm.org/D96411
2020-09-11[flang][driver] Add the new flang compiler and frontend driversCaroline Concatto1-0/+5
Summary: This is the first patch implementing the new Flang driver as outlined in [1], [2] & [3]. It creates Flang driver (`flang-new`) and Flang frontend driver (`flang-new -fc1`). These will be renamed as `flang` and `flang -fc1` once the current Flang throwaway driver, `flang`, can be replaced with `flang-new`. Currently only 2 options are supported: `-help` and `--version`. `flang-new` is implemented in terms of libclangDriver, defaulting the driver mode to `FlangMode` (added to libclangDriver in [4]). This ensures that the driver runs in Flang mode regardless of the name of the binary inferred from argv[0]. The design of the new Flang compiler and frontend drivers is inspired by it counterparts in Clang [3]. Currently, the new Flang compiler and frontend drivers re-use Clang libraries: clangBasic, clangDriver and clangFrontend. To identify Flang options, this patch adds FlangOption/FC1Option enums. Driver::printHelp is updated so that `flang-new` prints only Flang options. The new Flang driver is disabled by default. To enable it, set `-DBUILD_FLANG_NEW_DRIVER=ON` when configuring CMake and add clang to `LLVM_ENABLE_PROJECTS` (e.g. -DLLVM_ENABLE_PROJECTS=“clang;flang;mlir”). [1] “RFC: new Flang driver - next steps” http://lists.llvm.org/pipermail/flang-dev/2020-July/000470.html [2] “RFC: Adding a fortran mode to the clang driver for flang” http://lists.llvm.org/pipermail/cfe-dev/2019-June/062669.html [3] “RFC: refactoring libclangDriver/libclangFrontend to share with Flang” http://lists.llvm.org/pipermail/cfe-dev/2020-July/066393.html [4] https://reviews.llvm.org/rG6bf55804924d5a1d902925ad080b1a2b57c5c75c co-authored-by: Andrzej Warzynski <andrzej.warzynski@arm.com> Reviewed By: richard.barton.arm, sameeranjoshi Differential Revision: https://reviews.llvm.org/D86089
2020-03-26[flang] A rework of the cmake build components for in and out of tree builds.Patrick McCormick1-8/+0
In general all the basic functionality seems to work and removes some redundancy and more complicated features in favor of borrowing infrastructure from LLVM build configurations. Here's a quick summary of details and remaining issues: * Testing has spanned Ubuntu 18.04 & 19.10, CentOS 7, RHEL 8, and MacOS/darwin. Architectures include x86_64 and Arm. Without access to Window nothing has been tested there yet. * As we change file and directory naming schemes (i.e., capitalization) some odd things can occur on MacOS systems with case preserving but not case senstive file system configurations. Can be painful and certainly something to watch out for as any any such changes continue. * Testing infrastructure still needs to be tuned up and worked on. Note that there do appear to be cases of some tests hanging (on MacOS in particular). They appear unrelated to the build process. * Shared library configurations need testing (and probably fixing). * Tested both standalone and 'in-mono repo' builds. Changes for supporting the mono repo builds will require LLVM-level changes that are straightforward when the time comes. * The configuration contains a work-around for LLVM's C++ standard mode passing down into Flang/F18 builds (i.e., LLVM CMake configuration would force a -std=c++11 flag to show up in command line arguments. The current configuration removes that automatically and is more strict in following new CMake guidelines for enforcing C++17 mode across all the CMake files. * Cleaned up a lot of repetition in the command line arguments. It is likely that more work is still needed to both allow for customization and working around CMake defailts (or those inherited from LLVM's configuration files). On some platforms agressive optimization flags (e.g. -O3) can actually break builds due to the inlining of templates in .cpp source files that then no longer are available for use cases outside those source files (shows up as link errors). Sticking at -O2 appears to fix this. Currently this CMake configuration forces this in release mode but at the cost of stomping on any CMake, or user customized, settings for the release flags. * Made the lit tests non-source directory dependent where appropriate. This is done by configuring certain test shell files to refer to the correct paths whether an in or out of tree build is being performed. These configured files are output in the build directory. A %B substitution is introduced in lit to refer to the build directory, mirroring the %S substitution for the source directory, so that the tests can refer to the configured shell scripts. Co-authored-by: David Truby <david.truby@arm.com> Original-commit: flang-compiler/f18@d1c7184159b2d3c542a8f36c58a0c817e7506845 Reviewed-on: https://github.com/flang-compiler/f18/pull/1045
2020-03-11[flang] Add Fortran IR (FIR) MLIR dialect implementation ↵jeanPerier1-0/+4
(flang-compiler/f18#1035) Adds FIR library that implements an MLIR dialect to which Fortran parse-tree will be lowered to. FIR is defined and documented inside FIROps.td added in this commit. It is possible to generate a more readable description FIRLangRef.md from FIROps.td following the related instructions added to the README.md by this commit. This patch adds FIR definition and implementation that allow parsing, printing, and verifying FIR. FIR transformations and lowering to Standard and LLVM dialects are not part of this patch. The FIR verifiers are verifying the basic properties of FIR operations in order to provide a sufficient frame for lowering. Verifiers for more advanced FIR properties can be added as needed. Coarrays are not covered by FIR defined in this patch. This patch also adds tco tool that is meant to process FIR input files and drives transformations on it. The tco tool is used for testing. In this patch, it is only used to demonstrate parsing/verifying/ and dumping FIR with round-trip tests. Note: This commit does not reflect an actual work log, it is a feature-based split of the changes done in the FIR experimental branch. The related work log can be found in the commits between: https://github.com/schweitzpgi/f18/commit/742edde572bd74d77cf7d447132ccf0949187fce and https://github.com/schweitzpgi/f18/commit/2ff55242126d86061f4fed9ef7b59d3636b5fd0b Changes on top of these original commits were made during this patch review. Original-commit: flang-compiler/f18@30b428a51e140e5fb12bd53a0619f10ff510f408 Reviewed-on: https://github.com/flang-compiler/f18/pull/1035
2020-02-25[flang] [LLVMify F18] Compiler module folders should have capitalised names ↵CarolineConcatto1-6/+6
(flang-compiler/f18#980) This patch renames the modules in f18 to use a capital letter in the module name Signed-off-by: Caroline Concatto <caroline.concatto@arm.com> Original-commit: flang-compiler/f18@d2eb7a1c443d1539ef12b6f027074a0eb15b1ea0 Reviewed-on: https://github.com/flang-compiler/f18/pull/980
2020-02-17[flang] Add Pre-FIR Tree structure to help lowering the parse-treeJean Perier1-0/+1
The Pre-FIR Tree structure is a transient data structure that is meant to be built from the parse tree just before lowering to FIR and that will be deleted just afterwards. It is not meant to perfrom optimization analysis and transformations. It only provides temporary information, such as label target information or parse tree parent nodes, that is meant to be used to lower the parse tree structure into FIR operations. A PFTBuilder class builds the Pre-Fir Tree from the parse-tree. A pretty printer is available to visualize this data structure. - Lit tests are added to: 1. that the PFT tree structure is as expected 2. that the PFT captures all intented nodes - Cmake changes: Prevent warnings inisde LLVM headers when compiling flang The issue is that some LLVM headers define functions where the usage of the parameters depend on environment ifdef. See for instance Size in: https://github.com/llvm/llvm-project/blob/5f940220bf9438e95ffa4a627ac1591be1e1ba6e/llvm/include/llvm/Support/Compiler.h#L574 Because flang is build with -Werror and -Wunused-parameter is default in clang, this may breaks build in some environments (like with clang9 on macos). A solution would be to add -Wno-unused-parameter to flang CmakLists.txt, but it is wished to keep this warning on flang sources for quality purposes. Fixing LLVM headers is not an easy task and `[[maybe_unused]]` is C++17 and cannot be used yet in LLVM headers. Hence, this fix simply silence warnings coming from LLVM headers by telling CMake they are to be considered as if they were system headers. - drone.io changes: remove llvm 6.0 from clang config in drone.io and link flang with libstdc++ instead of libc++ llvm-dev resolved to llvm-6.0 in clang builds on drone.io. llvm 6.0 too old. LLVM packages are linked with libstdc++ standard library whereas libc++ was used for flang. This caused link time failure when building clang. Change frone.io to build flang with libc++. Note: This commit does not reflect an actual work log, it is a feature based split of the changes done in the FIR experimental branch. The related work log can be found in the commits between: 864898cbe509d032abfe1172ec367dbd3dd92bc1 and 137c23da9c64cf90584cf81fd646053a69e91f63 Other changes come from https://github.com/flang-compiler/f18/pull/959 review. Original-commit: flang-compiler/f18@edb0943bca4b81689f320bda341040bf255d6e2e Reviewed-on: https://github.com/flang-compiler/f18/pull/959
2020-01-10[flang] Minor format change to LLVM license linesGary Klimowicz1-1/+1
Replace comment lines containing all dashes with the proper ===-----....----=== markers. Original-commit: flang-compiler/f18@a8936b0d4187a9a9ef43f9d34055a3213beeb9d2 Reviewed-on: https://github.com/flang-compiler/f18/pull/922
2019-12-23[flang] Flang relicensing changes for LLVM Apache 2.0 licenseGary Klimowicz1-11/+5
This changes the license information in many of the flang source files. - Renamed LICENSE to LICENSE.txt. - NVIDIA Copyright lines have been removed. - Initial lines for files follow the LLVM coding convention (file name on the first line; Emacs mode information on the first line). - License references have been replaced with the abridged LLVM text. - License information was removed from the test files. - No file header was placed on test files (these weren't in most LLVM test files). - License information was added to documentation files where it was missing. We did not add brief file summaries to the initial line. See http://llvm.org/docs/DeveloperPolicy.html#new-llvm-project-license-framework for a description of the new license. See http://llvm.org/docs/CodingStandards.html#file-headers for a description of the new LLVM standard file header. Original-commit: flang-compiler/f18@add6cde7244b926ca457a1c74c21fea071b85329 Reviewed-on: https://github.com/flang-compiler/f18/pull/887
2019-12-11[flang] remove some old filesEric Schweitz1-1/+0
Original-commit: flang-compiler/f18@d7554c7605079c8a2f8d3d2d6d584241d3112ecd Reviewed-on: https://github.com/flang-compiler/f18/pull/868
2019-10-21[flang] Testing and debuggingpeter klausler1-1/+1
Original-commit: flang-compiler/f18@3fa2e55bef6858e1f6bf49b3cd96d424163156d3 Reviewed-on: https://github.com/flang-compiler/f18/pull/785 Tree-same-pre-rewrite: false
2019-10-02[flang] add initial Burnside bridge codeEric Schweitz1-0/+1
Original-commit: flang-compiler/f18@0d387d146849ecb218b554e3b072794c8d6216d6 Reviewed-on: https://github.com/flang-compiler/f18/pull/720
2019-08-23[flang] Testing & debuggingpeter klausler1-1/+1
Original-commit: flang-compiler/f18@f7f933e7f56375c8fe766bf2527472fefca73ad1 Reviewed-on: https://github.com/flang-compiler/f18/pull/671 Tree-same-pre-rewrite: false
2019-08-23[flang] Code snapshotpeter klausler1-0/+1
Original-commit: flang-compiler/f18@46923344ca8364685c09eb14935382d8989fa0ff Reviewed-on: https://github.com/flang-compiler/f18/pull/671 Tree-same-pre-rewrite: false
2019-06-07[flang] remove FIREric Schweitz1-1/+0
Original-commit: flang-compiler/f18@008ad16e289d5cb212396c3118095a0f5f87c6c9 Reviewed-on: https://github.com/flang-compiler/f18/pull/489
2019-06-07[flang] Remove the old FIR middle end from the f18 program and speed up ↵Eric Schweitz1-1/+0
build time. Original-commit: flang-compiler/f18@5b410b978c50cb367aa9f5e706afea4bd8e1d854 Reviewed-on: https://github.com/flang-compiler/f18/pull/489 Tree-same-pre-rewrite: false
2019-06-07[flang] start splitting up afforestation so it isn't monolithicEric Schweitz1-0/+1
Original-commit: flang-compiler/f18@842a42d95450f1ddd2d20720c246b635de7d618c Reviewed-on: https://github.com/flang-compiler/f18/pull/489 Tree-same-pre-rewrite: false
2019-04-24[flang] revert last pushesEric Schweitz1-1/+0
Original-commit: flang-compiler/f18@39335746a99c5291b82932f119bc2d25d251f022
2019-04-24[flang] Some initial bridge codeEric Schweitz1-0/+1
add QualifiedStmt class Original-commit: flang-compiler/f18@b2d89fe696f29cb60a8f0aa211b30eb4f7f442d5
2019-03-11[flang] Move over build recipes and rename the libraryEric Schweitz1-1/+1
Original-commit: flang-compiler/f18@51476aa1786de4b98b8189f256ba602298fd4903 Reviewed-on: https://github.com/flang-compiler/f18/pull/319 Tree-same-pre-rewrite: false
2019-03-11[flang] Fortran Intermediate Representation: initial draft based on "CFG" note.Eric Schweitz1-0/+1
Original-commit: flang-compiler/f18@b7a759539467268c250b239f2e62c854f41ae46e Reviewed-on: https://github.com/flang-compiler/f18/pull/319 Tree-same-pre-rewrite: false
2018-06-18[flang] Rearrange some facilities into a new lib/common.peter klausler1-1/+1
Original-commit: flang-compiler/f18@279af1e817b1266dd57689e462272f8e29496798 Reviewed-on: https://github.com/flang-compiler/f18/pull/106
2018-06-14[flang] begin workpeter klausler1-0/+1
Original-commit: flang-compiler/f18@82e434bf5966afa6e86a24a4de69d1ab537eb607 Reviewed-on: https://github.com/flang-compiler/f18/pull/101 Tree-same-pre-rewrite: false
2018-05-01[flang] Add copyright notices.Tim Keith1-0/+14
For source files (C++, Fortran, CMake) add copyright and license. For documentation files add just copyright. Original-commit: flang-compiler/f18@38381aed839ef091a44ea8f2ef7bc5346d776c67 Reviewed-on: https://github.com/flang-compiler/f18/pull/74
2018-03-26[flang] Merge with current master and move code to lib/semantics/Stephane Chauveau1-1/+1
Original-commit: flang-compiler/f18@8b31a01102072a855e1c53d642d8c51128e84477 Reviewed-on: https://github.com/flang-compiler/f18/pull/24 Tree-same-pre-rewrite: false
2018-03-26[flang] commit before rebaseStephane Chauveau1-1/+1
Original-commit: flang-compiler/f18@8366a87e476f664bd0d715506dbbe5b4e05d0c7b Reviewed-on: https://github.com/flang-compiler/f18/pull/24 Tree-same-pre-rewrite: false
2018-02-19[flang] Add simple recursive CMake directory structureStephane Chauveau1-0/+3
Original-commit: flang-compiler/f18@a021b2ca768c2b8c03d626739d0754ba99e463d2 Reviewed-on: https://github.com/flang-compiler/f18/pull/13 Tree-same-pre-rewrite: false
2018-02-14[flang] Revert "Schauveau cmake"Steve Scalpone1-2/+0
Original-commit: flang-compiler/f18@be33dc182a9bcfa664095886ca62b3b1db4eb797 Reviewed-on: https://github.com/flang-compiler/f18/pull/7
2018-02-09[flang] after clang-formatStephane Chauveau1-0/+1
Original-commit: flang-compiler/f18@7e464a7c3315b9dfc6db2861145d7e3455652548 Reviewed-on: https://github.com/flang-compiler/f18/pull/6 Tree-same-pre-rewrite: false
2018-02-09[flang] Add new global CMakefile infrastructure with examplesStephane Chauveau1-0/+1
Original-commit: flang-compiler/f18@81b91f327052cd0596e96af9c33b2d0e221d10f5 Reviewed-on: https://github.com/flang-compiler/f18/pull/6 Tree-same-pre-rewrite: false