1
- :orphan:
2
-
3
- =================================
4
- Swift Binary Serialization Format
5
- =================================
1
+ # Swift Binary Serialization Format
6
2
7
3
The fundamental unit of distribution for Swift code is a * module.* A module
8
4
contains declarations as an interface for clients to write code against. It may
@@ -33,10 +29,9 @@ tied to the compiler internals to be useful for this purpose, and it is likely
33
29
we'll invent a new format instead.
34
30
35
31
36
- Why LLVM bitcode?
37
- =================
32
+ ## Why LLVM bitcode?
38
33
39
- The ` LLVM bitstream < http://llvm.org/docs/BitCodeFormat.html >`_ format was
34
+ The [ LLVM bitstream] ( http://llvm.org/docs/BitCodeFormat.html ) format was
40
35
invented as a container format for LLVM IR. It is a binary format supporting
41
36
two basic structures: * blocks,* which define regions of the file, and
42
37
* records,* which contain data fields that can be up to 64 bits. It has a few
@@ -60,10 +55,9 @@ have most of these properties as well. But we're already linking against
60
55
LLVM...might as well use it!
61
56
62
57
63
- Versioning
64
- ==========
58
+ ## Versioning
65
59
66
- .. warning ::
60
+ #### _ Warning _
67
61
68
62
This section is relevant to any forward-compatible format used for a
69
63
library's public interface. However, as mentioned above this may not be
@@ -101,13 +95,11 @@ requires extra work on the compiler's part to detect which features are in use;
101
95
a simpler implementation would just use the latest version number supported:
102
96
1.9.
103
97
104
- *This versioning scheme was inspired by * `Semantic Versioning
105
- <http://semver.org> `_. *However, it is not compatible with Semantic Versioning
98
+ * This versioning scheme was inspired by* [ Semantic Versioning] ( http://semver.org ) . * However, it is not compatible with Semantic Versioning
106
99
because it promises* forward-compatibility * rather than* backward-compatibility.
107
100
108
101
109
- A High-Level Tour of the Current Module Format
110
- ==============================================
102
+ ## A High-Level Tour of the Current Module Format
111
103
112
104
Every serialized module is represented as a single block called the "module
113
105
block". The module block is made up of several other block kinds, largely for
@@ -132,7 +124,7 @@ organizational purposes.
132
124
- The ** SIL block** contains SIL-level implementations that can be imported
133
125
into a client's SILModule context. In most cases this is just a performance
134
126
concern, but sometimes it affects language semantics as well, as in the case
135
- of `` @_transparent ` `. The SIL block precedes the AST block because it affects
127
+ of ` @_transparent ` . The SIL block precedes the AST block because it affects
136
128
which AST nodes get serialized.
137
129
138
130
- The ** SIL index block** contains tables for accessing various SIL entities by
@@ -145,9 +137,7 @@ organizational purposes.
145
137
Nodes are accessed by a file-unique "DeclIDs" (also covering DeclContexts)
146
138
and "TypeIDs"; the two sets of IDs use separate numbering schemes.
147
139
148
- .. note ::
149
-
150
- The AST block is currently referred to as the "decls block" in the source.
140
+ _ note_ : The AST block is currently referred to as the "decls block" in the source.
151
141
152
142
- The ** identifier block** contains a single blob of strings. This is intended
153
143
for Identifiers---strings uniqued by the ASTContext---but can in theory
@@ -160,13 +150,11 @@ organizational purposes.
160
150
top-level declarations.
161
151
162
152
163
- SIL
164
- ===
153
+ ## SIL
165
154
166
155
[ to be written]
167
156
168
157
169
- Cross-reference resilience
170
- ==========================
158
+ ## Cross-reference resilience
171
159
172
160
[ to be written]
0 commit comments