mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Diagnostics] Refactor DiagnosticConsumer interface
DiagnosticInfo now holds all the information needed to consume a diagnostic, so remove unneeded parameters from handleDiagnostic.
This commit is contained in:
@@ -94,15 +94,10 @@ ModuleDifferDiagsConsumer::ModuleDifferDiagsConsumer(bool DiagnoseModuleDiff,
|
||||
}
|
||||
|
||||
void swift::ide::api::ModuleDifferDiagsConsumer::handleDiagnostic(
|
||||
SourceManager &SM, SourceLoc Loc, DiagnosticKind Kind,
|
||||
StringRef FormatString, ArrayRef<DiagnosticArgument> FormatArgs,
|
||||
const DiagnosticInfo &Info,
|
||||
const SourceLoc bufferIndirectlyCausingDiagnostic) {
|
||||
SourceManager &SM, const DiagnosticInfo &Info) {
|
||||
auto Category = getCategoryName((uint32_t)Info.ID);
|
||||
if (Category.empty()) {
|
||||
PrintingDiagnosticConsumer::handleDiagnostic(
|
||||
SM, Loc, Kind, FormatString, FormatArgs, Info,
|
||||
bufferIndirectlyCausingDiagnostic);
|
||||
PrintingDiagnosticConsumer::handleDiagnostic(SM, Info);
|
||||
return;
|
||||
}
|
||||
if (!DiagnoseModuleDiff)
|
||||
@@ -110,7 +105,8 @@ void swift::ide::api::ModuleDifferDiagsConsumer::handleDiagnostic(
|
||||
llvm::SmallString<256> Text;
|
||||
{
|
||||
llvm::raw_svector_ostream Out(Text);
|
||||
DiagnosticEngine::formatDiagnosticText(Out, FormatString, FormatArgs);
|
||||
DiagnosticEngine::formatDiagnosticText(Out, Info.FormatString,
|
||||
Info.FormatArgs);
|
||||
}
|
||||
AllDiags[Category].insert(Text.str().str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user