@@ -1341,31 +1341,14 @@ static void emitCaptureArguments(SILGenFunction &SGF,
13411341 arg = SILValue (fArg );
13421342
13431343 if (isNoImplicitCopy && !arg->getType ().isMoveOnly ()) {
1344- // FIXME: this incompatible with -enable-sil-opaque-values
1345- switch (fnConv.getSILArgumentConvention (argIndex)) {
1346- case SILArgumentConvention::Indirect_Inout:
1347- case SILArgumentConvention::Indirect_InoutAliasable:
1348- case SILArgumentConvention::Indirect_In:
1349- case SILArgumentConvention::Indirect_In_Guaranteed:
1350- case SILArgumentConvention::Indirect_In_CXX:
1351- case SILArgumentConvention::Pack_Inout:
1352- case SILArgumentConvention::Pack_Owned:
1353- case SILArgumentConvention::Pack_Guaranteed:
1344+ if (fnConv.isSILIndirect (paramInfo)) {
13541345 arg = SGF.B .createCopyableToMoveOnlyWrapperAddr (VD, arg);
1355- break ;
1356-
1357- case SILArgumentConvention::Direct_Owned:
1358- arg = SGF.B .createOwnedCopyableToMoveOnlyWrapperValue (VD, arg);
1359- break ;
1360-
1361- case SILArgumentConvention::Direct_Guaranteed:
1346+
1347+ } else if (paramInfo.isGuaranteedInCallee ()) {
13621348 arg = SGF.B .createGuaranteedCopyableToMoveOnlyWrapperValue (VD, arg);
1363- break ;
1364-
1365- case SILArgumentConvention::Direct_Unowned:
1366- case SILArgumentConvention::Indirect_Out:
1367- case SILArgumentConvention::Pack_Out:
1368- llvm_unreachable (" should be impossible" );
1349+
1350+ } else {
1351+ arg = SGF.B .createOwnedCopyableToMoveOnlyWrapperValue (VD, arg);
13691352 }
13701353 }
13711354
0 commit comments