Skip to content

Commit 8d3da66

Browse files
DougGregorjckarter
andcommitted
[Doc] Update mangling document with historical prefixes.
Co-authored-by: Joe Groff <[email protected]>
1 parent 602b38e commit 8d3da66

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

docs/ABI/Mangling.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,15 @@ Mangling
99
--------
1010
::
1111

12-
mangled-name ::= '$s' global
12+
mangled-name ::= '$s' global // Swift stable mangling
13+
mangled-name ::= '_T0' global // Swift 4.0
14+
mangled-name ::= '$S' global // Swift 4.2
1315

14-
All Swift-mangled names begin with this prefix.
16+
All Swift-mangled names begin with a common prefix. Since Swift 4.0, the
17+
compiler has used variations of the mangling described in this document, though
18+
pre-stable versions may not exactly conform to this description. By using
19+
distinct prefixes, tools can attempt to accommodate bugs and version variations
20+
in pre-stable versions of Swift.
1521

1622
The basic mangling scheme is a list of 'operators' where the operators are
1723
structured in a post-fix order. For example the mangling may start with an
@@ -20,8 +26,6 @@ identifier has to be interpreted::
2026

2127
4Test3FooC // The trailing 'C' says that 'Foo' is a class in module 'Test'
2228

23-
24-
2529
Operators are either identifiers or a sequence of one or more characters,
2630
like ``C`` for class.
2731
All operators share the same name-space. Important operators are a single

0 commit comments

Comments
 (0)