Skip to content

Commit 15bc2af

Browse files
authored
Merge pull request #21597 from slavapestov/document-non-abi
Document non_abi linkage in SIL.rst
2 parents a10f65b + 6a507b4 commit 15bc2af

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

docs/SIL.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,7 @@ Linkage
984984
sil-linkage ::= 'private'
985985
sil-linkage ::= 'public_external'
986986
sil-linkage ::= 'hidden_external'
987+
sil-linkage ::= 'non_abi'
987988

988989
A linkage specifier controls the situations in which two objects in
989990
different SIL modules are *linked*, i.e. treated as the same object.
@@ -1048,6 +1049,25 @@ not needed.
10481049
If an object has any uses, then it must be linked to a definition
10491050
with non-external linkage.
10501051

1052+
Public non-ABI linkage
1053+
``````````````````````
1054+
1055+
The `non_abi` linkage is a special linkage used for definitions which
1056+
only exist in serialized SIL, and do not define visible symbols in the
1057+
object file.
1058+
1059+
A definition with `non_abi` linkage behaves like it has `shared` linkage,
1060+
except that it must be serialized in the SIL module even if not referenced
1061+
from anywhere else in the module. For example, this means it is considered
1062+
a root for dead function elimination.
1063+
1064+
When a `non_abi` definition is deserialized, it will have `shared_external`
1065+
linkage.
1066+
1067+
There is no `non_abi_external` linkage. Instead, when referencing a
1068+
`non_abi` declaration that is defined in a different translation unit from
1069+
the same Swift module, you must use `hidden_external` linkage.
1070+
10511071
Summary
10521072
```````
10531073

0 commit comments

Comments
 (0)