@@ -984,6 +984,7 @@ Linkage
984
984
sil-linkage ::= 'private'
985
985
sil-linkage ::= 'public_external'
986
986
sil-linkage ::= 'hidden_external'
987
+ sil-linkage ::= 'non_abi'
987
988
988
989
A linkage specifier controls the situations in which two objects in
989
990
different SIL modules are *linked *, i.e. treated as the same object.
@@ -1048,6 +1049,25 @@ not needed.
1048
1049
If an object has any uses, then it must be linked to a definition
1049
1050
with non-external linkage.
1050
1051
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
+
1051
1071
Summary
1052
1072
```````
1053
1073
0 commit comments