Skip to content

Commit 0a25d78

Browse files
committed
SILGen: Remove code that became dead from Swift 3 removal
Swift 3 mode has not been fully removed, but the constraint solver support for the old function argument tuple behavior is gone, so rip out some SILGen hacks for it too.
1 parent 677f500 commit 0a25d78

File tree

1 file changed

+1
-26
lines changed

1 file changed

+1
-26
lines changed

lib/SILGen/SILGenExpr.cpp

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,14 +2566,7 @@ RValue RValueEmitter::visitTupleShuffleExpr(TupleShuffleExpr *E,
25662566
// If we're emitting into an initialization, we can try shuffling the
25672567
// elements of the initialization.
25682568
if (Initialization *I = C.getEmitInto()) {
2569-
// In Swift 3 mode, we might be stripping off labels from a
2570-
// one-element tuple; the destination type is a ParenType in
2571-
// that case.
2572-
//
2573-
// FIXME: Remove this eventually.
2574-
if (I->canSplitIntoTupleElements() &&
2575-
!(E->getType()->hasParenSugar() &&
2576-
SGF.getASTContext().isSwiftVersion3())) {
2569+
if (I->canSplitIntoTupleElements()) {
25772570
emitTupleShuffleExprInto(*this, E, I);
25782571
return RValue::forInContext();
25792572
}
@@ -2590,24 +2583,6 @@ RValue RValueEmitter::visitTupleShuffleExpr(TupleShuffleExpr *E,
25902583
// Prepare a new tuple to hold the shuffled result.
25912584
RValue result(E->getType()->getCanonicalType());
25922585

2593-
// In Swift 3 mode, we might be stripping off labels from a
2594-
// one-element tuple; the destination type is a ParenType in
2595-
// that case.
2596-
//
2597-
// FIXME: Remove this eventually.
2598-
if (E->getType()->hasParenSugar() &&
2599-
SGF.getASTContext().isSwiftVersion3()) {
2600-
assert(E->getElementMapping().size() == 1);
2601-
auto shuffleIndex = E->getElementMapping()[0];
2602-
assert(shuffleIndex != TupleShuffleExpr::DefaultInitialize &&
2603-
shuffleIndex != TupleShuffleExpr::CallerDefaultInitialize &&
2604-
shuffleIndex != TupleShuffleExpr::Variadic &&
2605-
"Only argument tuples can have default initializers & varargs");
2606-
2607-
result.addElement(std::move(elements[shuffleIndex]).ensurePlusOne(SGF, E));
2608-
return result;
2609-
}
2610-
26112586
auto outerFields = E->getType()->castTo<TupleType>()->getElements();
26122587
auto shuffleIndexIterator = E->getElementMapping().begin();
26132588
auto shuffleIndexEnd = E->getElementMapping().end();

0 commit comments

Comments
 (0)