[Diagnostics] Use the new swift-syntax formatter for -diagnostic-style swift.

We're going to move toward the new swift-syntax formatter. Use it for
the "swift" diagnostic style instead of the experimental formatter
written in C++.

There are some tests for the experimental formatter in C++ that test
precise formatting of diagnostics. I've disabled them in the same
places where the new swift-syntax formatter is enabled, for now. We
may choose to remove them entirely, because swift-syntax itself is
where the specific format is defined, and has those same kinds of
tests already.
This commit is contained in:
Doug Gregor
2023-03-02 14:11:53 -08:00
parent eb06129463
commit 53989ad72c
7 changed files with 34 additions and 47 deletions

View File

@@ -1517,9 +1517,6 @@ static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,
Opts.PrintedFormattingStyle = DiagnosticOptions::FormattingStyle::LLVM;
} else if (contents == "swift") {
Opts.PrintedFormattingStyle = DiagnosticOptions::FormattingStyle::Swift;
} else if (contents == "swift-syntax") {
Opts.PrintedFormattingStyle =
DiagnosticOptions::FormattingStyle::SwiftSyntax;
} else {
Diags.diagnose(SourceLoc(), diag::error_unsupported_option_argument,
arg->getOption().getPrefixedName(), arg->getValue());