| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[flang] Simplify LIBTYPE logic (#98072) When the add_flang_library was first added, it was apparently copied over from add_clang_library, including its logic to determine the library type. It includes a workaround: If BUILD_SHARED_LIBS is enabled, it should build all libraries as shared, including those that are explicitly marked as STATIC[^1], because add_clang_library always passes at least one of STATIC/SHARED to llvm_add_library, and llvm_add_library could not distinguish the two cases. Then, the two implementations diverged. For its runtime libraries, Flang requires some libraries to always be static libraries, so if a library is explicitly marked as STATIC, BUILD_SHARED_LIBS is ignored[^2]. I noticed the two implementations of the same functionality, modified only the add_clang_library, and copied over the result to add_flang_library[^3], without noticing that they are slightly different. As a result, Flang runtime libraries would be built as shared libraries with -DBUILD_SHARED_LIBS=ON, which may break some build configurations[^4]. This PR fixes the problem and at the same time simplifies the library type algorithm by just passing SHARED/STATIC verbatim to llvm_add_library. This is effectively what [^2] should have done instead adding more code to undo the workaround of [^1]. Ideally, one would use llvm_add_library(${name} ${ARG_STATIC} ${ARG_SHARED} [...]) but ARG_STATIC/ARG_SHARED as set by cmake_parse_arguments contain TRUE/FALSE instead of the keywords themselves. I could imagine a utility function akin to pythonize_bool that does this. This simplification adds two more changes: 1. Object libraries are not explicitly requested anymore. llvm_add_library itself should determine whether an object library is necessary. As the comment notes, using an object library is not without problems and seem of no use here since it works fine without object library when in XCODE/MSVC_IDE mode. 2. The property CLANG_STATIC_LIBS was removed. It was FLANG_STATIC_LIBS before to copy&paste error of #93519 [^3] which not used anywhere. In clang, CLANG_STATIC_LIBS is used for clang-shlib to include all component libraries in a single large library. There is no equivalent flang-shlib. [^1]: dbc2a12c7311ff4cc2cd7887d128b506bd35b579 [^2]: 3d2e05d542e646891745c5278a09950d3c4fb4a5 [^3]: #93519 [^4]: https://github.com/llvm/llvm-project/pull/93519#issuecomment-2192359002 | 2 年前 | |
[Flang][Docs] Update information about AArch64 trampolines (#100391) Commits c4b66bf and 7647174 add support for AArch64 trampolines. Updated documentation to reflect the changes. (cherry picked from commit c6e69b041a7e6d18463f6cf684b10fd46a62c496) | 1 年前 | |
[llvm-project] Fix typo "seperate" (#95373) | 2 年前 | |
| 1 年前 | ||
[flang][debug] Set scope of internal functions correctly. (#99531) Summary: The functions internal to subroutine should have the scope set to the parent function. This allows a user to evaluate local variables of parent function when control is stopped in the child. Fixes #96314 Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250527 (cherry picked from commit 626022bfd18f335ef62a461992a05dfed4e6d715) | 1 年前 | |
[flang][runtime] Build ISO_FORTRAN_ENV to export kind arrays as linkable symbols (#95388) Moves definitions of the kind arrays into a Fortran MODULE to not only emit the MOD file, but also compile that MODULE file into an object file. This file is then linked into libFortranRuntime.so. Eventually this workaround PR shoud be redone and a proper runtime build should be setup that will then also compile Fortran MODULE files. Fixes #89403 --------- Co-authored-by: Valentin Clement (バレンタイン クレメン) <clementval@gmail.com> Co-authored-by: Michael Kruse <github@meinersbur.de> | 2 年前 | |
[Flang][runtime] Add dependency to build FortranRuntime after flang-new (#99737) Makefile-based builds did not have proper dependencies to built the FortranRuntime target after Flang new is available. This PR introduces a dependency to ensure that this is the case. Relates to PR #95388. --------- Co-authored-by: Michael Kruse <github@meinersbur.de> | 2 年前 | |
[flang][debug] Set scope of internal functions correctly. (#99531) Summary: The functions internal to subroutine should have the scope set to the parent function. This allows a user to evaluate local variables of parent function when control is stopped in the child. Fixes #96314 Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250527 (cherry picked from commit 626022bfd18f335ef62a461992a05dfed4e6d715) | 1 年前 | |
[flang][runtime] Build ISO_FORTRAN_ENV to export kind arrays as linkable symbols (#95388) Moves definitions of the kind arrays into a Fortran MODULE to not only emit the MOD file, but also compile that MODULE file into an object file. This file is then linked into libFortranRuntime.so. Eventually this workaround PR shoud be redone and a proper runtime build should be setup that will then also compile Fortran MODULE files. Fixes #89403 --------- Co-authored-by: Valentin Clement (バレンタイン クレメン) <clementval@gmail.com> Co-authored-by: Michael Kruse <github@meinersbur.de> | 2 年前 | |
| 2 年前 | ||
[flang] Remove non-alignment based divergences from LLVM formatting. This only changs the clang-format file and adds documentation referring to the new process for formatting code. A future commit will perform a reformatting according to these new formatting settings. Original-commit: flang-compiler/f18@02531d788e7550a2455633f87d22e3f30de7a3a7 Reviewed-on: https://github.com/flang-compiler/f18/pull/945 | 6 年前 | |
[flang] Add clang-tidy check for braces around if Flang diverges from the llvm coding style in that it requires braces around the bodies of if/while/etc statements, even when the body is a single statement. This commit adds the readability-braces-around-statements check to flang's clang-tidy config file. Hopefully the premerge bots will pick it up and report violations in Phabricator. We also explicitly disable the check in the directories corresponding to the Lower and Optimizer libraries, which rely heavily on mlir and llvm and therefore follow their coding style. Likewise for the tools directory. We also fix any outstanding violations in the runtime and in lib/Semantics. Differential Revision: https://reviews.llvm.org/D104100 | 5 年前 | |
[flang] [mlir rebase] Add MLIR config and react to MLIR name changes (flang-compiler/f18#1090) [mlir rebase] Add MLIR config and react to MLIR name changes Similar to flang-compiler/f18#1085. Now use the MLIR package to set up paths for include files and libraries. Three MLIR names changed: * VectorOpsDialect to VectorDialect * AffineOpsDialect to AffineDialect * createVectorizePass to createSuperVectorizePass Update README.md to explain how to link with MLIR. Update the example gcc to version 8.3. Update drone.io config to define -DMLIR_DIR Co-authored-by: Jean Perier <jperier@nvidia.com> Original-commit: flang-compiler/f18@116f64315f6218a7f74a8ccdc25f94d322ac6344 Reviewed-on: https://github.com/flang-compiler/f18/pull/1090 | 6 年前 | |
[flang] Add --gcc-toolchain and --gcc-install-dir options to flang. (#87360) The --gcc-toolchain and --gcc-install-dir option were previously only visible to the Clang driver, but not Flang. These determine which assembler, linker, and libraries to use, e.g. for cross-compiling, and therefore are relevant for Flang as well. Tests are implemented using a mock GCC installation in basic_cross_linux_tree copied over from Clang's tests. The Clang driver already contains tests with --driver-mode=flang but flang-new is an entirely different executable (containing the -fc1 stage) that should be tested as well. While not all files in basic_cross_linux_tree are strictly needed for testing those two driver flags, they will be necessarily needed for future added flags such as --rtlib. Also remove the entry *.o in flang's .gitignore since crt*.o files are needed in the GCC mock installation. Fixes #86729 | 2 年前 | |
[flang][runtime] Build ISO_FORTRAN_ENV to export kind arrays as linkable symbols (#95388) Moves definitions of the kind arrays into a Fortran MODULE to not only emit the MOD file, but also compile that MODULE file into an object file. This file is then linked into libFortranRuntime.so. Eventually this workaround PR shoud be redone and a proper runtime build should be setup that will then also compile Fortran MODULE files. Fixes #89403 --------- Co-authored-by: Valentin Clement (バレンタイン クレメン) <clementval@gmail.com> Co-authored-by: Michael Kruse <github@meinersbur.de> | 2 年前 | |
[Flang] Add code owner for the Driver Andrzej proposed the design and led the work for the Flang Driver over the past couple of years. He is continuing to function as the primary reviewer and gate-keeper of the Driver. Reviewed By: sscalpone Differential Revision: https://reviews.llvm.org/D147573 | 3 年前 | |
Rename top-level LICENSE.txt files to LICENSE.TXT This makes all the license filenames uniform across subprojects. Differential Revision: https://reviews.llvm.org/D98380 | 5 年前 | |
[Flang][Docs] Add a GettingStarted.md for build instructions This patch fix first point of https://github.com/llvm/llvm-project/issues/60730. https://flang.llvm.org/docs/ has no build instructions. This doc page is just a copy of README page so that it can be accessible from website. Differential Revision: https://reviews.llvm.org/D148070 | 3 年前 |
Flang
Flang is a ground-up implementation of a Fortran front end written in modern C++. It started off as the f18 project (https://github.com/flang-compiler/f18) with an aim to replace the previous flang project (https://github.com/flang-compiler/flang) and address its various deficiencies. F18 was subsequently accepted into the LLVM project and rechristened as Flang.
Please note that flang is not ready yet for production usage.
Getting Started
Read more about flang in the docs directory. Start with the compiler overview.
To better understand Fortran as a language and the specific grammar accepted by flang, read Fortran For C Programmers and flang's specifications of the Fortran grammar and the OpenMP grammar.
Treatment of language extensions is covered in this document.
To understand the compilers handling of intrinsics, see the discussion of intrinsics.
To understand how a flang program communicates with libraries at runtime, see the discussion of runtime descriptors.
If you're interested in contributing to the compiler, read the style guide and also review how flang uses modern C++ features.
If you are interested in writing new documentation, follow LLVM's Markdown style guide.
Consult the Getting Started with Flang for information on building and running flang.