@@ -190,7 +190,7 @@ void FileSpecificDiagnosticConsumer::handleDiagnostic(
190
190
}
191
191
192
192
bool FileSpecificDiagnosticConsumer::finishProcessing (SourceManager &SM) {
193
- addNonSpecificErrors (SM );
193
+ tellSubconsumersToInformDriverOfIncompleteBatchModeCompilation ( );
194
194
195
195
// Deliberately don't use std::any_of here because we don't want early-exit
196
196
// behavior.
@@ -201,29 +201,13 @@ bool FileSpecificDiagnosticConsumer::finishProcessing(SourceManager &SM) {
201
201
return hadError;
202
202
}
203
203
204
- static void produceNonSpecificError (
205
- FileSpecificDiagnosticConsumer::ConsumerSpecificInformation &consumerInfo,
206
- SourceManager &SM) {
207
- Diagnostic diagnostic (
208
- diag::error_compilation_stopped_by_errors_in_other_files);
209
-
210
- // Stolen from DiagnosticEngine::emitDiagnostic
211
- DiagnosticInfo Info;
212
- Info.ID = diagnostic.getID ();
213
-
214
- consumerInfo.consumer ->handleDiagnostic (
215
- SM, consumerInfo.range .getStart (), DiagnosticKind::Error,
216
- DiagnosticEngine::diagnosticStringFor (diagnostic.getID ()), {}, Info);
217
- }
218
-
219
- void FileSpecificDiagnosticConsumer::addNonSpecificErrors (SourceManager &SM) {
204
+ void FileSpecificDiagnosticConsumer::
205
+ tellSubconsumersToInformDriverOfIncompleteBatchModeCompilation () const {
220
206
if (!HasAnErrorBeenConsumed)
221
207
return ;
222
208
for (auto &info : ConsumersOrderedByRange) {
223
- if (!info.hasAnErrorBeenEmitted && info.consumer ) {
224
- produceNonSpecificError (info, SM);
225
- info.hasAnErrorBeenEmitted = true ;
226
- }
209
+ if (!info.hasAnErrorBeenEmitted && info.consumer )
210
+ info.consumer ->informDriverOfIncompleteBatchModeCompilation ();
227
211
}
228
212
}
229
213
0 commit comments