mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add removeConsumer to DiagnosticEngine
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user