Skip to content

Commit c8c7c1f

Browse files
committed
Fix more merge damage
1 parent 14ba7c0 commit c8c7c1f

File tree

4 files changed

+9
-20
lines changed

4 files changed

+9
-20
lines changed

lib/AST/Attr.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -539,13 +539,15 @@ static void printDifferentiableAttrArguments(
539539
ArrayRef<Requirement> derivativeRequirements;
540540
if (auto derivativeGenSig = attr->getDerivativeGenericSignature())
541541
derivativeRequirements = derivativeGenSig->getRequirements();
542-
auto requirementsToPrint =
543-
makeFilterRange(derivativeRequirements, [&](Requirement req) {
544-
if (auto originalGenSig = original->getGenericSignature())
545-
if (originalGenSig->isRequirementSatisfied(req))
546-
return false;
547-
return true;
548-
});
542+
llvm::SmallVector<Requirement, 8> requirementsToPrint;
543+
std::copy_if(derivativeRequirements.begin(), derivativeRequirements.end(),
544+
std::back_inserter(requirementsToPrint),
545+
[&](Requirement req) {
546+
if (auto originalGenSig = original->getGenericSignature())
547+
if (originalGenSig->isRequirementSatisfied(req))
548+
return false;
549+
return true;
550+
});
549551
if (!requirementsToPrint.empty()) {
550552
if (!isLeadingClause)
551553
stream << ' ';

lib/SILOptimizer/Mandatory/Differentiation.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include "swift/SILOptimizer/Analysis/LoopAnalysis.h"
4646
#include "swift/SILOptimizer/PassManager/Passes.h"
4747
#include "swift/SILOptimizer/PassManager/Transforms.h"
48-
#include "swift/SILOptimizer/Utils/Local.h"
4948
#include "swift/SILOptimizer/Utils/LoopUtils.h"
5049
#include "swift/SILOptimizer/Utils/SILOptFunctionBuilder.h"
5150
#include "llvm/ADT/APSInt.h"

lib/SILOptimizer/Mandatory/Differentiation.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#include "swift/SIL/TypeSubstCloner.h"
2828
#include "swift/SILOptimizer/Analysis/DominanceAnalysis.h"
29-
#include "swift/SILOptimizer/Utils/Local.h"
3029

3130
namespace swift {
3231

lib/SILOptimizer/Transforms/SILMem2Reg.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -973,17 +973,6 @@ void MemoryToRegisters::promoteAllocs(ArrayRef<AllocStackInst*> allocs) {
973973
}
974974
}
975975

976-
/// Attempt to promote the specified array of stack allocations to SSA
977-
/// registers. Promotion can fail if the allocation escapes.
978-
void swift::promoteAllocsToSSA(ArrayRef<AllocStackInst*> allocs,
979-
DominanceInfo *domInfo) {
980-
if (allocs.empty()) return;
981-
982-
auto *fn = allocs.front()->getFunction();
983-
assert(fn && "Shouldn't have alloc stacks in global var initializers");
984-
MemoryToRegisters(*fn, domInfo).promoteAllocs(allocs);
985-
}
986-
987976

988977
namespace {
989978
class SILMem2Reg : public SILFunctionTransform {

0 commit comments

Comments
 (0)