[moveOnly] Implement a new _copy function that performs an explicit copy value.

The key thing is that the move checker will not consider the explicit copy value
to be a copy_value that can be rewritten, ensuring that any uses of the result
of the explicit copy_value (consuming or other wise) are not checked.

Similar to the _move operator I recently introduced, this is a transparent
function so we can perform one level of specialization and thus at least be
generic over all concrete types.
This commit is contained in:
Michael Gottesman
2021-10-28 22:02:31 -07:00
parent 94d824af9d
commit f9122a79b7
31 changed files with 360 additions and 3 deletions

View File

@@ -175,6 +175,7 @@ static bool isBarrier(SILInstruction *inst) {
case BuiltinValueKind::AssignTakeArray:
case BuiltinValueKind::UnsafeGuaranteed:
case BuiltinValueKind::Move:
case BuiltinValueKind::Copy:
case BuiltinValueKind::UnsafeGuaranteedEnd:
case BuiltinValueKind::CancelAsyncTask:
case BuiltinValueKind::StartAsyncLet: