llvm-project/flang/tools
Andrzej Warzynski 8d51d37e06 [flang] Introduce DiagnosticConsumer classes in libflangFrontend
Currently Flang uses TextDiagnostic, TextDiagnosticPrinter &
TestDiagnosticBuffer classes from Clang (more specifically, from
libclangFrontend). This patch introduces simplified equivalents of these
classes in Flang (i.e. it removes the dependency on libclangFrontend).

Flang only needs these diagnostics classes for the compiler driver
diagnostics. This is unlike in Clang in which similar diagnostic classes
are used for e.g. Lexing/Parsing/Sema diagnostics. For this reason, the
implementations introduced here are relatively basic. We can extend them
in the future if this is required.

This patch also enhances how the diagnostics are printed. In particular,
this is the diagnostic that you'd get _before_  the changes introduced here
(no text formatting):

```
$ bin/flang-new
error: no input files
```

This is the diagnostic that you get _after_ the changes introduced here
(in terminals that support it, the text is formatted - bold + red):

```
$ bin/flang-new
flang-new: error: no input files
```

Tests are updated accordingly and options related to enabling/disabling
color diagnostics are flagged as supported by Flang.

Reviewed By: sameeranjoshi, CarolineConcatto

Differential Revision: https://reviews.llvm.org/D87774
2020-10-05 17:46:44 +01:00
..
bbc [flang] Add clang-format files for FIR source (LLVM style) 2020-02-17 02:37:49 -08:00
f18 [Flang] Fixed installation permission of the "binary" flang 2020-09-16 18:54:24 -04:00
f18-parse-demo [flang] Support multiple CookedSource instances 2020-09-02 10:34:23 -07:00
flang-driver [flang] Introduce DiagnosticConsumer classes in libflangFrontend 2020-10-05 17:46:44 +01:00
tco Update FIR registration to not rely on the global MLIR dialect registry (NFC) 2020-08-23 21:24:54 +00:00
CMakeLists.txt [flang][driver] Add the new flang compiler and frontend drivers 2020-09-11 10:55:54 +01:00