Add removeConsumer to DiagnosticEngine

This commit is contained in:
David Goldman
2019-01-08 17:28:54 -05:00
parent 4651e14f09
commit c2d0b4df6f
2 changed files with 7 additions and 5 deletions

View File

@@ -449,11 +449,7 @@ bool SwiftASTManager::initCompilerInvocation(CompilerInvocation &Invocation,
});
// Remove the StreamDiagConsumer as it's no longer needed.
std::vector<DiagnosticConsumer *> OldC = Diags.takeConsumers();
OldC.erase(std::remove(OldC.begin(), OldC.end(), &DiagConsumer));
for (DiagnosticConsumer *Consumer : OldC) {
Diags.addConsumer(*Consumer);
}
Diags.removeConsumer(DiagConsumer);
if (HadError) {
Error = ErrOS.str();