Currently Flang uses TextDiagnostic, TextDiagnosticPrinter &
TestDiagnosticBuffer from Clang (more specifically, from
libclangFrontend). This patch introduces simplified versions of these
classes in Flang (i.e. it removes the depdendency on libclangFrontend).
Note that currently, Flang needs these diagnostics classes only for the
compiler driver diagnostics. This is unlike in Clang in which similar
diagnostic classes are used for (among others) Lexing/Parsing/Sema
diagnostics. For this reason the implementations introduced here are
rather basic.
This patch also enhances how the diagnostics are printed. In particular,
this is what you'd get _before_ (no text formatting):
$ bin/flang-new error: no input files
This is what you get _after_ (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.
Is it possible to also add when using FC1Option?