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