Grab the diag count from the target.

This commit is contained in:
Axel Naumann 2017-01-12 10:54:13 +01:00 committed by sftnight
parent d02d88ac18
commit bfe5e722e4

View File

@ -110,6 +110,11 @@ namespace {
std::stack<bool> fIgnorePromptDiags;
std::unique_ptr<DiagnosticConsumer> fOwnedTarget;
void SyncDiagCountWithTarget() {
NumWarnings = fOwnedTarget->getNumWarnings();
NumErrors = fOwnedTarget->getNumErrors();
}
public:
FilteringDiagConsumer(std::unique_ptr<DiagnosticConsumer>&& Target):
ForwardingDiagnosticConsumer(*Target.get()),
@ -122,14 +127,17 @@ namespace {
void EndSourceFile() override {
fOwnedTarget->EndSourceFile();
SyncDiagCountWithTarget();
}
void finish() override {
fOwnedTarget->finish();
SyncDiagCountWithTarget();
}
void clear() override {
fOwnedTarget->clear();
SyncDiagCountWithTarget();
}
void HandleDiagnostic(DiagnosticsEngine::Level DiagLevel,
@ -153,6 +161,7 @@ namespace {
}
}
ForwardingDiagnosticConsumer::HandleDiagnostic(DiagLevel, Info);
SyncDiagCountWithTarget();
}
void push(bool ignoreDiags) { fIgnorePromptDiags.push(ignoreDiags); }