Skip to content

Commit a2daa11

Browse files
committed
Merge branch 'master' into fix/SR-10492
2 parents 28d0c08 + 8fcc94f commit a2daa11

File tree

328 files changed

+44180
-43732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

328 files changed

+44180
-43732
lines changed

cmake/modules/SwiftSource.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ function(_compile_swift_files
229229
# The standard library and overlays are always built resiliently.
230230
if(SWIFTFILE_IS_STDLIB)
231231
list(APPEND swift_flags "-enable-library-evolution")
232+
list(APPEND swift_flags "-Xfrontend" "-enable-ownership-stripping-after-serialization")
232233
endif()
233234

234235
if(SWIFT_STDLIB_USE_NONATOMIC_RC)

docs/Diagnostics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Most diagnostics have no reason to change behavior under editor mode. An example
9797

9898
- `%0`, `%1`, etc - Formats the specified diagnostic argument based on its type.
9999

100-
- `%select{a|b|c}0` - Chooses from a list of alternatives, separated by vertical bars, based on the value of the given argument. In this example, a value of 2 in diagnostic argument 0 would result in "c" being output.
100+
- `%select{a|b|c}0` - Chooses from a list of alternatives, separated by vertical bars, based on the value of the given argument. In this example, a value of 2 in diagnostic argument 0 would result in "c" being output. The argument to the %select may be an integer, enum, or StringRef. If it's a StringRef, the specifier acts as an emptiness check.
101101

102102
- `%s0` - Produces an "s" if the given argument is anything other than 1, as meant for an English plural. This isn't particularly localizable without a more general `%plural` form, but most diagnostics try to avoid cases where a plural/singular distinction would be necessary in the first place.
103103

docs/SIL.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2802,6 +2802,21 @@ It is expected that the strong reference count of the object is one.
28022802
Furthermore, no other thread may increment the strong reference count during
28032803
execution of this instruction.
28042804

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+
28052820
strong_retain_unowned
28062821
`````````````````````
28072822
::
@@ -3712,6 +3727,21 @@ This instruction has the same local semantics as ``retain_value`` but:
37123727
The intention is that this instruction is used to implement unmanaged
37133728
constructs.
37143729

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+
37153745
copy_value
37163746
``````````
37173747

0 commit comments

Comments
 (0)