@@ -3155,27 +3155,33 @@ void TupleShuffleArgEmitter::emitDefaultArgsAndFinalize(ArgEmitter &parent) {
3155
3155
parent.Args .append (extent.Args .begin (), extent.Args .end ());
3156
3156
for (auto &inoutArg : extent.InOutArgs )
3157
3157
parent.InOutArguments .push_back (std::move (inoutArg));
3158
+ continue ;
3159
+ }
3158
3160
3159
3161
// If this is default initialization, call the default argument
3160
3162
// generator.
3161
- } else if (innerIndex == TupleShuffleExpr::DefaultInitialize) {
3163
+ if (innerIndex == TupleShuffleExpr::DefaultInitialize) {
3162
3164
// Otherwise, emit the default initializer, then map that as a
3163
3165
// default argument.
3164
3166
CanType eltType = outerElements[outerIndex].getType ()->getCanonicalType ();
3165
3167
auto origType = origParamType.getTupleElementType (outerIndex);
3166
3168
RValue value = parent.SGF .emitApplyOfDefaultArgGenerator (
3167
3169
outer, defaultArgsOwner, outerIndex, eltType, origType);
3168
3170
parent.emit (ArgumentSource (outer, std::move (value)), origType);
3171
+ continue ;
3172
+ }
3169
3173
3170
- // If this is caller default initialization, generate the
3171
- // appropriate value.
3172
- } else if (innerIndex == TupleShuffleExpr::CallerDefaultInitialize) {
3174
+ // If this is caller default initialization, generate the
3175
+ // appropriate value.
3176
+ if (innerIndex == TupleShuffleExpr::CallerDefaultInitialize) {
3173
3177
auto arg = callerDefaultArgs[nextCallerDefaultArg++];
3174
3178
parent.emit (ArgumentSource (arg),
3175
3179
origParamType.getTupleElementType (outerIndex));
3180
+ continue ;
3181
+ }
3176
3182
3177
- // If we're supposed to create a varargs array with the rest, do so.
3178
- } else if (innerIndex == TupleShuffleExpr::Variadic) {
3183
+ // If we're supposed to create a varargs array with the rest, do so.
3184
+ if (innerIndex == TupleShuffleExpr::Variadic) {
3179
3185
auto &varargsField = outerElements[outerIndex];
3180
3186
assert (varargsField.isVararg () &&
3181
3187
" Cannot initialize nonvariadic element" );
@@ -3197,11 +3203,11 @@ void TupleShuffleArgEmitter::emitDefaultArgsAndFinalize(ArgEmitter &parent) {
3197
3203
parent.emit (
3198
3204
ArgumentSource (outer, RValue (parent.SGF , outer, eltType, varargs)),
3199
3205
origParamType.getTupleElementType (outerIndex));
3200
-
3201
- // That's the last special case defined so far.
3202
- } else {
3203
- llvm_unreachable (" unexpected special case in tuple shuffle!" );
3206
+ continue ;
3204
3207
}
3208
+
3209
+ // That's the last special case defined so far.
3210
+ llvm_unreachable (" unexpected special case in tuple shuffle!" );
3205
3211
}
3206
3212
}
3207
3213
0 commit comments