mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
optional pointer to consumer replaces NullDiagnosticConsumer placeholder
This commit is contained in:
@@ -1527,6 +1527,19 @@ createDispatchingDiagnosticConsumerIfNeeded(
|
||||
subConsumers.emplace_back(input.file(), std::move(subConsumer));
|
||||
return false;
|
||||
});
|
||||
// For batch mode, the compiler must swallow diagnostics pertaining to
|
||||
// non-primary files in order to avoid Xcode showing the same diagnostic
|
||||
// multiple times. So, create a diagnostic "eater" for those non-primary
|
||||
// files.
|
||||
// To avoid introducing bugs into WMO or single-file modes, test for multiple
|
||||
// primaries.
|
||||
if (inputsAndOutputs.hasMultiplePrimaryInputs()) {
|
||||
inputsAndOutputs.forEachInputNotProducingSupplementaryOutput(
|
||||
[&](const InputFile &input) -> bool {
|
||||
subConsumers.emplace_back(input.file(), nullptr);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
if (subConsumers.empty())
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user