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:
@@ -41,14 +41,11 @@ private:
|
||||
CompilerInvocation CompInv;
|
||||
std::unique_ptr<ParserUnit> Parser;
|
||||
class FormatterDiagConsumer : public swift::DiagnosticConsumer {
|
||||
void handleDiagnostic(
|
||||
SourceManager &SM, SourceLoc Loc, DiagnosticKind Kind,
|
||||
StringRef FormatString, ArrayRef<DiagnosticArgument> FormatArgs,
|
||||
const swift::DiagnosticInfo &Info,
|
||||
const SourceLoc bufferIndirectlyCausingDiagnostic) override {
|
||||
void handleDiagnostic(SourceManager &SM,
|
||||
const swift::DiagnosticInfo &Info) override {
|
||||
llvm::errs() << "Parse error: ";
|
||||
DiagnosticEngine::formatDiagnosticText(llvm::errs(), FormatString,
|
||||
FormatArgs);
|
||||
DiagnosticEngine::formatDiagnosticText(llvm::errs(), Info.FormatString,
|
||||
Info.FormatArgs);
|
||||
llvm::errs() << "\n";
|
||||
}
|
||||
} DiagConsumer;
|
||||
|
||||
Reference in New Issue
Block a user