@@ -49,7 +49,8 @@ SILValue SILGenFunction::emitSelfDeclForDestructor(VarDecl *selfDecl) {
4949 // they cannot escape.
5050 if (selfValue->getOwnershipKind () == OwnershipKind::Owned) {
5151 selfValue = B.createMarkMustCheckInst (
52- selfDecl, selfValue, MarkMustCheckInst::CheckKind::NoImplicitCopy);
52+ selfDecl, selfValue,
53+ MarkMustCheckInst::CheckKind::ConsumableAndAssignable);
5354 }
5455 }
5556
@@ -129,7 +130,7 @@ class EmitBBArguments : public CanTypeVisitor<EmitBBArguments,
129130 // check ownership.
130131 if (mv.getType ().isMoveOnly () && !mv.getType ().isMoveOnlyWrapped ())
131132 mv = SGF.B .createMarkMustCheckInst (
132- loc, mv, MarkMustCheckInst::CheckKind::NoImplicitCopy );
133+ loc, mv, MarkMustCheckInst::CheckKind::ConsumableAndAssignable );
133134 return mv;
134135 }
135136
@@ -322,15 +323,15 @@ struct ArgumentInitHelper {
322323 value = SGF.B .createMoveValue (loc, argrv.forward (SGF),
323324 /* isLexical*/ true );
324325 value = SGF.B .createMarkMustCheckInst (
325- loc, value, MarkMustCheckInst::CheckKind::NoImplicitCopy );
326+ loc, value, MarkMustCheckInst::CheckKind::ConsumableAndAssignable );
326327 SGF.emitManagedRValueWithCleanup (value);
327328 return value;
328329 }
329330
330331 assert (value->getOwnershipKind () == OwnershipKind::Guaranteed);
331332 value = SGF.B .createCopyValue (loc, value);
332333 value = SGF.B .createMarkMustCheckInst (
333- loc, value, MarkMustCheckInst::CheckKind::NoCopy );
334+ loc, value, MarkMustCheckInst::CheckKind::NoConsumeOrAssign );
334335 SGF.emitManagedRValueWithCleanup (value);
335336 return value;
336337 }
@@ -341,9 +342,9 @@ struct ArgumentInitHelper {
341342
342343 // If our argument was owned, we use no implicit copy. Otherwise, we
343344 // use no copy.
344- auto kind = MarkMustCheckInst::CheckKind::NoCopy ;
345+ auto kind = MarkMustCheckInst::CheckKind::NoConsumeOrAssign ;
345346 if (pd->isOwned ())
346- kind = MarkMustCheckInst::CheckKind::NoImplicitCopy ;
347+ kind = MarkMustCheckInst::CheckKind::ConsumableAndAssignable ;
347348 value = SGF.B .createMarkMustCheckInst (loc, value, kind);
348349 SGF.emitManagedRValueWithCleanup (value);
349350 return value;
@@ -353,7 +354,7 @@ struct ArgumentInitHelper {
353354 value = SGF.B .createGuaranteedCopyableToMoveOnlyWrapperValue (loc, value);
354355 value = SGF.B .createCopyValue (loc, value);
355356 value = SGF.B .createMarkMustCheckInst (
356- loc, value, MarkMustCheckInst::CheckKind::NoCopy );
357+ loc, value, MarkMustCheckInst::CheckKind::NoConsumeOrAssign );
357358 SGF.emitManagedRValueWithCleanup (value);
358359 return value;
359360 }
@@ -365,7 +366,7 @@ struct ArgumentInitHelper {
365366 loc, argrv.forward (SGF));
366367 value = SGF.B .createMoveValue (loc, value, true /* is lexical*/ );
367368 value = SGF.B .createMarkMustCheckInst (
368- loc, value, MarkMustCheckInst::CheckKind::NoImplicitCopy );
369+ loc, value, MarkMustCheckInst::CheckKind::ConsumableAndAssignable );
369370 SGF.emitManagedRValueWithCleanup (value);
370371 return value;
371372 }
@@ -547,14 +548,14 @@ static void emitCaptureArguments(SILGenFunction &SGF,
547548 val = addr->getManagedAddress ();
548549 }
549550
550- // If this constant is a move only type, we need to add no_copy checking to
551+ // If this constant is a move only type, we need to add no_consume_or_assign checking to
551552 // ensure that we do not consume this captured value in the function. This
552553 // is because closures can be invoked multiple times which is inconsistent
553554 // with consuming the move only type.
554555 if (val.getType ().isMoveOnly ()) {
555556 val = val.ensurePlusOne (SGF, Loc);
556- val = SGF.B .createMarkMustCheckInst (Loc, val,
557- MarkMustCheckInst::CheckKind::NoCopy );
557+ val = SGF.B .createMarkMustCheckInst (
558+ Loc, val, MarkMustCheckInst::CheckKind::NoConsumeOrAssign );
558559 }
559560
560561 SGF.VarLocs [VD] = SILGenFunction::VarLoc::get (val.getValue ());
@@ -585,7 +586,7 @@ static void emitCaptureArguments(SILGenFunction &SGF,
585586 SILValue addr = SGF.B .createProjectBox (VD, box, 0 );
586587 if (addr->getType ().isMoveOnly ())
587588 addr = SGF.B .createMarkMustCheckInst (
588- VD, addr, MarkMustCheckInst::CheckKind::NoImplicitCopy );
589+ VD, addr, MarkMustCheckInst::CheckKind::ConsumableAndAssignable );
589590 SGF.VarLocs [VD] = SILGenFunction::VarLoc::get (addr, box);
590591 SILDebugVariable DbgVar (VD->isLet (), ArgNo);
591592 SGF.B .createDebugValueAddr (Loc, addr, DbgVar);
@@ -608,7 +609,7 @@ static void emitCaptureArguments(SILGenFunction &SGF,
608609 SILValue arg = SILValue (fArg );
609610 if (isInOut && (ty.isMoveOnly () && !ty.isMoveOnlyWrapped ())) {
610611 arg = SGF.B .createMarkMustCheckInst (
611- Loc, arg, MarkMustCheckInst::CheckKind::NoImplicitCopy );
612+ Loc, arg, MarkMustCheckInst::CheckKind::ConsumableAndAssignable );
612613 }
613614 SGF.VarLocs [VD] = SILGenFunction::VarLoc::get (arg);
614615 SILDebugVariable DbgVar (VD->isLet (), ArgNo);
0 commit comments