@@ -272,14 +272,14 @@ static ManagedValue convertOwnershipConventionGivenParamInfo(
272
272
if (isOwned && valueType.isMoveOnlyWrapped () &&
273
273
valueType.removingMoveOnlyWrapper ().isTrivial (SGF.F )) {
274
274
if (value.getOwnershipKind () == OwnershipKind::Guaranteed) {
275
- value = value.copyUnmanaged (SGF, loc);
275
+ value = value.copy (SGF, loc);
276
276
return SGF.B .createOwnedMoveOnlyWrapperToCopyableValue (loc, value);
277
277
}
278
278
}
279
279
280
280
if (param.isConsumedInCaller () &&
281
281
value.getOwnershipKind () == OwnershipKind::Guaranteed) {
282
- return value.copyUnmanaged (SGF, loc);
282
+ return value.copy (SGF, loc);
283
283
}
284
284
285
285
// If we are emitting arguments for a coroutine, we need to borrow owned
@@ -5982,18 +5982,13 @@ RValue SILGenFunction::emitApply(
5982
5982
case ParameterConvention::Direct_Owned:
5983
5983
// If the callee will consume the 'self' parameter, let's retain it so we
5984
5984
// can keep it alive.
5985
- lifetimeExtendedSelf =
5986
- B.emitCopyValueOperation (loc, lifetimeExtendedSelf);
5985
+ lifetimeExtendedSelf = selfMV.copy (*this , loc).forward (*this );
5987
5986
break ;
5988
5987
case ParameterConvention::Direct_Guaranteed:
5989
5988
case ParameterConvention::Direct_Unowned:
5990
5989
// We'll manually manage the argument's lifetime after the
5991
5990
// call. Disable its cleanup, forcing a copy if it was emitted +0.
5992
- if (selfMV.hasCleanup ()) {
5993
- selfMV.forwardCleanup (*this );
5994
- } else {
5995
- lifetimeExtendedSelf = selfMV.copyUnmanaged (*this , loc).forward (*this );
5996
- }
5991
+ lifetimeExtendedSelf = selfMV.ensurePlusOne (*this , loc).forward (*this );
5997
5992
break ;
5998
5993
5999
5994
case ParameterConvention::Indirect_In_Guaranteed:
@@ -7361,7 +7356,7 @@ ArgumentSource AccessorBaseArgPreparer::prepareAccessorObjectBaseArg() {
7361
7356
7362
7357
// We need to produce the value at +1 if it's going to be consumed.
7363
7358
if (selfParam.isConsumedInCaller () && !base.hasCleanup ()) {
7364
- base = base.copyUnmanaged (SGF, loc);
7359
+ base = base.copy (SGF, loc);
7365
7360
}
7366
7361
// If the parameter is indirect, we'll need to drop the value into
7367
7362
// temporary memory. Make a copy scoped to the current formal access that
0 commit comments