Skip to content

Commit dd027c6

Browse files
authored
Merge pull request #8693 from gottesmm/small_gardening
2 parents 83b4c05 + 2e40219 commit dd027c6

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

lib/SILGen/SILGenApply.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3155,27 +3155,33 @@ void TupleShuffleArgEmitter::emitDefaultArgsAndFinalize(ArgEmitter &parent) {
31553155
parent.Args.append(extent.Args.begin(), extent.Args.end());
31563156
for (auto &inoutArg : extent.InOutArgs)
31573157
parent.InOutArguments.push_back(std::move(inoutArg));
3158+
continue;
3159+
}
31583160

31593161
// If this is default initialization, call the default argument
31603162
// generator.
3161-
} else if (innerIndex == TupleShuffleExpr::DefaultInitialize) {
3163+
if (innerIndex == TupleShuffleExpr::DefaultInitialize) {
31623164
// Otherwise, emit the default initializer, then map that as a
31633165
// default argument.
31643166
CanType eltType = outerElements[outerIndex].getType()->getCanonicalType();
31653167
auto origType = origParamType.getTupleElementType(outerIndex);
31663168
RValue value = parent.SGF.emitApplyOfDefaultArgGenerator(
31673169
outer, defaultArgsOwner, outerIndex, eltType, origType);
31683170
parent.emit(ArgumentSource(outer, std::move(value)), origType);
3171+
continue;
3172+
}
31693173

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) {
31733177
auto arg = callerDefaultArgs[nextCallerDefaultArg++];
31743178
parent.emit(ArgumentSource(arg),
31753179
origParamType.getTupleElementType(outerIndex));
3180+
continue;
3181+
}
31763182

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) {
31793185
auto &varargsField = outerElements[outerIndex];
31803186
assert(varargsField.isVararg() &&
31813187
"Cannot initialize nonvariadic element");
@@ -3197,11 +3203,11 @@ void TupleShuffleArgEmitter::emitDefaultArgsAndFinalize(ArgEmitter &parent) {
31973203
parent.emit(
31983204
ArgumentSource(outer, RValue(parent.SGF, outer, eltType, varargs)),
31993205
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;
32043207
}
3208+
3209+
// That's the last special case defined so far.
3210+
llvm_unreachable("unexpected special case in tuple shuffle!");
32053211
}
32063212
}
32073213

0 commit comments

Comments
 (0)