Skip to content

Commit 3c95a19

Browse files
committed
[SIL.rst] Convert a bunch of bolded instruction names to inline links to the instructions docs.
Seems useful to allow for quick navigation. I did not get all of them, but did a bunch of them.
1 parent d966dbb commit 3c95a19

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

docs/SIL.rst

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -962,13 +962,13 @@ called within the addressor.
962962

963963
The function is a getter of a lazy property for which the backing storage is
964964
an ``Optional`` of the property's type. The getter contains a top-level
965-
``switch_enum`` (or ``switch_enum_addr``), which tests if the lazy property
965+
`switch_enum`_ (or `switch_enum_addr`_), which tests if the lazy property
966966
is already computed. In the ``None``-case, the property is computed and stored
967967
to the backing storage of the property.
968968

969969
After the first call of a lazy property getter, it is guaranteed that the
970970
property is computed and consecutive calls always execute the ``Some``-case of
971-
the top-level ``switch_enum``.
971+
the top-level `switch_enum`_.
972972
::
973973

974974
sil-function-attribute ::= '[weak_imported]'
@@ -4601,7 +4601,7 @@ but turns the control flow dependency into a data flow dependency.
46014601
For address-only enums, `select_enum_addr`_ offers the same functionality for
46024602
an indirectly referenced enum value in memory.
46034603

4604-
Like `switch_enum`_, ``select_enum`` must have a ``default`` case unless the
4604+
Like `switch_enum`_, `select_enum`_ must have a ``default`` case unless the
46054605
enum can be exhaustively switched in the current function.
46064606

46074607
select_enum_addr
@@ -4626,7 +4626,7 @@ Selects one of the "case" or "default" operands based on the case of the
46264626
referenced enum value. This is the address-only counterpart to
46274627
`select_enum`_.
46284628

4629-
Like `switch_enum_addr`_, ``select_enum_addr`` must have a ``default`` case
4629+
Like `switch_enum_addr`_, `select_enum_addr`_ must have a ``default`` case
46304630
unless the enum can be exhaustively switched in the current function.
46314631

46324632
Protocol and Protocol Composition Types
@@ -4650,10 +4650,10 @@ container may use one of several representations:
46504650
type are class protocols, then the existential container for that type is
46514651
address-only and referred to in the implementation as an *opaque existential
46524652
container*. The value semantics of the existential container propagate to the
4653-
contained concrete value. Applying ``copy_addr`` to an opaque existential
4653+
contained concrete value. Applying `copy_addr`_ to an opaque existential
46544654
container copies the contained concrete value, deallocating or reallocating
46554655
the destination container's owned buffer if necessary. Applying
4656-
``destroy_addr`` to an opaque existential container destroys the concrete
4656+
`destroy_addr`_ to an opaque existential container destroys the concrete
46574657
value and deallocates any buffers owned by the existential container. The
46584658
following instructions manipulate opaque existential containers:
46594659

@@ -4705,8 +4705,8 @@ Some existential types may additionally support specialized representations
47054705
when they contain certain known concrete types. For example, when Objective-C
47064706
interop is available, the ``Error`` protocol existential supports
47074707
a class existential container representation for ``NSError`` objects, so it
4708-
can be initialized from one using ``init_existential_ref`` instead of the
4709-
more expensive ``alloc_existential_box``::
4708+
can be initialized from one using `init_existential_ref`_ instead of the
4709+
more expensive `alloc_existential_box`_::
47104710

47114711
bb(%nserror: $NSError):
47124712
// The slow general way to form an Error, allocating a box and
@@ -4739,9 +4739,9 @@ instruction is an address referencing the storage for the contained value, which
47394739
remains uninitialized. The contained value must be ``store``-d or
47404740
``copy_addr``-ed to in order for the existential value to be fully initialized.
47414741
If the existential container needs to be destroyed while the contained value
4742-
is uninitialized, ``deinit_existential_addr`` must be used to do so. A fully
4743-
initialized existential container can be destroyed with ``destroy_addr`` as
4744-
usual. It is undefined behavior to ``destroy_addr`` a partially-initialized
4742+
is uninitialized, `deinit_existential_addr`_ must be used to do so. A fully
4743+
initialized existential container can be destroyed with `destroy_addr`_ as
4744+
usual. It is undefined behavior to `destroy_addr`_ a partially-initialized
47454745
existential container.
47464746

47474747
init_existential_value
@@ -4770,10 +4770,10 @@ deinit_existential_addr
47704770
// composition type P
47714771

47724772
Undoes the partial initialization performed by
4773-
``init_existential_addr``. ``deinit_existential_addr`` is only valid for
4773+
`init_existential_addr`_. `deinit_existential_addr`_ is only valid for
47744774
existential containers that have been partially initialized by
4775-
``init_existential_addr`` but haven't had their contained value initialized.
4776-
A fully initialized existential must be destroyed with ``destroy_addr``.
4775+
`init_existential_addr`_ but haven't had their contained value initialized.
4776+
A fully initialized existential must be destroyed with `destroy_addr`_.
47774777

47784778
deinit_existential_value
47794779
````````````````````````
@@ -4786,10 +4786,10 @@ deinit_existential_value
47864786
// composition type P
47874787

47884788
Undoes the partial initialization performed by
4789-
``init_existential_value``. ``deinit_existential_value`` is only valid for
4789+
`init_existential_value`_. `deinit_existential_value`_ is only valid for
47904790
existential containers that have been partially initialized by
4791-
``init_existential_value`` but haven't had their contained value initialized.
4792-
A fully initialized existential must be destroyed with ``destroy_value``.
4791+
`init_existential_value`_ but haven't had their contained value initialized.
4792+
A fully initialized existential must be destroyed with `destroy_value`_.
47934793

47944794
open_existential_addr
47954795
`````````````````````
@@ -4866,7 +4866,7 @@ Extracts the class instance reference from a class existential
48664866
container. The protocol conformances associated with this existential
48674867
container are associated directly with the archetype ``@opened P``. This
48684868
pointer can be used with any operation on archetypes, such as
4869-
``witness_method``. When the operand is of metatype type, the result
4869+
`witness_method`_. When the operand is of metatype type, the result
48704870
will be the metatype of the opened archetype.
48714871

48724872
init_existential_metatype
@@ -4916,9 +4916,9 @@ alloc_existential_box
49164916
Allocates a boxed existential container of type ``$P`` with space to hold a
49174917
value of type ``$T'``. The box is not fully initialized until a valid value
49184918
has been stored into the box. If the box must be deallocated before it is
4919-
fully initialized, ``dealloc_existential_box`` must be used. A fully
4919+
fully initialized, `dealloc_existential_box`_ must be used. A fully
49204920
initialized box can be ``retain``-ed and ``release``-d like any
4921-
reference-counted type. The ``project_existential_box`` instruction is used
4921+
reference-counted type. The `project_existential_box`_ instruction is used
49224922
to retrieve the address of the value inside the container.
49234923

49244924
project_existential_box
@@ -4936,7 +4936,7 @@ project_existential_box
49364936
Projects the address of the value inside a boxed existential container.
49374937
The address is dependent on the lifetime of the owner reference ``%0``.
49384938
It is undefined behavior if the concrete type ``$T`` is not the same type for
4939-
which the box was allocated with ``alloc_existential_box``.
4939+
which the box was allocated with `alloc_existential_box`_.
49404940

49414941
open_existential_box
49424942
````````````````````
@@ -4987,7 +4987,7 @@ Deallocates a boxed existential container. The value inside the existential
49874987
buffer is not destroyed; either the box must be uninitialized, or the value
49884988
must have been projected out and destroyed beforehand. It is undefined behavior
49894989
if the concrete type ``$T`` is not the same type for which the box was
4990-
allocated with ``alloc_existential_box``.
4990+
allocated with `alloc_existential_box`_.
49914991

49924992
Blocks
49934993
~~~~~~
@@ -5052,7 +5052,7 @@ pointer_to_address
50525052

50535053
Creates an address value corresponding to the ``Builtin.RawPointer`` value
50545054
``%0``. Converting a ``RawPointer`` back to an address of the same type as
5055-
its originating ``address_to_pointer`` instruction gives back an equivalent
5055+
its originating `address_to_pointer`_ instruction gives back an equivalent
50565056
address. It is undefined behavior to cast the ``RawPointer`` back to any type
50575057
other than its original address type or `layout compatible types`_. It is
50585058
also undefined behavior to cast a ``RawPointer`` from a heap object to any
@@ -5161,7 +5161,7 @@ ref_to_raw_pointer
51615161
Converts a heap object reference to a ``Builtin.RawPointer``. The ``RawPointer``
51625162
result can be cast back to the originating class type but does not have
51635163
ownership semantics. It is undefined behavior to cast a ``RawPointer`` from a
5164-
heap object reference to an address using ``pointer_to_address``.
5164+
heap object reference to an address using `pointer_to_address`_.
51655165

51665166
raw_pointer_to_ref
51675167
``````````````````

0 commit comments

Comments
 (0)