File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -2802,6 +2802,21 @@ It is expected that the strong reference count of the object is one.
2802
2802
Furthermore, no other thread may increment the strong reference count during
2803
2803
execution of this instruction.
2804
2804
2805
+ copy_unowned_value
2806
+ ``````````````````
2807
+ ::
2808
+
2809
+ sil-instruction ::= 'copy_unowned_value' sil-operand
2810
+
2811
+ %1 = copy_unowned_value %0 : $@unowned T
2812
+ // %1 will be a strong @owned value of type $T.
2813
+ // $T must be a reference type
2814
+
2815
+ Asserts that the strong reference count of the heap object referenced by ``%0 ``
2816
+ is still positive, then increments the reference count and returns a new strong
2817
+ reference to ``%0 ``. The intention is that this instruction is used as a "safe
2818
+ ownership conversion" from ``unowned `` to ``strong ``.
2819
+
2805
2820
strong_retain_unowned
2806
2821
`````````````````````
2807
2822
::
@@ -3712,6 +3727,21 @@ This instruction has the same local semantics as ``retain_value`` but:
3712
3727
The intention is that this instruction is used to implement unmanaged
3713
3728
constructs.
3714
3729
3730
+ copy_unmanaged_value
3731
+ ``````````````````````
3732
+
3733
+ ::
3734
+
3735
+ sil-instruction ::= 'copy_unmanaged_value' sil-value
3736
+
3737
+ %1 = copy_unmanaged_value %0 : $@sil_unmanaged A
3738
+ // %1 will be a strong @owned $A.
3739
+
3740
+ This instruction has the same semantics as ``copy_value `` except that its input
3741
+ is a trivial ``@sil_unmanaged `` type that doesn't require ref counting. This is
3742
+ intended to be used semantically as a "conversion" like instruction from
3743
+ ``unmanaged `` to ``strong `` and thus should never be removed by the optimizer.
3744
+
3715
3745
copy_value
3716
3746
``````````
3717
3747
You can’t perform that action at this time.
0 commit comments