mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +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:
@@ -46,7 +46,9 @@ public:
|
||||
StreamDiagConsumer(llvm::raw_ostream &OS) : OS(OS) {}
|
||||
|
||||
void handleDiagnostic(SourceManager &SM, SourceLoc Loc,
|
||||
DiagnosticKind Kind, StringRef Text,
|
||||
DiagnosticKind Kind,
|
||||
StringRef FormatString,
|
||||
ArrayRef<DiagnosticArgument> FormatArgs,
|
||||
const DiagnosticInfo &Info) override {
|
||||
// FIXME: Print location info if available.
|
||||
switch (Kind) {
|
||||
@@ -54,7 +56,7 @@ public:
|
||||
case DiagnosticKind::Warning: OS << "warning: "; break;
|
||||
case DiagnosticKind::Note: OS << "note: "; break;
|
||||
}
|
||||
OS << Text;
|
||||
DiagnosticEngine::formatDiagnosticText(OS, FormatString, FormatArgs);
|
||||
}
|
||||
};
|
||||
} // end anonymous namespace
|
||||
|
||||
Reference in New Issue
Block a user