mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -2191,9 +2191,9 @@ static void visitBuiltinAddress(BuiltinInst *builtin,
|
||||
visitor(&builtin->getAllOperands()[2]);
|
||||
return;
|
||||
|
||||
// This consumes its second parameter (the arg) and takes/places that value
|
||||
// into the first parameter (the result).
|
||||
// These effect both operands.
|
||||
case BuiltinValueKind::Move:
|
||||
case BuiltinValueKind::Copy:
|
||||
visitor(&builtin->getAllOperands()[1]);
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user