llvm-project/flang/tools
Peixin Qiao 8df63a23d2 [flang] Support the color diagnostics on scanning, parsing, and semantics
The options -f{no-}color-diagnostics have been supported in driver. This
supports the behaviors in scanning, parsing, and semantics, and the
behaviors are exactly the same as the driver.

To illustrate the added behaviour, consider the following input file:
```! file.f90
program m
  integer :: i = k
end
```
In the following invocations, "error: Must be a constant value" _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
```
Note that "error: Semantic errors in file.f90" is also formatted, which
is supported in https://reviews.llvm.org/D126164.

Also note that only "error", "warning" and "portability" are formatted.
Check the following input file:
```! file2.f90
program m
  integer :: i =
end
```
```
$ flang-new test2.f90
error: Could not parse test2.f90
./test2.f90:2:11: error: expected '('
    integer :: i =
            ^
./test2.f90:2:3: in the context: statement function definition
    integer :: i =
    ^
...
```
The "error: Could not parse test2.f90" and "error: expected '('" are
formatted. Others such as "in the context" are not formatted yet, which
may or may not be supported.

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D126166
2022-07-27 23:45:41 +08:00
..
bbc [flang] Support the color diagnostics on scanning, parsing, and semantics 2022-07-27 23:45:41 +08:00
f18 [flang] Fix flang-to-external-fc --version 2022-07-19 14:10:46 +02:00
f18-parse-demo [flang] Support the color diagnostics on scanning, parsing, and semantics 2022-07-27 23:45:41 +08:00
fir-opt [mlir] (NFC) Clean up bazel and CMake target names 2022-06-13 16:24:15 +00:00
flang-driver [flang][driver] Support parsing response files 2022-05-18 08:25:45 +00:00
tco [flang] Run algebraic simplification optimization pass. 2022-07-21 11:43:39 -07:00
.clang-tidy [flang] Add clang-tidy check for braces around if 2021-06-16 09:13:53 +00:00
CMakeLists.txt [flang] Initial lowering for empty program 2022-01-28 22:39:58 +01:00