@@ -2566,14 +2566,7 @@ RValue RValueEmitter::visitTupleShuffleExpr(TupleShuffleExpr *E,
2566
2566
// If we're emitting into an initialization, we can try shuffling the
2567
2567
// elements of the initialization.
2568
2568
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 ()) {
2577
2570
emitTupleShuffleExprInto (*this , E, I);
2578
2571
return RValue::forInContext ();
2579
2572
}
@@ -2590,24 +2583,6 @@ RValue RValueEmitter::visitTupleShuffleExpr(TupleShuffleExpr *E,
2590
2583
// Prepare a new tuple to hold the shuffled result.
2591
2584
RValue result (E->getType ()->getCanonicalType ());
2592
2585
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
-
2611
2586
auto outerFields = E->getType ()->castTo <TupleType>()->getElements ();
2612
2587
auto shuffleIndexIterator = E->getElementMapping ().begin ();
2613
2588
auto shuffleIndexEnd = E->getElementMapping ().end ();
0 commit comments