Skip to content

Commit

Permalink
Grab the diag count from the target.
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel-Naumann authored and sftnight committed Jan 12, 2017
1 parent d02d88a commit bfe5e72
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/Interpreter/IncrementalParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand All @@ -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,
Expand All @@ -153,6 +161,7 @@ namespace {
}
}
ForwardingDiagnosticConsumer::HandleDiagnostic(DiagLevel, Info);
SyncDiagCountWithTarget();
}

void push(bool ignoreDiags) { fIgnorePromptDiags.push(ignoreDiags); }
Expand Down

0 comments on commit bfe5e72

Please sign in to comment.