Changed handleDiagnostic to take a format string and format args instead of the formatted string

This allows diagnostic consumers to modify the way formatting of diagnostics is performed.
rdar://problem/31305854
This commit is contained in:
Maxwell Swadling
2017-04-14 11:28:04 -07:00
parent 62d077d2d3
commit 93d485e4f7
18 changed files with 160 additions and 78 deletions

View File

@@ -224,7 +224,9 @@ public:
}
private:
void handleDiagnostic(SourceManager &SM, SourceLoc Loc,
DiagnosticKind Kind, StringRef Text,
DiagnosticKind Kind,
StringRef FormatString,
ArrayRef<DiagnosticArgument> FormatArgs,
const DiagnosticInfo &Info) override {
if (!shouldFix(Kind, Info))
return;
@@ -921,10 +923,10 @@ int swift::performFrontend(ArrayRef<const char *> Args,
PDC.handleDiagnostic(dummyMgr, SourceLoc(), DiagnosticKind::Error,
"fatal error encountered during compilation; please "
"file a bug report with your project and the crash "
"log",
"log", {},
DiagnosticInfo());
PDC.handleDiagnostic(dummyMgr, SourceLoc(), DiagnosticKind::Note, reason,
DiagnosticInfo());
{}, DiagnosticInfo());
if (shouldCrash)
abort();
};