Skip to content

Commit aa2f2eb

Browse files
author
David Ungar
committed
Call forEachNonPrimaryInput directly instead of providing useless semantics for forEachInputNotProducingSupplementaryOutput.
1 parent bc51e05 commit aa2f2eb

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

include/swift/Frontend/FrontendInputsAndOutputs.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,6 @@ class FrontendInputsAndOutputs {
215215
bool forEachInputProducingSupplementaryOutput(
216216
llvm::function_ref<bool(const InputFile &)> fn) const;
217217

218-
/// If \p fn returns true, exit early and return true.
219-
bool forEachInputNotProducingSupplementaryOutput(
220-
llvm::function_ref<bool(const InputFile &)> fn) const;
221-
222218
/// Assumes there is not more than one primary input file, if any.
223219
/// Otherwise, you would need to call getPrimarySpecificPathsForPrimary
224220
/// to tell it which primary input you wanted the outputs for.

lib/Frontend/FrontendInputsAndOutputs.cpp

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -371,22 +371,6 @@ bool FrontendInputsAndOutputs::forEachInputProducingSupplementaryOutput(
371371
: hasInputs() ? fn(firstInput()) : false;
372372
}
373373

374-
bool FrontendInputsAndOutputs::forEachInputNotProducingSupplementaryOutput(
375-
llvm::function_ref<bool(const InputFile &)> fn) const {
376-
if (hasPrimaryInputs())
377-
return forEachNonPrimaryInput(fn);
378-
// If no primary inputs, compiler is in whole-module-optimization mode, and
379-
// only the first input can produce supplementary outputs, although all
380-
// inputs may contribute.
381-
bool isFirst = true;
382-
return forEachNonPrimaryInput([&](const InputFile &f) -> bool {
383-
if (!isFirst)
384-
return fn(f);
385-
isFirst = false;
386-
return false;
387-
});
388-
}
389-
390374
bool FrontendInputsAndOutputs::hasSupplementaryOutputPath(
391375
llvm::function_ref<const std::string &(const SupplementaryOutputPaths &)>
392376
extractorFn) const {

lib/FrontendTool/FrontendTool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ createDispatchingDiagnosticConsumerIfNeeded(
15381538
// To avoid introducing bugs into WMO or single-file modes, test for multiple
15391539
// primaries.
15401540
if (inputsAndOutputs.hasMultiplePrimaryInputs()) {
1541-
inputsAndOutputs.forEachInputNotProducingSupplementaryOutput(
1541+
inputsAndOutputs.forEachNonPrimaryInput(
15421542
[&](const InputFile &input) -> bool {
15431543
subConsumers.emplace_back(input.file(), nullptr);
15441544
return false;

0 commit comments

Comments
 (0)