llvm-project/flang/lib
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
..
Common [flang] Use the Flang cmake-functions to add targets. 2020-04-16 15:51:30 +01:00
Decimal [flang] Readability improvement in binary->decimal conversion 2020-10-01 15:49:27 -07:00
Evaluate [flang][msvc] Rework a MSVC work-around to avoid clang warning 2020-10-01 16:52:30 -07:00
Frontend [flang] Introduce DiagnosticConsumer classes in libflangFrontend 2020-10-05 17:46:44 +01:00
FrontendTool [flang][driver] Add missing dependency in CMake files 2020-09-24 09:32:16 +01:00
Lower [flang][NFC] Fix build errors for clang-10 2020-10-03 15:10:17 +01:00
Optimizer Make namespace handling uniform across dialect backends. 2020-09-14 20:33:31 +00:00
Parser [flang][openacc] Fix unparsing of combined construct (bug 47659) 2020-10-01 10:35:06 -04:00
Semantics [flang] Semantic analysis for FINAL subroutines 2020-09-30 15:46:15 -07:00
CMakeLists.txt [flang][driver] Add the new flang compiler and frontend drivers 2020-09-11 10:55:54 +01:00