mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user