| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[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 | 4 年前 | |
[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 | 4 年前 | |
[flang][driver] Add support for -mmlir The semantics of -mmlir are identical to -mllvm. The only notable difference is that -mmlir options should be forwarded to MLIR rather than LLVM. Note that MLIR llvm::cl options are lazily constructed on demand (see the definition of options in PassManagerOptions.cpp). This means that: * MLIR global options are only visible when explicitly initialised and displayed only when using -mmlir --help, * Flang and LLVM global options are always visible and displayed when using either -mllvm -help or -mmlir --help. In other words, -mmlir --help is a superset of -mllvm --help. This is not ideal, but we'd need to refactor all option definitions in Flang and LLVM to improve this. I suggesting leaving this for later. Differential Revision: https://reviews.llvm.org/D123297 | 4 年前 | |
[flang][Driver] Refine _when_ driver diagnostics are formatted This patch refines //when// driver diagnostics are formatted so that flang-new and flang-new -fc1 behave consistently with clang and clang -cc1, respectively. This change only applies to driver diagnostics. Scanning, parsing and semantic diagnostics are separate and not covered here. **NEW BEHAVIOUR** To illustrate the new behaviour, consider the following input file: ! file.f90 program m integer :: i = k end In the following invocations, "error: Semantic errors in file.f90" _will be_ formatted: $ flang-new file.f90 error: Semantic errors in file.f90 ./file.f90:2:18: error: Must be a constant value integer :: i = k $ flang-new -fc1 -fcolor-diagnostics file.f90 error: Semantic errors in file.f90 ./file.f90:2:18: error: Must be a constant value integer :: i = k However, in the following invocations, "error: Semantic errors in file.f90" _will not be_ formatted: $ flang-new -fno-color-diagnostics file.f90 error: Semantic errors in file.f90 ./file.f90:2:18: error: Must be a constant value integer :: i = k $ flang-new -fc1 file.f90 error: Semantic errors in file.f90 ./file.f90:2:18: error: Must be a constant value integer :: i = k Before this change, none of the above would be formatted. Note also that the default behaviour in flang-new is different to flang-new -fc1 (this is consistent with Clang). **NOTES ON IMPLEMENTATION** Note that the diagnostic options are parsed in createAndPopulateDiagOpts in driver.cpp. That's where the driver's DiagnosticEngine options are set. Like most command-line compiler driver options, these flags are "claimed" in Flang.cpp (i.e. when creating a frontend driver invocation) by calling getLastArg rather than in driver.cpp. In Clang's Options.td, defm color_diagnostics is replaced with two separate definitions: def fcolor_diagnostics and def fno_color_diagnostics. That's because originally color_diagnostics derived from OptInCC1FFlag, which is a multiclass for opt-in options in CC1. In order to preserve the current behaviour in clang -cc1 (i.e. to keep -fno-color-diagnostics unavailable in clang -cc1) and to implement similar behaviour in flang-new -fc1, we can't re-use OptInCC1FFlag`. Formatting is only available in consoles that support it and will normally mean that the message is printed in bold + color. Co-authored-by: Andrzej Warzynski <andrzej.warzynski@arm.com> Reviewed By: rovka Differential Revision: https://reviews.llvm.org/D126164 | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 3 年前 |