xref: /aosp_15_r20/external/llvm/docs/BitCodeFormat.rst (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker.. role:: raw-html(raw)
2*9880d681SAndroid Build Coastguard Worker   :format: html
3*9880d681SAndroid Build Coastguard Worker
4*9880d681SAndroid Build Coastguard Worker========================
5*9880d681SAndroid Build Coastguard WorkerLLVM Bitcode File Format
6*9880d681SAndroid Build Coastguard Worker========================
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker.. contents::
9*9880d681SAndroid Build Coastguard Worker   :local:
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard WorkerAbstract
12*9880d681SAndroid Build Coastguard Worker========
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard WorkerThis document describes the LLVM bitstream file format and the encoding of the
15*9880d681SAndroid Build Coastguard WorkerLLVM IR into it.
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard WorkerOverview
18*9880d681SAndroid Build Coastguard Worker========
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard WorkerWhat is commonly known as the LLVM bitcode file format (also, sometimes
21*9880d681SAndroid Build Coastguard Workeranachronistically known as bytecode) is actually two things: a `bitstream
22*9880d681SAndroid Build Coastguard Workercontainer format`_ and an `encoding of LLVM IR`_ into the container format.
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard WorkerThe bitstream format is an abstract encoding of structured data, very similar to
25*9880d681SAndroid Build Coastguard WorkerXML in some ways.  Like XML, bitstream files contain tags, and nested
26*9880d681SAndroid Build Coastguard Workerstructures, and you can parse the file without having to understand the tags.
27*9880d681SAndroid Build Coastguard WorkerUnlike XML, the bitstream format is a binary encoding, and unlike XML it
28*9880d681SAndroid Build Coastguard Workerprovides a mechanism for the file to self-describe "abbreviations", which are
29*9880d681SAndroid Build Coastguard Workereffectively size optimizations for the content.
30*9880d681SAndroid Build Coastguard Worker
31*9880d681SAndroid Build Coastguard WorkerLLVM IR files may be optionally embedded into a `wrapper`_ structure, or in a
32*9880d681SAndroid Build Coastguard Worker`native object file`_. Both of these mechanisms make it easy to embed extra
33*9880d681SAndroid Build Coastguard Workerdata along with LLVM IR files.
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard WorkerThis document first describes the LLVM bitstream format, describes the wrapper
36*9880d681SAndroid Build Coastguard Workerformat, then describes the record structure used by LLVM IR files.
37*9880d681SAndroid Build Coastguard Worker
38*9880d681SAndroid Build Coastguard Worker.. _bitstream container format:
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard WorkerBitstream Format
41*9880d681SAndroid Build Coastguard Worker================
42*9880d681SAndroid Build Coastguard Worker
43*9880d681SAndroid Build Coastguard WorkerThe bitstream format is literally a stream of bits, with a very simple
44*9880d681SAndroid Build Coastguard Workerstructure.  This structure consists of the following concepts:
45*9880d681SAndroid Build Coastguard Worker
46*9880d681SAndroid Build Coastguard Worker* A "`magic number`_" that identifies the contents of the stream.
47*9880d681SAndroid Build Coastguard Worker
48*9880d681SAndroid Build Coastguard Worker* Encoding `primitives`_ like variable bit-rate integers.
49*9880d681SAndroid Build Coastguard Worker
50*9880d681SAndroid Build Coastguard Worker* `Blocks`_, which define nested content.
51*9880d681SAndroid Build Coastguard Worker
52*9880d681SAndroid Build Coastguard Worker* `Data Records`_, which describe entities within the file.
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard Worker* Abbreviations, which specify compression optimizations for the file.
55*9880d681SAndroid Build Coastguard Worker
56*9880d681SAndroid Build Coastguard WorkerNote that the :doc:`llvm-bcanalyzer <CommandGuide/llvm-bcanalyzer>` tool can be
57*9880d681SAndroid Build Coastguard Workerused to dump and inspect arbitrary bitstreams, which is very useful for
58*9880d681SAndroid Build Coastguard Workerunderstanding the encoding.
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard Worker.. _magic number:
61*9880d681SAndroid Build Coastguard Worker
62*9880d681SAndroid Build Coastguard WorkerMagic Numbers
63*9880d681SAndroid Build Coastguard Worker-------------
64*9880d681SAndroid Build Coastguard Worker
65*9880d681SAndroid Build Coastguard WorkerThe first two bytes of a bitcode file are 'BC' (``0x42``, ``0x43``).  The second
66*9880d681SAndroid Build Coastguard Workertwo bytes are an application-specific magic number.  Generic bitcode tools can
67*9880d681SAndroid Build Coastguard Workerlook at only the first two bytes to verify the file is bitcode, while
68*9880d681SAndroid Build Coastguard Workerapplication-specific programs will want to look at all four.
69*9880d681SAndroid Build Coastguard Worker
70*9880d681SAndroid Build Coastguard Worker.. _primitives:
71*9880d681SAndroid Build Coastguard Worker
72*9880d681SAndroid Build Coastguard WorkerPrimitives
73*9880d681SAndroid Build Coastguard Worker----------
74*9880d681SAndroid Build Coastguard Worker
75*9880d681SAndroid Build Coastguard WorkerA bitstream literally consists of a stream of bits, which are read in order
76*9880d681SAndroid Build Coastguard Workerstarting with the least significant bit of each byte.  The stream is made up of
77*9880d681SAndroid Build Coastguard Workera number of primitive values that encode a stream of unsigned integer values.
78*9880d681SAndroid Build Coastguard WorkerThese integers are encoded in two ways: either as `Fixed Width Integers`_ or as
79*9880d681SAndroid Build Coastguard Worker`Variable Width Integers`_.
80*9880d681SAndroid Build Coastguard Worker
81*9880d681SAndroid Build Coastguard Worker.. _Fixed Width Integers:
82*9880d681SAndroid Build Coastguard Worker.. _fixed-width value:
83*9880d681SAndroid Build Coastguard Worker
84*9880d681SAndroid Build Coastguard WorkerFixed Width Integers
85*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^
86*9880d681SAndroid Build Coastguard Worker
87*9880d681SAndroid Build Coastguard WorkerFixed-width integer values have their low bits emitted directly to the file.
88*9880d681SAndroid Build Coastguard WorkerFor example, a 3-bit integer value encodes 1 as 001.  Fixed width integers are
89*9880d681SAndroid Build Coastguard Workerused when there are a well-known number of options for a field.  For example,
90*9880d681SAndroid Build Coastguard Workerboolean values are usually encoded with a 1-bit wide integer.
91*9880d681SAndroid Build Coastguard Worker
92*9880d681SAndroid Build Coastguard Worker.. _Variable Width Integers:
93*9880d681SAndroid Build Coastguard Worker.. _Variable Width Integer:
94*9880d681SAndroid Build Coastguard Worker.. _variable-width value:
95*9880d681SAndroid Build Coastguard Worker
96*9880d681SAndroid Build Coastguard WorkerVariable Width Integers
97*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard WorkerVariable-width integer (VBR) values encode values of arbitrary size, optimizing
100*9880d681SAndroid Build Coastguard Workerfor the case where the values are small.  Given a 4-bit VBR field, any 3-bit
101*9880d681SAndroid Build Coastguard Workervalue (0 through 7) is encoded directly, with the high bit set to zero.  Values
102*9880d681SAndroid Build Coastguard Workerlarger than N-1 bits emit their bits in a series of N-1 bit chunks, where all
103*9880d681SAndroid Build Coastguard Workerbut the last set the high bit.
104*9880d681SAndroid Build Coastguard Worker
105*9880d681SAndroid Build Coastguard WorkerFor example, the value 27 (0x1B) is encoded as 1011 0011 when emitted as a vbr4
106*9880d681SAndroid Build Coastguard Workervalue.  The first set of four bits indicates the value 3 (011) with a
107*9880d681SAndroid Build Coastguard Workercontinuation piece (indicated by a high bit of 1).  The next word indicates a
108*9880d681SAndroid Build Coastguard Workervalue of 24 (011 << 3) with no continuation.  The sum (3+24) yields the value
109*9880d681SAndroid Build Coastguard Worker27.
110*9880d681SAndroid Build Coastguard Worker
111*9880d681SAndroid Build Coastguard Worker.. _char6-encoded value:
112*9880d681SAndroid Build Coastguard Worker
113*9880d681SAndroid Build Coastguard Worker6-bit characters
114*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^
115*9880d681SAndroid Build Coastguard Worker
116*9880d681SAndroid Build Coastguard Worker6-bit characters encode common characters into a fixed 6-bit field.  They
117*9880d681SAndroid Build Coastguard Workerrepresent the following characters with the following 6-bit values:
118*9880d681SAndroid Build Coastguard Worker
119*9880d681SAndroid Build Coastguard Worker::
120*9880d681SAndroid Build Coastguard Worker
121*9880d681SAndroid Build Coastguard Worker  'a' .. 'z' ---  0 .. 25
122*9880d681SAndroid Build Coastguard Worker  'A' .. 'Z' --- 26 .. 51
123*9880d681SAndroid Build Coastguard Worker  '0' .. '9' --- 52 .. 61
124*9880d681SAndroid Build Coastguard Worker         '.' --- 62
125*9880d681SAndroid Build Coastguard Worker         '_' --- 63
126*9880d681SAndroid Build Coastguard Worker
127*9880d681SAndroid Build Coastguard WorkerThis encoding is only suitable for encoding characters and strings that consist
128*9880d681SAndroid Build Coastguard Workeronly of the above characters.  It is completely incapable of encoding characters
129*9880d681SAndroid Build Coastguard Workernot in the set.
130*9880d681SAndroid Build Coastguard Worker
131*9880d681SAndroid Build Coastguard WorkerWord Alignment
132*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^
133*9880d681SAndroid Build Coastguard Worker
134*9880d681SAndroid Build Coastguard WorkerOccasionally, it is useful to emit zero bits until the bitstream is a multiple
135*9880d681SAndroid Build Coastguard Workerof 32 bits.  This ensures that the bit position in the stream can be represented
136*9880d681SAndroid Build Coastguard Workeras a multiple of 32-bit words.
137*9880d681SAndroid Build Coastguard Worker
138*9880d681SAndroid Build Coastguard WorkerAbbreviation IDs
139*9880d681SAndroid Build Coastguard Worker----------------
140*9880d681SAndroid Build Coastguard Worker
141*9880d681SAndroid Build Coastguard WorkerA bitstream is a sequential series of `Blocks`_ and `Data Records`_.  Both of
142*9880d681SAndroid Build Coastguard Workerthese start with an abbreviation ID encoded as a fixed-bitwidth field.  The
143*9880d681SAndroid Build Coastguard Workerwidth is specified by the current block, as described below.  The value of the
144*9880d681SAndroid Build Coastguard Workerabbreviation ID specifies either a builtin ID (which have special meanings,
145*9880d681SAndroid Build Coastguard Workerdefined below) or one of the abbreviation IDs defined for the current block by
146*9880d681SAndroid Build Coastguard Workerthe stream itself.
147*9880d681SAndroid Build Coastguard Worker
148*9880d681SAndroid Build Coastguard WorkerThe set of builtin abbrev IDs is:
149*9880d681SAndroid Build Coastguard Worker
150*9880d681SAndroid Build Coastguard Worker* 0 - `END_BLOCK`_ --- This abbrev ID marks the end of the current block.
151*9880d681SAndroid Build Coastguard Worker
152*9880d681SAndroid Build Coastguard Worker* 1 - `ENTER_SUBBLOCK`_ --- This abbrev ID marks the beginning of a new
153*9880d681SAndroid Build Coastguard Worker  block.
154*9880d681SAndroid Build Coastguard Worker
155*9880d681SAndroid Build Coastguard Worker* 2 - `DEFINE_ABBREV`_ --- This defines a new abbreviation.
156*9880d681SAndroid Build Coastguard Worker
157*9880d681SAndroid Build Coastguard Worker* 3 - `UNABBREV_RECORD`_ --- This ID specifies the definition of an
158*9880d681SAndroid Build Coastguard Worker  unabbreviated record.
159*9880d681SAndroid Build Coastguard Worker
160*9880d681SAndroid Build Coastguard WorkerAbbreviation IDs 4 and above are defined by the stream itself, and specify an
161*9880d681SAndroid Build Coastguard Worker`abbreviated record encoding`_.
162*9880d681SAndroid Build Coastguard Worker
163*9880d681SAndroid Build Coastguard Worker.. _Blocks:
164*9880d681SAndroid Build Coastguard Worker
165*9880d681SAndroid Build Coastguard WorkerBlocks
166*9880d681SAndroid Build Coastguard Worker------
167*9880d681SAndroid Build Coastguard Worker
168*9880d681SAndroid Build Coastguard WorkerBlocks in a bitstream denote nested regions of the stream, and are identified by
169*9880d681SAndroid Build Coastguard Workera content-specific id number (for example, LLVM IR uses an ID of 12 to represent
170*9880d681SAndroid Build Coastguard Workerfunction bodies).  Block IDs 0-7 are reserved for `standard blocks`_ whose
171*9880d681SAndroid Build Coastguard Workermeaning is defined by Bitcode; block IDs 8 and greater are application
172*9880d681SAndroid Build Coastguard Workerspecific. Nested blocks capture the hierarchical structure of the data encoded
173*9880d681SAndroid Build Coastguard Workerin it, and various properties are associated with blocks as the file is parsed.
174*9880d681SAndroid Build Coastguard WorkerBlock definitions allow the reader to efficiently skip blocks in constant time
175*9880d681SAndroid Build Coastguard Workerif the reader wants a summary of blocks, or if it wants to efficiently skip data
176*9880d681SAndroid Build Coastguard Workerit does not understand.  The LLVM IR reader uses this mechanism to skip function
177*9880d681SAndroid Build Coastguard Workerbodies, lazily reading them on demand.
178*9880d681SAndroid Build Coastguard Worker
179*9880d681SAndroid Build Coastguard WorkerWhen reading and encoding the stream, several properties are maintained for the
180*9880d681SAndroid Build Coastguard Workerblock.  In particular, each block maintains:
181*9880d681SAndroid Build Coastguard Worker
182*9880d681SAndroid Build Coastguard Worker#. A current abbrev id width.  This value starts at 2 at the beginning of the
183*9880d681SAndroid Build Coastguard Worker   stream, and is set every time a block record is entered.  The block entry
184*9880d681SAndroid Build Coastguard Worker   specifies the abbrev id width for the body of the block.
185*9880d681SAndroid Build Coastguard Worker
186*9880d681SAndroid Build Coastguard Worker#. A set of abbreviations.  Abbreviations may be defined within a block, in
187*9880d681SAndroid Build Coastguard Worker   which case they are only defined in that block (neither subblocks nor
188*9880d681SAndroid Build Coastguard Worker   enclosing blocks see the abbreviation).  Abbreviations can also be defined
189*9880d681SAndroid Build Coastguard Worker   inside a `BLOCKINFO`_ block, in which case they are defined in all blocks
190*9880d681SAndroid Build Coastguard Worker   that match the ID that the ``BLOCKINFO`` block is describing.
191*9880d681SAndroid Build Coastguard Worker
192*9880d681SAndroid Build Coastguard WorkerAs sub blocks are entered, these properties are saved and the new sub-block has
193*9880d681SAndroid Build Coastguard Workerits own set of abbreviations, and its own abbrev id width.  When a sub-block is
194*9880d681SAndroid Build Coastguard Workerpopped, the saved values are restored.
195*9880d681SAndroid Build Coastguard Worker
196*9880d681SAndroid Build Coastguard Worker.. _ENTER_SUBBLOCK:
197*9880d681SAndroid Build Coastguard Worker
198*9880d681SAndroid Build Coastguard WorkerENTER_SUBBLOCK Encoding
199*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^
200*9880d681SAndroid Build Coastguard Worker
201*9880d681SAndroid Build Coastguard Worker:raw-html:`<tt>`
202*9880d681SAndroid Build Coastguard Worker[ENTER_SUBBLOCK, blockid\ :sub:`vbr8`, newabbrevlen\ :sub:`vbr4`, <align32bits>, blocklen_32]
203*9880d681SAndroid Build Coastguard Worker:raw-html:`</tt>`
204*9880d681SAndroid Build Coastguard Worker
205*9880d681SAndroid Build Coastguard WorkerThe ``ENTER_SUBBLOCK`` abbreviation ID specifies the start of a new block
206*9880d681SAndroid Build Coastguard Workerrecord.  The ``blockid`` value is encoded as an 8-bit VBR identifier, and
207*9880d681SAndroid Build Coastguard Workerindicates the type of block being entered, which can be a `standard block`_ or
208*9880d681SAndroid Build Coastguard Workeran application-specific block.  The ``newabbrevlen`` value is a 4-bit VBR, which
209*9880d681SAndroid Build Coastguard Workerspecifies the abbrev id width for the sub-block.  The ``blocklen`` value is a
210*9880d681SAndroid Build Coastguard Worker32-bit aligned value that specifies the size of the subblock in 32-bit
211*9880d681SAndroid Build Coastguard Workerwords. This value allows the reader to skip over the entire block in one jump.
212*9880d681SAndroid Build Coastguard Worker
213*9880d681SAndroid Build Coastguard Worker.. _END_BLOCK:
214*9880d681SAndroid Build Coastguard Worker
215*9880d681SAndroid Build Coastguard WorkerEND_BLOCK Encoding
216*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^
217*9880d681SAndroid Build Coastguard Worker
218*9880d681SAndroid Build Coastguard Worker``[END_BLOCK, <align32bits>]``
219*9880d681SAndroid Build Coastguard Worker
220*9880d681SAndroid Build Coastguard WorkerThe ``END_BLOCK`` abbreviation ID specifies the end of the current block record.
221*9880d681SAndroid Build Coastguard WorkerIts end is aligned to 32-bits to ensure that the size of the block is an even
222*9880d681SAndroid Build Coastguard Workermultiple of 32-bits.
223*9880d681SAndroid Build Coastguard Worker
224*9880d681SAndroid Build Coastguard Worker.. _Data Records:
225*9880d681SAndroid Build Coastguard Worker
226*9880d681SAndroid Build Coastguard WorkerData Records
227*9880d681SAndroid Build Coastguard Worker------------
228*9880d681SAndroid Build Coastguard Worker
229*9880d681SAndroid Build Coastguard WorkerData records consist of a record code and a number of (up to) 64-bit integer
230*9880d681SAndroid Build Coastguard Workervalues.  The interpretation of the code and values is application specific and
231*9880d681SAndroid Build Coastguard Workermay vary between different block types.  Records can be encoded either using an
232*9880d681SAndroid Build Coastguard Workerunabbrev record, or with an abbreviation.  In the LLVM IR format, for example,
233*9880d681SAndroid Build Coastguard Workerthere is a record which encodes the target triple of a module.  The code is
234*9880d681SAndroid Build Coastguard Worker``MODULE_CODE_TRIPLE``, and the values of the record are the ASCII codes for the
235*9880d681SAndroid Build Coastguard Workercharacters in the string.
236*9880d681SAndroid Build Coastguard Worker
237*9880d681SAndroid Build Coastguard Worker.. _UNABBREV_RECORD:
238*9880d681SAndroid Build Coastguard Worker
239*9880d681SAndroid Build Coastguard WorkerUNABBREV_RECORD Encoding
240*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^
241*9880d681SAndroid Build Coastguard Worker
242*9880d681SAndroid Build Coastguard Worker:raw-html:`<tt>`
243*9880d681SAndroid Build Coastguard Worker[UNABBREV_RECORD, code\ :sub:`vbr6`, numops\ :sub:`vbr6`, op0\ :sub:`vbr6`, op1\ :sub:`vbr6`, ...]
244*9880d681SAndroid Build Coastguard Worker:raw-html:`</tt>`
245*9880d681SAndroid Build Coastguard Worker
246*9880d681SAndroid Build Coastguard WorkerAn ``UNABBREV_RECORD`` provides a default fallback encoding, which is both
247*9880d681SAndroid Build Coastguard Workercompletely general and extremely inefficient.  It can describe an arbitrary
248*9880d681SAndroid Build Coastguard Workerrecord by emitting the code and operands as VBRs.
249*9880d681SAndroid Build Coastguard Worker
250*9880d681SAndroid Build Coastguard WorkerFor example, emitting an LLVM IR target triple as an unabbreviated record
251*9880d681SAndroid Build Coastguard Workerrequires emitting the ``UNABBREV_RECORD`` abbrevid, a vbr6 for the
252*9880d681SAndroid Build Coastguard Worker``MODULE_CODE_TRIPLE`` code, a vbr6 for the length of the string, which is equal
253*9880d681SAndroid Build Coastguard Workerto the number of operands, and a vbr6 for each character.  Because there are no
254*9880d681SAndroid Build Coastguard Workerletters with values less than 32, each letter would need to be emitted as at
255*9880d681SAndroid Build Coastguard Workerleast a two-part VBR, which means that each letter would require at least 12
256*9880d681SAndroid Build Coastguard Workerbits.  This is not an efficient encoding, but it is fully general.
257*9880d681SAndroid Build Coastguard Worker
258*9880d681SAndroid Build Coastguard Worker.. _abbreviated record encoding:
259*9880d681SAndroid Build Coastguard Worker
260*9880d681SAndroid Build Coastguard WorkerAbbreviated Record Encoding
261*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^^
262*9880d681SAndroid Build Coastguard Worker
263*9880d681SAndroid Build Coastguard Worker``[<abbrevid>, fields...]``
264*9880d681SAndroid Build Coastguard Worker
265*9880d681SAndroid Build Coastguard WorkerAn abbreviated record is a abbreviation id followed by a set of fields that are
266*9880d681SAndroid Build Coastguard Workerencoded according to the `abbreviation definition`_.  This allows records to be
267*9880d681SAndroid Build Coastguard Workerencoded significantly more densely than records encoded with the
268*9880d681SAndroid Build Coastguard Worker`UNABBREV_RECORD`_ type, and allows the abbreviation types to be specified in
269*9880d681SAndroid Build Coastguard Workerthe stream itself, which allows the files to be completely self describing.  The
270*9880d681SAndroid Build Coastguard Workeractual encoding of abbreviations is defined below.
271*9880d681SAndroid Build Coastguard Worker
272*9880d681SAndroid Build Coastguard WorkerThe record code, which is the first field of an abbreviated record, may be
273*9880d681SAndroid Build Coastguard Workerencoded in the abbreviation definition (as a literal operand) or supplied in the
274*9880d681SAndroid Build Coastguard Workerabbreviated record (as a Fixed or VBR operand value).
275*9880d681SAndroid Build Coastguard Worker
276*9880d681SAndroid Build Coastguard Worker.. _abbreviation definition:
277*9880d681SAndroid Build Coastguard Worker
278*9880d681SAndroid Build Coastguard WorkerAbbreviations
279*9880d681SAndroid Build Coastguard Worker-------------
280*9880d681SAndroid Build Coastguard Worker
281*9880d681SAndroid Build Coastguard WorkerAbbreviations are an important form of compression for bitstreams.  The idea is
282*9880d681SAndroid Build Coastguard Workerto specify a dense encoding for a class of records once, then use that encoding
283*9880d681SAndroid Build Coastguard Workerto emit many records.  It takes space to emit the encoding into the file, but
284*9880d681SAndroid Build Coastguard Workerthe space is recouped (hopefully plus some) when the records that use it are
285*9880d681SAndroid Build Coastguard Workeremitted.
286*9880d681SAndroid Build Coastguard Worker
287*9880d681SAndroid Build Coastguard WorkerAbbreviations can be determined dynamically per client, per file. Because the
288*9880d681SAndroid Build Coastguard Workerabbreviations are stored in the bitstream itself, different streams of the same
289*9880d681SAndroid Build Coastguard Workerformat can contain different sets of abbreviations according to the needs of the
290*9880d681SAndroid Build Coastguard Workerspecific stream.  As a concrete example, LLVM IR files usually emit an
291*9880d681SAndroid Build Coastguard Workerabbreviation for binary operators.  If a specific LLVM module contained no or
292*9880d681SAndroid Build Coastguard Workerfew binary operators, the abbreviation does not need to be emitted.
293*9880d681SAndroid Build Coastguard Worker
294*9880d681SAndroid Build Coastguard Worker.. _DEFINE_ABBREV:
295*9880d681SAndroid Build Coastguard Worker
296*9880d681SAndroid Build Coastguard WorkerDEFINE_ABBREV Encoding
297*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^
298*9880d681SAndroid Build Coastguard Worker
299*9880d681SAndroid Build Coastguard Worker:raw-html:`<tt>`
300*9880d681SAndroid Build Coastguard Worker[DEFINE_ABBREV, numabbrevops\ :sub:`vbr5`, abbrevop0, abbrevop1, ...]
301*9880d681SAndroid Build Coastguard Worker:raw-html:`</tt>`
302*9880d681SAndroid Build Coastguard Worker
303*9880d681SAndroid Build Coastguard WorkerA ``DEFINE_ABBREV`` record adds an abbreviation to the list of currently defined
304*9880d681SAndroid Build Coastguard Workerabbreviations in the scope of this block.  This definition only exists inside
305*9880d681SAndroid Build Coastguard Workerthis immediate block --- it is not visible in subblocks or enclosing blocks.
306*9880d681SAndroid Build Coastguard WorkerAbbreviations are implicitly assigned IDs sequentially starting from 4 (the
307*9880d681SAndroid Build Coastguard Workerfirst application-defined abbreviation ID).  Any abbreviations defined in a
308*9880d681SAndroid Build Coastguard Worker``BLOCKINFO`` record for the particular block type receive IDs first, in order,
309*9880d681SAndroid Build Coastguard Workerfollowed by any abbreviations defined within the block itself.  Abbreviated data
310*9880d681SAndroid Build Coastguard Workerrecords reference this ID to indicate what abbreviation they are invoking.
311*9880d681SAndroid Build Coastguard Worker
312*9880d681SAndroid Build Coastguard WorkerAn abbreviation definition consists of the ``DEFINE_ABBREV`` abbrevid followed
313*9880d681SAndroid Build Coastguard Workerby a VBR that specifies the number of abbrev operands, then the abbrev operands
314*9880d681SAndroid Build Coastguard Workerthemselves.  Abbreviation operands come in three forms.  They all start with a
315*9880d681SAndroid Build Coastguard Workersingle bit that indicates whether the abbrev operand is a literal operand (when
316*9880d681SAndroid Build Coastguard Workerthe bit is 1) or an encoding operand (when the bit is 0).
317*9880d681SAndroid Build Coastguard Worker
318*9880d681SAndroid Build Coastguard Worker#. Literal operands --- :raw-html:`<tt>` [1\ :sub:`1`, litvalue\
319*9880d681SAndroid Build Coastguard Worker   :sub:`vbr8`] :raw-html:`</tt>` --- Literal operands specify that the value in
320*9880d681SAndroid Build Coastguard Worker   the result is always a single specific value.  This specific value is emitted
321*9880d681SAndroid Build Coastguard Worker   as a vbr8 after the bit indicating that it is a literal operand.
322*9880d681SAndroid Build Coastguard Worker
323*9880d681SAndroid Build Coastguard Worker#. Encoding info without data --- :raw-html:`<tt>` [0\ :sub:`1`, encoding\
324*9880d681SAndroid Build Coastguard Worker   :sub:`3`] :raw-html:`</tt>` --- Operand encodings that do not have extra data
325*9880d681SAndroid Build Coastguard Worker   are just emitted as their code.
326*9880d681SAndroid Build Coastguard Worker
327*9880d681SAndroid Build Coastguard Worker#. Encoding info with data --- :raw-html:`<tt>` [0\ :sub:`1`, encoding\
328*9880d681SAndroid Build Coastguard Worker   :sub:`3`, value\ :sub:`vbr5`] :raw-html:`</tt>` --- Operand encodings that do
329*9880d681SAndroid Build Coastguard Worker   have extra data are emitted as their code, followed by the extra data.
330*9880d681SAndroid Build Coastguard Worker
331*9880d681SAndroid Build Coastguard WorkerThe possible operand encodings are:
332*9880d681SAndroid Build Coastguard Worker
333*9880d681SAndroid Build Coastguard Worker* Fixed (code 1): The field should be emitted as a `fixed-width value`_, whose
334*9880d681SAndroid Build Coastguard Worker  width is specified by the operand's extra data.
335*9880d681SAndroid Build Coastguard Worker
336*9880d681SAndroid Build Coastguard Worker* VBR (code 2): The field should be emitted as a `variable-width value`_, whose
337*9880d681SAndroid Build Coastguard Worker  width is specified by the operand's extra data.
338*9880d681SAndroid Build Coastguard Worker
339*9880d681SAndroid Build Coastguard Worker* Array (code 3): This field is an array of values.  The array operand has no
340*9880d681SAndroid Build Coastguard Worker  extra data, but expects another operand to follow it, indicating the element
341*9880d681SAndroid Build Coastguard Worker  type of the array.  When reading an array in an abbreviated record, the first
342*9880d681SAndroid Build Coastguard Worker  integer is a vbr6 that indicates the array length, followed by the encoded
343*9880d681SAndroid Build Coastguard Worker  elements of the array.  An array may only occur as the last operand of an
344*9880d681SAndroid Build Coastguard Worker  abbreviation (except for the one final operand that gives the array's
345*9880d681SAndroid Build Coastguard Worker  type).
346*9880d681SAndroid Build Coastguard Worker
347*9880d681SAndroid Build Coastguard Worker* Char6 (code 4): This field should be emitted as a `char6-encoded value`_.
348*9880d681SAndroid Build Coastguard Worker  This operand type takes no extra data. Char6 encoding is normally used as an
349*9880d681SAndroid Build Coastguard Worker  array element type.
350*9880d681SAndroid Build Coastguard Worker
351*9880d681SAndroid Build Coastguard Worker* Blob (code 5): This field is emitted as a vbr6, followed by padding to a
352*9880d681SAndroid Build Coastguard Worker  32-bit boundary (for alignment) and an array of 8-bit objects.  The array of
353*9880d681SAndroid Build Coastguard Worker  bytes is further followed by tail padding to ensure that its total length is a
354*9880d681SAndroid Build Coastguard Worker  multiple of 4 bytes.  This makes it very efficient for the reader to decode
355*9880d681SAndroid Build Coastguard Worker  the data without having to make a copy of it: it can use a pointer to the data
356*9880d681SAndroid Build Coastguard Worker  in the mapped in file and poke directly at it.  A blob may only occur as the
357*9880d681SAndroid Build Coastguard Worker  last operand of an abbreviation.
358*9880d681SAndroid Build Coastguard Worker
359*9880d681SAndroid Build Coastguard WorkerFor example, target triples in LLVM modules are encoded as a record of the form
360*9880d681SAndroid Build Coastguard Worker``[TRIPLE, 'a', 'b', 'c', 'd']``.  Consider if the bitstream emitted the
361*9880d681SAndroid Build Coastguard Workerfollowing abbrev entry:
362*9880d681SAndroid Build Coastguard Worker
363*9880d681SAndroid Build Coastguard Worker::
364*9880d681SAndroid Build Coastguard Worker
365*9880d681SAndroid Build Coastguard Worker  [0, Fixed, 4]
366*9880d681SAndroid Build Coastguard Worker  [0, Array]
367*9880d681SAndroid Build Coastguard Worker  [0, Char6]
368*9880d681SAndroid Build Coastguard Worker
369*9880d681SAndroid Build Coastguard WorkerWhen emitting a record with this abbreviation, the above entry would be emitted
370*9880d681SAndroid Build Coastguard Workeras:
371*9880d681SAndroid Build Coastguard Worker
372*9880d681SAndroid Build Coastguard Worker:raw-html:`<tt><blockquote>`
373*9880d681SAndroid Build Coastguard Worker[4\ :sub:`abbrevwidth`, 2\ :sub:`4`, 4\ :sub:`vbr6`, 0\ :sub:`6`, 1\ :sub:`6`, 2\ :sub:`6`, 3\ :sub:`6`]
374*9880d681SAndroid Build Coastguard Worker:raw-html:`</blockquote></tt>`
375*9880d681SAndroid Build Coastguard Worker
376*9880d681SAndroid Build Coastguard WorkerThese values are:
377*9880d681SAndroid Build Coastguard Worker
378*9880d681SAndroid Build Coastguard Worker#. The first value, 4, is the abbreviation ID for this abbreviation.
379*9880d681SAndroid Build Coastguard Worker
380*9880d681SAndroid Build Coastguard Worker#. The second value, 2, is the record code for ``TRIPLE`` records within LLVM IR
381*9880d681SAndroid Build Coastguard Worker   file ``MODULE_BLOCK`` blocks.
382*9880d681SAndroid Build Coastguard Worker
383*9880d681SAndroid Build Coastguard Worker#. The third value, 4, is the length of the array.
384*9880d681SAndroid Build Coastguard Worker
385*9880d681SAndroid Build Coastguard Worker#. The rest of the values are the char6 encoded values for ``"abcd"``.
386*9880d681SAndroid Build Coastguard Worker
387*9880d681SAndroid Build Coastguard WorkerWith this abbreviation, the triple is emitted with only 37 bits (assuming a
388*9880d681SAndroid Build Coastguard Workerabbrev id width of 3).  Without the abbreviation, significantly more space would
389*9880d681SAndroid Build Coastguard Workerbe required to emit the target triple.  Also, because the ``TRIPLE`` value is
390*9880d681SAndroid Build Coastguard Workernot emitted as a literal in the abbreviation, the abbreviation can also be used
391*9880d681SAndroid Build Coastguard Workerfor any other string value.
392*9880d681SAndroid Build Coastguard Worker
393*9880d681SAndroid Build Coastguard Worker.. _standard blocks:
394*9880d681SAndroid Build Coastguard Worker.. _standard block:
395*9880d681SAndroid Build Coastguard Worker
396*9880d681SAndroid Build Coastguard WorkerStandard Blocks
397*9880d681SAndroid Build Coastguard Worker---------------
398*9880d681SAndroid Build Coastguard Worker
399*9880d681SAndroid Build Coastguard WorkerIn addition to the basic block structure and record encodings, the bitstream
400*9880d681SAndroid Build Coastguard Workeralso defines specific built-in block types.  These block types specify how the
401*9880d681SAndroid Build Coastguard Workerstream is to be decoded or other metadata.  In the future, new standard blocks
402*9880d681SAndroid Build Coastguard Workermay be added.  Block IDs 0-7 are reserved for standard blocks.
403*9880d681SAndroid Build Coastguard Worker
404*9880d681SAndroid Build Coastguard Worker.. _BLOCKINFO:
405*9880d681SAndroid Build Coastguard Worker
406*9880d681SAndroid Build Coastguard Worker#0 - BLOCKINFO Block
407*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^
408*9880d681SAndroid Build Coastguard Worker
409*9880d681SAndroid Build Coastguard WorkerThe ``BLOCKINFO`` block allows the description of metadata for other blocks.
410*9880d681SAndroid Build Coastguard WorkerThe currently specified records are:
411*9880d681SAndroid Build Coastguard Worker
412*9880d681SAndroid Build Coastguard Worker::
413*9880d681SAndroid Build Coastguard Worker
414*9880d681SAndroid Build Coastguard Worker  [SETBID (#1), blockid]
415*9880d681SAndroid Build Coastguard Worker  [DEFINE_ABBREV, ...]
416*9880d681SAndroid Build Coastguard Worker  [BLOCKNAME, ...name...]
417*9880d681SAndroid Build Coastguard Worker  [SETRECORDNAME, RecordID, ...name...]
418*9880d681SAndroid Build Coastguard Worker
419*9880d681SAndroid Build Coastguard WorkerThe ``SETBID`` record (code 1) indicates which block ID is being described.
420*9880d681SAndroid Build Coastguard Worker``SETBID`` records can occur multiple times throughout the block to change which
421*9880d681SAndroid Build Coastguard Workerblock ID is being described.  There must be a ``SETBID`` record prior to any
422*9880d681SAndroid Build Coastguard Workerother records.
423*9880d681SAndroid Build Coastguard Worker
424*9880d681SAndroid Build Coastguard WorkerStandard ``DEFINE_ABBREV`` records can occur inside ``BLOCKINFO`` blocks, but
425*9880d681SAndroid Build Coastguard Workerunlike their occurrence in normal blocks, the abbreviation is defined for blocks
426*9880d681SAndroid Build Coastguard Workermatching the block ID we are describing, *not* the ``BLOCKINFO`` block
427*9880d681SAndroid Build Coastguard Workeritself.  The abbreviations defined in ``BLOCKINFO`` blocks receive abbreviation
428*9880d681SAndroid Build Coastguard WorkerIDs as described in `DEFINE_ABBREV`_.
429*9880d681SAndroid Build Coastguard Worker
430*9880d681SAndroid Build Coastguard WorkerThe ``BLOCKNAME`` record (code 2) can optionally occur in this block.  The
431*9880d681SAndroid Build Coastguard Workerelements of the record are the bytes of the string name of the block.
432*9880d681SAndroid Build Coastguard Workerllvm-bcanalyzer can use this to dump out bitcode files symbolically.
433*9880d681SAndroid Build Coastguard Worker
434*9880d681SAndroid Build Coastguard WorkerThe ``SETRECORDNAME`` record (code 3) can also optionally occur in this block.
435*9880d681SAndroid Build Coastguard WorkerThe first operand value is a record ID number, and the rest of the elements of
436*9880d681SAndroid Build Coastguard Workerthe record are the bytes for the string name of the record.  llvm-bcanalyzer can
437*9880d681SAndroid Build Coastguard Workeruse this to dump out bitcode files symbolically.
438*9880d681SAndroid Build Coastguard Worker
439*9880d681SAndroid Build Coastguard WorkerNote that although the data in ``BLOCKINFO`` blocks is described as "metadata,"
440*9880d681SAndroid Build Coastguard Workerthe abbreviations they contain are essential for parsing records from the
441*9880d681SAndroid Build Coastguard Workercorresponding blocks.  It is not safe to skip them.
442*9880d681SAndroid Build Coastguard Worker
443*9880d681SAndroid Build Coastguard Worker.. _wrapper:
444*9880d681SAndroid Build Coastguard Worker
445*9880d681SAndroid Build Coastguard WorkerBitcode Wrapper Format
446*9880d681SAndroid Build Coastguard Worker======================
447*9880d681SAndroid Build Coastguard Worker
448*9880d681SAndroid Build Coastguard WorkerBitcode files for LLVM IR may optionally be wrapped in a simple wrapper
449*9880d681SAndroid Build Coastguard Workerstructure.  This structure contains a simple header that indicates the offset
450*9880d681SAndroid Build Coastguard Workerand size of the embedded BC file.  This allows additional information to be
451*9880d681SAndroid Build Coastguard Workerstored alongside the BC file.  The structure of this file header is:
452*9880d681SAndroid Build Coastguard Worker
453*9880d681SAndroid Build Coastguard Worker:raw-html:`<tt><blockquote>`
454*9880d681SAndroid Build Coastguard Worker[Magic\ :sub:`32`, Version\ :sub:`32`, Offset\ :sub:`32`, Size\ :sub:`32`, CPUType\ :sub:`32`]
455*9880d681SAndroid Build Coastguard Worker:raw-html:`</blockquote></tt>`
456*9880d681SAndroid Build Coastguard Worker
457*9880d681SAndroid Build Coastguard WorkerEach of the fields are 32-bit fields stored in little endian form (as with the
458*9880d681SAndroid Build Coastguard Workerrest of the bitcode file fields).  The Magic number is always ``0x0B17C0DE`` and
459*9880d681SAndroid Build Coastguard Workerthe version is currently always ``0``.  The Offset field is the offset in bytes
460*9880d681SAndroid Build Coastguard Workerto the start of the bitcode stream in the file, and the Size field is the size
461*9880d681SAndroid Build Coastguard Workerin bytes of the stream. CPUType is a target-specific value that can be used to
462*9880d681SAndroid Build Coastguard Workerencode the CPU of the target.
463*9880d681SAndroid Build Coastguard Worker
464*9880d681SAndroid Build Coastguard Worker.. _native object file:
465*9880d681SAndroid Build Coastguard Worker
466*9880d681SAndroid Build Coastguard WorkerNative Object File Wrapper Format
467*9880d681SAndroid Build Coastguard Worker=================================
468*9880d681SAndroid Build Coastguard Worker
469*9880d681SAndroid Build Coastguard WorkerBitcode files for LLVM IR may also be wrapped in a native object file
470*9880d681SAndroid Build Coastguard Worker(i.e. ELF, COFF, Mach-O).  The bitcode must be stored in a section of the object
471*9880d681SAndroid Build Coastguard Workerfile named ``__LLVM,__bitcode`` for MachO and ``.llvmbc`` for the other object
472*9880d681SAndroid Build Coastguard Workerformats.  This wrapper format is useful for accommodating LTO in compilation
473*9880d681SAndroid Build Coastguard Workerpipelines where intermediate objects must be native object files which contain
474*9880d681SAndroid Build Coastguard Workermetadata in other sections.
475*9880d681SAndroid Build Coastguard Worker
476*9880d681SAndroid Build Coastguard WorkerNot all tools support this format.
477*9880d681SAndroid Build Coastguard Worker
478*9880d681SAndroid Build Coastguard Worker.. _encoding of LLVM IR:
479*9880d681SAndroid Build Coastguard Worker
480*9880d681SAndroid Build Coastguard WorkerLLVM IR Encoding
481*9880d681SAndroid Build Coastguard Worker================
482*9880d681SAndroid Build Coastguard Worker
483*9880d681SAndroid Build Coastguard WorkerLLVM IR is encoded into a bitstream by defining blocks and records.  It uses
484*9880d681SAndroid Build Coastguard Workerblocks for things like constant pools, functions, symbol tables, etc.  It uses
485*9880d681SAndroid Build Coastguard Workerrecords for things like instructions, global variable descriptors, type
486*9880d681SAndroid Build Coastguard Workerdescriptions, etc.  This document does not describe the set of abbreviations
487*9880d681SAndroid Build Coastguard Workerthat the writer uses, as these are fully self-described in the file, and the
488*9880d681SAndroid Build Coastguard Workerreader is not allowed to build in any knowledge of this.
489*9880d681SAndroid Build Coastguard Worker
490*9880d681SAndroid Build Coastguard WorkerBasics
491*9880d681SAndroid Build Coastguard Worker------
492*9880d681SAndroid Build Coastguard Worker
493*9880d681SAndroid Build Coastguard WorkerLLVM IR Magic Number
494*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^
495*9880d681SAndroid Build Coastguard Worker
496*9880d681SAndroid Build Coastguard WorkerThe magic number for LLVM IR files is:
497*9880d681SAndroid Build Coastguard Worker
498*9880d681SAndroid Build Coastguard Worker:raw-html:`<tt><blockquote>`
499*9880d681SAndroid Build Coastguard Worker[0x0\ :sub:`4`, 0xC\ :sub:`4`, 0xE\ :sub:`4`, 0xD\ :sub:`4`]
500*9880d681SAndroid Build Coastguard Worker:raw-html:`</blockquote></tt>`
501*9880d681SAndroid Build Coastguard Worker
502*9880d681SAndroid Build Coastguard WorkerWhen combined with the bitcode magic number and viewed as bytes, this is
503*9880d681SAndroid Build Coastguard Worker``"BC 0xC0DE"``.
504*9880d681SAndroid Build Coastguard Worker
505*9880d681SAndroid Build Coastguard Worker.. _Signed VBRs:
506*9880d681SAndroid Build Coastguard Worker
507*9880d681SAndroid Build Coastguard WorkerSigned VBRs
508*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^
509*9880d681SAndroid Build Coastguard Worker
510*9880d681SAndroid Build Coastguard Worker`Variable Width Integer`_ encoding is an efficient way to encode arbitrary sized
511*9880d681SAndroid Build Coastguard Workerunsigned values, but is an extremely inefficient for encoding signed values, as
512*9880d681SAndroid Build Coastguard Workersigned values are otherwise treated as maximally large unsigned values.
513*9880d681SAndroid Build Coastguard Worker
514*9880d681SAndroid Build Coastguard WorkerAs such, signed VBR values of a specific width are emitted as follows:
515*9880d681SAndroid Build Coastguard Worker
516*9880d681SAndroid Build Coastguard Worker* Positive values are emitted as VBRs of the specified width, but with their
517*9880d681SAndroid Build Coastguard Worker  value shifted left by one.
518*9880d681SAndroid Build Coastguard Worker
519*9880d681SAndroid Build Coastguard Worker* Negative values are emitted as VBRs of the specified width, but the negated
520*9880d681SAndroid Build Coastguard Worker  value is shifted left by one, and the low bit is set.
521*9880d681SAndroid Build Coastguard Worker
522*9880d681SAndroid Build Coastguard WorkerWith this encoding, small positive and small negative values can both be emitted
523*9880d681SAndroid Build Coastguard Workerefficiently. Signed VBR encoding is used in ``CST_CODE_INTEGER`` and
524*9880d681SAndroid Build Coastguard Worker``CST_CODE_WIDE_INTEGER`` records within ``CONSTANTS_BLOCK`` blocks.
525*9880d681SAndroid Build Coastguard WorkerIt is also used for phi instruction operands in `MODULE_CODE_VERSION`_ 1.
526*9880d681SAndroid Build Coastguard Worker
527*9880d681SAndroid Build Coastguard WorkerLLVM IR Blocks
528*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^
529*9880d681SAndroid Build Coastguard Worker
530*9880d681SAndroid Build Coastguard WorkerLLVM IR is defined with the following blocks:
531*9880d681SAndroid Build Coastguard Worker
532*9880d681SAndroid Build Coastguard Worker* 8 --- `MODULE_BLOCK`_ --- This is the top-level block that contains the entire
533*9880d681SAndroid Build Coastguard Worker  module, and describes a variety of per-module information.
534*9880d681SAndroid Build Coastguard Worker
535*9880d681SAndroid Build Coastguard Worker* 9 --- `PARAMATTR_BLOCK`_ --- This enumerates the parameter attributes.
536*9880d681SAndroid Build Coastguard Worker
537*9880d681SAndroid Build Coastguard Worker* 10 --- `TYPE_BLOCK`_ --- This describes all of the types in the module.
538*9880d681SAndroid Build Coastguard Worker
539*9880d681SAndroid Build Coastguard Worker* 11 --- `CONSTANTS_BLOCK`_ --- This describes constants for a module or
540*9880d681SAndroid Build Coastguard Worker  function.
541*9880d681SAndroid Build Coastguard Worker
542*9880d681SAndroid Build Coastguard Worker* 12 --- `FUNCTION_BLOCK`_ --- This describes a function body.
543*9880d681SAndroid Build Coastguard Worker
544*9880d681SAndroid Build Coastguard Worker* 13 --- `TYPE_SYMTAB_BLOCK`_ --- This describes the type symbol table.
545*9880d681SAndroid Build Coastguard Worker
546*9880d681SAndroid Build Coastguard Worker* 14 --- `VALUE_SYMTAB_BLOCK`_ --- This describes a value symbol table.
547*9880d681SAndroid Build Coastguard Worker
548*9880d681SAndroid Build Coastguard Worker* 15 --- `METADATA_BLOCK`_ --- This describes metadata items.
549*9880d681SAndroid Build Coastguard Worker
550*9880d681SAndroid Build Coastguard Worker* 16 --- `METADATA_ATTACHMENT`_ --- This contains records associating metadata
551*9880d681SAndroid Build Coastguard Worker  with function instruction values.
552*9880d681SAndroid Build Coastguard Worker
553*9880d681SAndroid Build Coastguard Worker.. _MODULE_BLOCK:
554*9880d681SAndroid Build Coastguard Worker
555*9880d681SAndroid Build Coastguard WorkerMODULE_BLOCK Contents
556*9880d681SAndroid Build Coastguard Worker---------------------
557*9880d681SAndroid Build Coastguard Worker
558*9880d681SAndroid Build Coastguard WorkerThe ``MODULE_BLOCK`` block (id 8) is the top-level block for LLVM bitcode files,
559*9880d681SAndroid Build Coastguard Workerand each bitcode file must contain exactly one. In addition to records
560*9880d681SAndroid Build Coastguard Worker(described below) containing information about the module, a ``MODULE_BLOCK``
561*9880d681SAndroid Build Coastguard Workerblock may contain the following sub-blocks:
562*9880d681SAndroid Build Coastguard Worker
563*9880d681SAndroid Build Coastguard Worker* `BLOCKINFO`_
564*9880d681SAndroid Build Coastguard Worker* `PARAMATTR_BLOCK`_
565*9880d681SAndroid Build Coastguard Worker* `TYPE_BLOCK`_
566*9880d681SAndroid Build Coastguard Worker* `TYPE_SYMTAB_BLOCK`_
567*9880d681SAndroid Build Coastguard Worker* `VALUE_SYMTAB_BLOCK`_
568*9880d681SAndroid Build Coastguard Worker* `CONSTANTS_BLOCK`_
569*9880d681SAndroid Build Coastguard Worker* `FUNCTION_BLOCK`_
570*9880d681SAndroid Build Coastguard Worker* `METADATA_BLOCK`_
571*9880d681SAndroid Build Coastguard Worker
572*9880d681SAndroid Build Coastguard Worker.. _MODULE_CODE_VERSION:
573*9880d681SAndroid Build Coastguard Worker
574*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_VERSION Record
575*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^
576*9880d681SAndroid Build Coastguard Worker
577*9880d681SAndroid Build Coastguard Worker``[VERSION, version#]``
578*9880d681SAndroid Build Coastguard Worker
579*9880d681SAndroid Build Coastguard WorkerThe ``VERSION`` record (code 1) contains a single value indicating the format
580*9880d681SAndroid Build Coastguard Workerversion. Versions 0 and 1 are supported at this time. The difference between
581*9880d681SAndroid Build Coastguard Workerversion 0 and 1 is in the encoding of instruction operands in
582*9880d681SAndroid Build Coastguard Workereach `FUNCTION_BLOCK`_.
583*9880d681SAndroid Build Coastguard Worker
584*9880d681SAndroid Build Coastguard WorkerIn version 0, each value defined by an instruction is assigned an ID
585*9880d681SAndroid Build Coastguard Workerunique to the function. Function-level value IDs are assigned starting from
586*9880d681SAndroid Build Coastguard Worker``NumModuleValues`` since they share the same namespace as module-level
587*9880d681SAndroid Build Coastguard Workervalues. The value enumerator resets after each function. When a value is
588*9880d681SAndroid Build Coastguard Workeran operand of an instruction, the value ID is used to represent the operand.
589*9880d681SAndroid Build Coastguard WorkerFor large functions or large modules, these operand values can be large.
590*9880d681SAndroid Build Coastguard Worker
591*9880d681SAndroid Build Coastguard WorkerThe encoding in version 1 attempts to avoid large operand values
592*9880d681SAndroid Build Coastguard Workerin common cases. Instead of using the value ID directly, operands are
593*9880d681SAndroid Build Coastguard Workerencoded as relative to the current instruction. Thus, if an operand
594*9880d681SAndroid Build Coastguard Workeris the value defined by the previous instruction, the operand
595*9880d681SAndroid Build Coastguard Workerwill be encoded as 1.
596*9880d681SAndroid Build Coastguard Worker
597*9880d681SAndroid Build Coastguard WorkerFor example, instead of
598*9880d681SAndroid Build Coastguard Worker
599*9880d681SAndroid Build Coastguard Worker.. code-block:: llvm
600*9880d681SAndroid Build Coastguard Worker
601*9880d681SAndroid Build Coastguard Worker  #n = load #n-1
602*9880d681SAndroid Build Coastguard Worker  #n+1 = icmp eq #n, #const0
603*9880d681SAndroid Build Coastguard Worker  br #n+1, label #(bb1), label #(bb2)
604*9880d681SAndroid Build Coastguard Worker
605*9880d681SAndroid Build Coastguard Workerversion 1 will encode the instructions as
606*9880d681SAndroid Build Coastguard Worker
607*9880d681SAndroid Build Coastguard Worker.. code-block:: llvm
608*9880d681SAndroid Build Coastguard Worker
609*9880d681SAndroid Build Coastguard Worker  #n = load #1
610*9880d681SAndroid Build Coastguard Worker  #n+1 = icmp eq #1, (#n+1)-#const0
611*9880d681SAndroid Build Coastguard Worker  br #1, label #(bb1), label #(bb2)
612*9880d681SAndroid Build Coastguard Worker
613*9880d681SAndroid Build Coastguard WorkerNote in the example that operands which are constants also use
614*9880d681SAndroid Build Coastguard Workerthe relative encoding, while operands like basic block labels
615*9880d681SAndroid Build Coastguard Workerdo not use the relative encoding.
616*9880d681SAndroid Build Coastguard Worker
617*9880d681SAndroid Build Coastguard WorkerForward references will result in a negative value.
618*9880d681SAndroid Build Coastguard WorkerThis can be inefficient, as operands are normally encoded
619*9880d681SAndroid Build Coastguard Workeras unsigned VBRs. However, forward references are rare, except in the
620*9880d681SAndroid Build Coastguard Workercase of phi instructions. For phi instructions, operands are encoded as
621*9880d681SAndroid Build Coastguard Worker`Signed VBRs`_ to deal with forward references.
622*9880d681SAndroid Build Coastguard Worker
623*9880d681SAndroid Build Coastguard Worker
624*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_TRIPLE Record
625*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^
626*9880d681SAndroid Build Coastguard Worker
627*9880d681SAndroid Build Coastguard Worker``[TRIPLE, ...string...]``
628*9880d681SAndroid Build Coastguard Worker
629*9880d681SAndroid Build Coastguard WorkerThe ``TRIPLE`` record (code 2) contains a variable number of values representing
630*9880d681SAndroid Build Coastguard Workerthe bytes of the ``target triple`` specification string.
631*9880d681SAndroid Build Coastguard Worker
632*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_DATALAYOUT Record
633*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
634*9880d681SAndroid Build Coastguard Worker
635*9880d681SAndroid Build Coastguard Worker``[DATALAYOUT, ...string...]``
636*9880d681SAndroid Build Coastguard Worker
637*9880d681SAndroid Build Coastguard WorkerThe ``DATALAYOUT`` record (code 3) contains a variable number of values
638*9880d681SAndroid Build Coastguard Workerrepresenting the bytes of the ``target datalayout`` specification string.
639*9880d681SAndroid Build Coastguard Worker
640*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_ASM Record
641*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^
642*9880d681SAndroid Build Coastguard Worker
643*9880d681SAndroid Build Coastguard Worker``[ASM, ...string...]``
644*9880d681SAndroid Build Coastguard Worker
645*9880d681SAndroid Build Coastguard WorkerThe ``ASM`` record (code 4) contains a variable number of values representing
646*9880d681SAndroid Build Coastguard Workerthe bytes of ``module asm`` strings, with individual assembly blocks separated
647*9880d681SAndroid Build Coastguard Workerby newline (ASCII 10) characters.
648*9880d681SAndroid Build Coastguard Worker
649*9880d681SAndroid Build Coastguard Worker.. _MODULE_CODE_SECTIONNAME:
650*9880d681SAndroid Build Coastguard Worker
651*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_SECTIONNAME Record
652*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
653*9880d681SAndroid Build Coastguard Worker
654*9880d681SAndroid Build Coastguard Worker``[SECTIONNAME, ...string...]``
655*9880d681SAndroid Build Coastguard Worker
656*9880d681SAndroid Build Coastguard WorkerThe ``SECTIONNAME`` record (code 5) contains a variable number of values
657*9880d681SAndroid Build Coastguard Workerrepresenting the bytes of a single section name string. There should be one
658*9880d681SAndroid Build Coastguard Worker``SECTIONNAME`` record for each section name referenced (e.g., in global
659*9880d681SAndroid Build Coastguard Workervariable or function ``section`` attributes) within the module. These records
660*9880d681SAndroid Build Coastguard Workercan be referenced by the 1-based index in the *section* fields of ``GLOBALVAR``
661*9880d681SAndroid Build Coastguard Workeror ``FUNCTION`` records.
662*9880d681SAndroid Build Coastguard Worker
663*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_DEPLIB Record
664*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^
665*9880d681SAndroid Build Coastguard Worker
666*9880d681SAndroid Build Coastguard Worker``[DEPLIB, ...string...]``
667*9880d681SAndroid Build Coastguard Worker
668*9880d681SAndroid Build Coastguard WorkerThe ``DEPLIB`` record (code 6) contains a variable number of values representing
669*9880d681SAndroid Build Coastguard Workerthe bytes of a single dependent library name string, one of the libraries
670*9880d681SAndroid Build Coastguard Workermentioned in a ``deplibs`` declaration.  There should be one ``DEPLIB`` record
671*9880d681SAndroid Build Coastguard Workerfor each library name referenced.
672*9880d681SAndroid Build Coastguard Worker
673*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_GLOBALVAR Record
674*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^^^
675*9880d681SAndroid Build Coastguard Worker
676*9880d681SAndroid Build Coastguard Worker``[GLOBALVAR, pointer type, isconst, initid, linkage, alignment, section, visibility, threadlocal, unnamed_addr, externally_initialized, dllstorageclass, comdat]``
677*9880d681SAndroid Build Coastguard Worker
678*9880d681SAndroid Build Coastguard WorkerThe ``GLOBALVAR`` record (code 7) marks the declaration or definition of a
679*9880d681SAndroid Build Coastguard Workerglobal variable. The operand fields are:
680*9880d681SAndroid Build Coastguard Worker
681*9880d681SAndroid Build Coastguard Worker* *pointer type*: The type index of the pointer type used to point to this
682*9880d681SAndroid Build Coastguard Worker  global variable
683*9880d681SAndroid Build Coastguard Worker
684*9880d681SAndroid Build Coastguard Worker* *isconst*: Non-zero if the variable is treated as constant within the module,
685*9880d681SAndroid Build Coastguard Worker  or zero if it is not
686*9880d681SAndroid Build Coastguard Worker
687*9880d681SAndroid Build Coastguard Worker* *initid*: If non-zero, the value index of the initializer for this variable,
688*9880d681SAndroid Build Coastguard Worker  plus 1.
689*9880d681SAndroid Build Coastguard Worker
690*9880d681SAndroid Build Coastguard Worker.. _linkage type:
691*9880d681SAndroid Build Coastguard Worker
692*9880d681SAndroid Build Coastguard Worker* *linkage*: An encoding of the linkage type for this variable:
693*9880d681SAndroid Build Coastguard Worker
694*9880d681SAndroid Build Coastguard Worker  * ``external``: code 0
695*9880d681SAndroid Build Coastguard Worker  * ``weak``: code 1
696*9880d681SAndroid Build Coastguard Worker  * ``appending``: code 2
697*9880d681SAndroid Build Coastguard Worker  * ``internal``: code 3
698*9880d681SAndroid Build Coastguard Worker  * ``linkonce``: code 4
699*9880d681SAndroid Build Coastguard Worker  * ``dllimport``: code 5
700*9880d681SAndroid Build Coastguard Worker  * ``dllexport``: code 6
701*9880d681SAndroid Build Coastguard Worker  * ``extern_weak``: code 7
702*9880d681SAndroid Build Coastguard Worker  * ``common``: code 8
703*9880d681SAndroid Build Coastguard Worker  * ``private``: code 9
704*9880d681SAndroid Build Coastguard Worker  * ``weak_odr``: code 10
705*9880d681SAndroid Build Coastguard Worker  * ``linkonce_odr``: code 11
706*9880d681SAndroid Build Coastguard Worker  * ``available_externally``: code 12
707*9880d681SAndroid Build Coastguard Worker  * deprecated : code 13
708*9880d681SAndroid Build Coastguard Worker  * deprecated : code 14
709*9880d681SAndroid Build Coastguard Worker
710*9880d681SAndroid Build Coastguard Worker* alignment*: The logarithm base 2 of the variable's requested alignment, plus 1
711*9880d681SAndroid Build Coastguard Worker
712*9880d681SAndroid Build Coastguard Worker* *section*: If non-zero, the 1-based section index in the table of
713*9880d681SAndroid Build Coastguard Worker  `MODULE_CODE_SECTIONNAME`_ entries.
714*9880d681SAndroid Build Coastguard Worker
715*9880d681SAndroid Build Coastguard Worker.. _visibility:
716*9880d681SAndroid Build Coastguard Worker
717*9880d681SAndroid Build Coastguard Worker* *visibility*: If present, an encoding of the visibility of this variable:
718*9880d681SAndroid Build Coastguard Worker
719*9880d681SAndroid Build Coastguard Worker  * ``default``: code 0
720*9880d681SAndroid Build Coastguard Worker  * ``hidden``: code 1
721*9880d681SAndroid Build Coastguard Worker  * ``protected``: code 2
722*9880d681SAndroid Build Coastguard Worker
723*9880d681SAndroid Build Coastguard Worker.. _bcthreadlocal:
724*9880d681SAndroid Build Coastguard Worker
725*9880d681SAndroid Build Coastguard Worker* *threadlocal*: If present, an encoding of the thread local storage mode of the
726*9880d681SAndroid Build Coastguard Worker  variable:
727*9880d681SAndroid Build Coastguard Worker
728*9880d681SAndroid Build Coastguard Worker  * ``not thread local``: code 0
729*9880d681SAndroid Build Coastguard Worker  * ``thread local; default TLS model``: code 1
730*9880d681SAndroid Build Coastguard Worker  * ``localdynamic``: code 2
731*9880d681SAndroid Build Coastguard Worker  * ``initialexec``: code 3
732*9880d681SAndroid Build Coastguard Worker  * ``localexec``: code 4
733*9880d681SAndroid Build Coastguard Worker
734*9880d681SAndroid Build Coastguard Worker.. _bcunnamedaddr:
735*9880d681SAndroid Build Coastguard Worker
736*9880d681SAndroid Build Coastguard Worker* *unnamed_addr*: If present, an encoding of the ``unnamed_addr`` attribute of this
737*9880d681SAndroid Build Coastguard Worker  variable:
738*9880d681SAndroid Build Coastguard Worker
739*9880d681SAndroid Build Coastguard Worker  * not ``unnamed_addr``: code 0
740*9880d681SAndroid Build Coastguard Worker  * ``unnamed_addr``: code 1
741*9880d681SAndroid Build Coastguard Worker  * ``local_unnamed_addr``: code 2
742*9880d681SAndroid Build Coastguard Worker
743*9880d681SAndroid Build Coastguard Worker.. _bcdllstorageclass:
744*9880d681SAndroid Build Coastguard Worker
745*9880d681SAndroid Build Coastguard Worker* *dllstorageclass*: If present, an encoding of the DLL storage class of this variable:
746*9880d681SAndroid Build Coastguard Worker
747*9880d681SAndroid Build Coastguard Worker  * ``default``: code 0
748*9880d681SAndroid Build Coastguard Worker  * ``dllimport``: code 1
749*9880d681SAndroid Build Coastguard Worker  * ``dllexport``: code 2
750*9880d681SAndroid Build Coastguard Worker
751*9880d681SAndroid Build Coastguard Worker* *comdat*: An encoding of the COMDAT of this function
752*9880d681SAndroid Build Coastguard Worker
753*9880d681SAndroid Build Coastguard Worker.. _FUNCTION:
754*9880d681SAndroid Build Coastguard Worker
755*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_FUNCTION Record
756*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^^
757*9880d681SAndroid Build Coastguard Worker
758*9880d681SAndroid Build Coastguard Worker``[FUNCTION, type, callingconv, isproto, linkage, paramattr, alignment, section, visibility, gc, prologuedata, dllstorageclass, comdat, prefixdata, personalityfn]``
759*9880d681SAndroid Build Coastguard Worker
760*9880d681SAndroid Build Coastguard WorkerThe ``FUNCTION`` record (code 8) marks the declaration or definition of a
761*9880d681SAndroid Build Coastguard Workerfunction. The operand fields are:
762*9880d681SAndroid Build Coastguard Worker
763*9880d681SAndroid Build Coastguard Worker* *type*: The type index of the function type describing this function
764*9880d681SAndroid Build Coastguard Worker
765*9880d681SAndroid Build Coastguard Worker* *callingconv*: The calling convention number:
766*9880d681SAndroid Build Coastguard Worker  * ``ccc``: code 0
767*9880d681SAndroid Build Coastguard Worker  * ``fastcc``: code 8
768*9880d681SAndroid Build Coastguard Worker  * ``coldcc``: code 9
769*9880d681SAndroid Build Coastguard Worker  * ``webkit_jscc``: code 12
770*9880d681SAndroid Build Coastguard Worker  * ``anyregcc``: code 13
771*9880d681SAndroid Build Coastguard Worker  * ``preserve_mostcc``: code 14
772*9880d681SAndroid Build Coastguard Worker  * ``preserve_allcc``: code 15
773*9880d681SAndroid Build Coastguard Worker  * ``swiftcc`` : code 16
774*9880d681SAndroid Build Coastguard Worker  * ``cxx_fast_tlscc``: code 17
775*9880d681SAndroid Build Coastguard Worker  * ``x86_stdcallcc``: code 64
776*9880d681SAndroid Build Coastguard Worker  * ``x86_fastcallcc``: code 65
777*9880d681SAndroid Build Coastguard Worker  * ``arm_apcscc``: code 66
778*9880d681SAndroid Build Coastguard Worker  * ``arm_aapcscc``: code 67
779*9880d681SAndroid Build Coastguard Worker  * ``arm_aapcs_vfpcc``: code 68
780*9880d681SAndroid Build Coastguard Worker
781*9880d681SAndroid Build Coastguard Worker* isproto*: Non-zero if this entry represents a declaration rather than a
782*9880d681SAndroid Build Coastguard Worker  definition
783*9880d681SAndroid Build Coastguard Worker
784*9880d681SAndroid Build Coastguard Worker* *linkage*: An encoding of the `linkage type`_ for this function
785*9880d681SAndroid Build Coastguard Worker
786*9880d681SAndroid Build Coastguard Worker* *paramattr*: If nonzero, the 1-based parameter attribute index into the table
787*9880d681SAndroid Build Coastguard Worker  of `PARAMATTR_CODE_ENTRY`_ entries.
788*9880d681SAndroid Build Coastguard Worker
789*9880d681SAndroid Build Coastguard Worker* *alignment*: The logarithm base 2 of the function's requested alignment, plus
790*9880d681SAndroid Build Coastguard Worker  1
791*9880d681SAndroid Build Coastguard Worker
792*9880d681SAndroid Build Coastguard Worker* *section*: If non-zero, the 1-based section index in the table of
793*9880d681SAndroid Build Coastguard Worker  `MODULE_CODE_SECTIONNAME`_ entries.
794*9880d681SAndroid Build Coastguard Worker
795*9880d681SAndroid Build Coastguard Worker* *visibility*: An encoding of the `visibility`_ of this function
796*9880d681SAndroid Build Coastguard Worker
797*9880d681SAndroid Build Coastguard Worker* *gc*: If present and nonzero, the 1-based garbage collector index in the table
798*9880d681SAndroid Build Coastguard Worker  of `MODULE_CODE_GCNAME`_ entries.
799*9880d681SAndroid Build Coastguard Worker
800*9880d681SAndroid Build Coastguard Worker* *unnamed_addr*: If present, an encoding of the
801*9880d681SAndroid Build Coastguard Worker  :ref:`unnamed_addr<bcunnamedaddr>` attribute of this function
802*9880d681SAndroid Build Coastguard Worker
803*9880d681SAndroid Build Coastguard Worker* *prologuedata*: If non-zero, the value index of the prologue data for this function,
804*9880d681SAndroid Build Coastguard Worker  plus 1.
805*9880d681SAndroid Build Coastguard Worker
806*9880d681SAndroid Build Coastguard Worker* *dllstorageclass*: An encoding of the
807*9880d681SAndroid Build Coastguard Worker  :ref:`dllstorageclass<bcdllstorageclass>` of this function
808*9880d681SAndroid Build Coastguard Worker
809*9880d681SAndroid Build Coastguard Worker* *comdat*: An encoding of the COMDAT of this function
810*9880d681SAndroid Build Coastguard Worker
811*9880d681SAndroid Build Coastguard Worker* *prefixdata*: If non-zero, the value index of the prefix data for this function,
812*9880d681SAndroid Build Coastguard Worker  plus 1.
813*9880d681SAndroid Build Coastguard Worker
814*9880d681SAndroid Build Coastguard Worker* *personalityfn*: If non-zero, the value index of the personality function for this function,
815*9880d681SAndroid Build Coastguard Worker  plus 1.
816*9880d681SAndroid Build Coastguard Worker
817*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_ALIAS Record
818*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^
819*9880d681SAndroid Build Coastguard Worker
820*9880d681SAndroid Build Coastguard Worker``[ALIAS, alias type, aliasee val#, linkage, visibility, dllstorageclass, threadlocal, unnamed_addr]``
821*9880d681SAndroid Build Coastguard Worker
822*9880d681SAndroid Build Coastguard WorkerThe ``ALIAS`` record (code 9) marks the definition of an alias. The operand
823*9880d681SAndroid Build Coastguard Workerfields are
824*9880d681SAndroid Build Coastguard Worker
825*9880d681SAndroid Build Coastguard Worker* *alias type*: The type index of the alias
826*9880d681SAndroid Build Coastguard Worker
827*9880d681SAndroid Build Coastguard Worker* *aliasee val#*: The value index of the aliased value
828*9880d681SAndroid Build Coastguard Worker
829*9880d681SAndroid Build Coastguard Worker* *linkage*: An encoding of the `linkage type`_ for this alias
830*9880d681SAndroid Build Coastguard Worker
831*9880d681SAndroid Build Coastguard Worker* *visibility*: If present, an encoding of the `visibility`_ of the alias
832*9880d681SAndroid Build Coastguard Worker
833*9880d681SAndroid Build Coastguard Worker* *dllstorageclass*: If present, an encoding of the
834*9880d681SAndroid Build Coastguard Worker  :ref:`dllstorageclass<bcdllstorageclass>` of the alias
835*9880d681SAndroid Build Coastguard Worker
836*9880d681SAndroid Build Coastguard Worker* *threadlocal*: If present, an encoding of the
837*9880d681SAndroid Build Coastguard Worker  :ref:`thread local property<bcthreadlocal>` of the alias
838*9880d681SAndroid Build Coastguard Worker
839*9880d681SAndroid Build Coastguard Worker* *unnamed_addr*: If present, an encoding of the
840*9880d681SAndroid Build Coastguard Worker  :ref:`unnamed_addr<bcunnamedaddr>` attribute of this alias
841*9880d681SAndroid Build Coastguard Worker
842*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_PURGEVALS Record
843*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^^^
844*9880d681SAndroid Build Coastguard Worker
845*9880d681SAndroid Build Coastguard Worker``[PURGEVALS, numvals]``
846*9880d681SAndroid Build Coastguard Worker
847*9880d681SAndroid Build Coastguard WorkerThe ``PURGEVALS`` record (code 10) resets the module-level value list to the
848*9880d681SAndroid Build Coastguard Workersize given by the single operand value. Module-level value list items are added
849*9880d681SAndroid Build Coastguard Workerby ``GLOBALVAR``, ``FUNCTION``, and ``ALIAS`` records.  After a ``PURGEVALS``
850*9880d681SAndroid Build Coastguard Workerrecord is seen, new value indices will start from the given *numvals* value.
851*9880d681SAndroid Build Coastguard Worker
852*9880d681SAndroid Build Coastguard Worker.. _MODULE_CODE_GCNAME:
853*9880d681SAndroid Build Coastguard Worker
854*9880d681SAndroid Build Coastguard WorkerMODULE_CODE_GCNAME Record
855*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^
856*9880d681SAndroid Build Coastguard Worker
857*9880d681SAndroid Build Coastguard Worker``[GCNAME, ...string...]``
858*9880d681SAndroid Build Coastguard Worker
859*9880d681SAndroid Build Coastguard WorkerThe ``GCNAME`` record (code 11) contains a variable number of values
860*9880d681SAndroid Build Coastguard Workerrepresenting the bytes of a single garbage collector name string. There should
861*9880d681SAndroid Build Coastguard Workerbe one ``GCNAME`` record for each garbage collector name referenced in function
862*9880d681SAndroid Build Coastguard Worker``gc`` attributes within the module. These records can be referenced by 1-based
863*9880d681SAndroid Build Coastguard Workerindex in the *gc* fields of ``FUNCTION`` records.
864*9880d681SAndroid Build Coastguard Worker
865*9880d681SAndroid Build Coastguard Worker.. _PARAMATTR_BLOCK:
866*9880d681SAndroid Build Coastguard Worker
867*9880d681SAndroid Build Coastguard WorkerPARAMATTR_BLOCK Contents
868*9880d681SAndroid Build Coastguard Worker------------------------
869*9880d681SAndroid Build Coastguard Worker
870*9880d681SAndroid Build Coastguard WorkerThe ``PARAMATTR_BLOCK`` block (id 9) contains a table of entries describing the
871*9880d681SAndroid Build Coastguard Workerattributes of function parameters. These entries are referenced by 1-based index
872*9880d681SAndroid Build Coastguard Workerin the *paramattr* field of module block `FUNCTION`_ records, or within the
873*9880d681SAndroid Build Coastguard Worker*attr* field of function block ``INST_INVOKE`` and ``INST_CALL`` records.
874*9880d681SAndroid Build Coastguard Worker
875*9880d681SAndroid Build Coastguard WorkerEntries within ``PARAMATTR_BLOCK`` are constructed to ensure that each is unique
876*9880d681SAndroid Build Coastguard Worker(i.e., no two indices represent equivalent attribute lists).
877*9880d681SAndroid Build Coastguard Worker
878*9880d681SAndroid Build Coastguard Worker.. _PARAMATTR_CODE_ENTRY:
879*9880d681SAndroid Build Coastguard Worker
880*9880d681SAndroid Build Coastguard WorkerPARAMATTR_CODE_ENTRY Record
881*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^^
882*9880d681SAndroid Build Coastguard Worker
883*9880d681SAndroid Build Coastguard Worker``[ENTRY, paramidx0, attr0, paramidx1, attr1...]``
884*9880d681SAndroid Build Coastguard Worker
885*9880d681SAndroid Build Coastguard WorkerThe ``ENTRY`` record (code 1) contains an even number of values describing a
886*9880d681SAndroid Build Coastguard Workerunique set of function parameter attributes. Each *paramidx* value indicates
887*9880d681SAndroid Build Coastguard Workerwhich set of attributes is represented, with 0 representing the return value
888*9880d681SAndroid Build Coastguard Workerattributes, 0xFFFFFFFF representing function attributes, and other values
889*9880d681SAndroid Build Coastguard Workerrepresenting 1-based function parameters. Each *attr* value is a bitmap with the
890*9880d681SAndroid Build Coastguard Workerfollowing interpretation:
891*9880d681SAndroid Build Coastguard Worker
892*9880d681SAndroid Build Coastguard Worker* bit 0: ``zeroext``
893*9880d681SAndroid Build Coastguard Worker* bit 1: ``signext``
894*9880d681SAndroid Build Coastguard Worker* bit 2: ``noreturn``
895*9880d681SAndroid Build Coastguard Worker* bit 3: ``inreg``
896*9880d681SAndroid Build Coastguard Worker* bit 4: ``sret``
897*9880d681SAndroid Build Coastguard Worker* bit 5: ``nounwind``
898*9880d681SAndroid Build Coastguard Worker* bit 6: ``noalias``
899*9880d681SAndroid Build Coastguard Worker* bit 7: ``byval``
900*9880d681SAndroid Build Coastguard Worker* bit 8: ``nest``
901*9880d681SAndroid Build Coastguard Worker* bit 9: ``readnone``
902*9880d681SAndroid Build Coastguard Worker* bit 10: ``readonly``
903*9880d681SAndroid Build Coastguard Worker* bit 11: ``noinline``
904*9880d681SAndroid Build Coastguard Worker* bit 12: ``alwaysinline``
905*9880d681SAndroid Build Coastguard Worker* bit 13: ``optsize``
906*9880d681SAndroid Build Coastguard Worker* bit 14: ``ssp``
907*9880d681SAndroid Build Coastguard Worker* bit 15: ``sspreq``
908*9880d681SAndroid Build Coastguard Worker* bits 16-31: ``align n``
909*9880d681SAndroid Build Coastguard Worker* bit 32: ``nocapture``
910*9880d681SAndroid Build Coastguard Worker* bit 33: ``noredzone``
911*9880d681SAndroid Build Coastguard Worker* bit 34: ``noimplicitfloat``
912*9880d681SAndroid Build Coastguard Worker* bit 35: ``naked``
913*9880d681SAndroid Build Coastguard Worker* bit 36: ``inlinehint``
914*9880d681SAndroid Build Coastguard Worker* bits 37-39: ``alignstack n``, represented as the logarithm
915*9880d681SAndroid Build Coastguard Worker  base 2 of the requested alignment, plus 1
916*9880d681SAndroid Build Coastguard Worker
917*9880d681SAndroid Build Coastguard Worker.. _TYPE_BLOCK:
918*9880d681SAndroid Build Coastguard Worker
919*9880d681SAndroid Build Coastguard WorkerTYPE_BLOCK Contents
920*9880d681SAndroid Build Coastguard Worker-------------------
921*9880d681SAndroid Build Coastguard Worker
922*9880d681SAndroid Build Coastguard WorkerThe ``TYPE_BLOCK`` block (id 10) contains records which constitute a table of
923*9880d681SAndroid Build Coastguard Workertype operator entries used to represent types referenced within an LLVM
924*9880d681SAndroid Build Coastguard Workermodule. Each record (with the exception of `NUMENTRY`_) generates a single type
925*9880d681SAndroid Build Coastguard Workertable entry, which may be referenced by 0-based index from instructions,
926*9880d681SAndroid Build Coastguard Workerconstants, metadata, type symbol table entries, or other type operator records.
927*9880d681SAndroid Build Coastguard Worker
928*9880d681SAndroid Build Coastguard WorkerEntries within ``TYPE_BLOCK`` are constructed to ensure that each entry is
929*9880d681SAndroid Build Coastguard Workerunique (i.e., no two indices represent structurally equivalent types).
930*9880d681SAndroid Build Coastguard Worker
931*9880d681SAndroid Build Coastguard Worker.. _TYPE_CODE_NUMENTRY:
932*9880d681SAndroid Build Coastguard Worker.. _NUMENTRY:
933*9880d681SAndroid Build Coastguard Worker
934*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_NUMENTRY Record
935*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^
936*9880d681SAndroid Build Coastguard Worker
937*9880d681SAndroid Build Coastguard Worker``[NUMENTRY, numentries]``
938*9880d681SAndroid Build Coastguard Worker
939*9880d681SAndroid Build Coastguard WorkerThe ``NUMENTRY`` record (code 1) contains a single value which indicates the
940*9880d681SAndroid Build Coastguard Workertotal number of type code entries in the type table of the module. If present,
941*9880d681SAndroid Build Coastguard Worker``NUMENTRY`` should be the first record in the block.
942*9880d681SAndroid Build Coastguard Worker
943*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_VOID Record
944*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^
945*9880d681SAndroid Build Coastguard Worker
946*9880d681SAndroid Build Coastguard Worker``[VOID]``
947*9880d681SAndroid Build Coastguard Worker
948*9880d681SAndroid Build Coastguard WorkerThe ``VOID`` record (code 2) adds a ``void`` type to the type table.
949*9880d681SAndroid Build Coastguard Worker
950*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_HALF Record
951*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^
952*9880d681SAndroid Build Coastguard Worker
953*9880d681SAndroid Build Coastguard Worker``[HALF]``
954*9880d681SAndroid Build Coastguard Worker
955*9880d681SAndroid Build Coastguard WorkerThe ``HALF`` record (code 10) adds a ``half`` (16-bit floating point) type to
956*9880d681SAndroid Build Coastguard Workerthe type table.
957*9880d681SAndroid Build Coastguard Worker
958*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_FLOAT Record
959*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^
960*9880d681SAndroid Build Coastguard Worker
961*9880d681SAndroid Build Coastguard Worker``[FLOAT]``
962*9880d681SAndroid Build Coastguard Worker
963*9880d681SAndroid Build Coastguard WorkerThe ``FLOAT`` record (code 3) adds a ``float`` (32-bit floating point) type to
964*9880d681SAndroid Build Coastguard Workerthe type table.
965*9880d681SAndroid Build Coastguard Worker
966*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_DOUBLE Record
967*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^
968*9880d681SAndroid Build Coastguard Worker
969*9880d681SAndroid Build Coastguard Worker``[DOUBLE]``
970*9880d681SAndroid Build Coastguard Worker
971*9880d681SAndroid Build Coastguard WorkerThe ``DOUBLE`` record (code 4) adds a ``double`` (64-bit floating point) type to
972*9880d681SAndroid Build Coastguard Workerthe type table.
973*9880d681SAndroid Build Coastguard Worker
974*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_LABEL Record
975*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^
976*9880d681SAndroid Build Coastguard Worker
977*9880d681SAndroid Build Coastguard Worker``[LABEL]``
978*9880d681SAndroid Build Coastguard Worker
979*9880d681SAndroid Build Coastguard WorkerThe ``LABEL`` record (code 5) adds a ``label`` type to the type table.
980*9880d681SAndroid Build Coastguard Worker
981*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_OPAQUE Record
982*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^
983*9880d681SAndroid Build Coastguard Worker
984*9880d681SAndroid Build Coastguard Worker``[OPAQUE]``
985*9880d681SAndroid Build Coastguard Worker
986*9880d681SAndroid Build Coastguard WorkerThe ``OPAQUE`` record (code 6) adds an ``opaque`` type to the type table. Note
987*9880d681SAndroid Build Coastguard Workerthat distinct ``opaque`` types are not unified.
988*9880d681SAndroid Build Coastguard Worker
989*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_INTEGER Record
990*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^
991*9880d681SAndroid Build Coastguard Worker
992*9880d681SAndroid Build Coastguard Worker``[INTEGER, width]``
993*9880d681SAndroid Build Coastguard Worker
994*9880d681SAndroid Build Coastguard WorkerThe ``INTEGER`` record (code 7) adds an integer type to the type table. The
995*9880d681SAndroid Build Coastguard Workersingle *width* field indicates the width of the integer type.
996*9880d681SAndroid Build Coastguard Worker
997*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_POINTER Record
998*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^
999*9880d681SAndroid Build Coastguard Worker
1000*9880d681SAndroid Build Coastguard Worker``[POINTER, pointee type, address space]``
1001*9880d681SAndroid Build Coastguard Worker
1002*9880d681SAndroid Build Coastguard WorkerThe ``POINTER`` record (code 8) adds a pointer type to the type table. The
1003*9880d681SAndroid Build Coastguard Workeroperand fields are
1004*9880d681SAndroid Build Coastguard Worker
1005*9880d681SAndroid Build Coastguard Worker* *pointee type*: The type index of the pointed-to type
1006*9880d681SAndroid Build Coastguard Worker
1007*9880d681SAndroid Build Coastguard Worker* *address space*: If supplied, the target-specific numbered address space where
1008*9880d681SAndroid Build Coastguard Worker  the pointed-to object resides. Otherwise, the default address space is zero.
1009*9880d681SAndroid Build Coastguard Worker
1010*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_FUNCTION Record
1011*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^
1012*9880d681SAndroid Build Coastguard Worker
1013*9880d681SAndroid Build Coastguard Worker``[FUNCTION, vararg, ignored, retty, ...paramty... ]``
1014*9880d681SAndroid Build Coastguard Worker
1015*9880d681SAndroid Build Coastguard WorkerThe ``FUNCTION`` record (code 9) adds a function type to the type table. The
1016*9880d681SAndroid Build Coastguard Workeroperand fields are
1017*9880d681SAndroid Build Coastguard Worker
1018*9880d681SAndroid Build Coastguard Worker* *vararg*: Non-zero if the type represents a varargs function
1019*9880d681SAndroid Build Coastguard Worker
1020*9880d681SAndroid Build Coastguard Worker* *ignored*: This value field is present for backward compatibility only, and is
1021*9880d681SAndroid Build Coastguard Worker  ignored
1022*9880d681SAndroid Build Coastguard Worker
1023*9880d681SAndroid Build Coastguard Worker* *retty*: The type index of the function's return type
1024*9880d681SAndroid Build Coastguard Worker
1025*9880d681SAndroid Build Coastguard Worker* *paramty*: Zero or more type indices representing the parameter types of the
1026*9880d681SAndroid Build Coastguard Worker  function
1027*9880d681SAndroid Build Coastguard Worker
1028*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_STRUCT Record
1029*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^
1030*9880d681SAndroid Build Coastguard Worker
1031*9880d681SAndroid Build Coastguard Worker``[STRUCT, ispacked, ...eltty...]``
1032*9880d681SAndroid Build Coastguard Worker
1033*9880d681SAndroid Build Coastguard WorkerThe ``STRUCT`` record (code 10) adds a struct type to the type table. The
1034*9880d681SAndroid Build Coastguard Workeroperand fields are
1035*9880d681SAndroid Build Coastguard Worker
1036*9880d681SAndroid Build Coastguard Worker* *ispacked*: Non-zero if the type represents a packed structure
1037*9880d681SAndroid Build Coastguard Worker
1038*9880d681SAndroid Build Coastguard Worker* *eltty*: Zero or more type indices representing the element types of the
1039*9880d681SAndroid Build Coastguard Worker  structure
1040*9880d681SAndroid Build Coastguard Worker
1041*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_ARRAY Record
1042*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^
1043*9880d681SAndroid Build Coastguard Worker
1044*9880d681SAndroid Build Coastguard Worker``[ARRAY, numelts, eltty]``
1045*9880d681SAndroid Build Coastguard Worker
1046*9880d681SAndroid Build Coastguard WorkerThe ``ARRAY`` record (code 11) adds an array type to the type table.  The
1047*9880d681SAndroid Build Coastguard Workeroperand fields are
1048*9880d681SAndroid Build Coastguard Worker
1049*9880d681SAndroid Build Coastguard Worker* *numelts*: The number of elements in arrays of this type
1050*9880d681SAndroid Build Coastguard Worker
1051*9880d681SAndroid Build Coastguard Worker* *eltty*: The type index of the array element type
1052*9880d681SAndroid Build Coastguard Worker
1053*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_VECTOR Record
1054*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^
1055*9880d681SAndroid Build Coastguard Worker
1056*9880d681SAndroid Build Coastguard Worker``[VECTOR, numelts, eltty]``
1057*9880d681SAndroid Build Coastguard Worker
1058*9880d681SAndroid Build Coastguard WorkerThe ``VECTOR`` record (code 12) adds a vector type to the type table.  The
1059*9880d681SAndroid Build Coastguard Workeroperand fields are
1060*9880d681SAndroid Build Coastguard Worker
1061*9880d681SAndroid Build Coastguard Worker* *numelts*: The number of elements in vectors of this type
1062*9880d681SAndroid Build Coastguard Worker
1063*9880d681SAndroid Build Coastguard Worker* *eltty*: The type index of the vector element type
1064*9880d681SAndroid Build Coastguard Worker
1065*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_X86_FP80 Record
1066*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^
1067*9880d681SAndroid Build Coastguard Worker
1068*9880d681SAndroid Build Coastguard Worker``[X86_FP80]``
1069*9880d681SAndroid Build Coastguard Worker
1070*9880d681SAndroid Build Coastguard WorkerThe ``X86_FP80`` record (code 13) adds an ``x86_fp80`` (80-bit floating point)
1071*9880d681SAndroid Build Coastguard Workertype to the type table.
1072*9880d681SAndroid Build Coastguard Worker
1073*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_FP128 Record
1074*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^
1075*9880d681SAndroid Build Coastguard Worker
1076*9880d681SAndroid Build Coastguard Worker``[FP128]``
1077*9880d681SAndroid Build Coastguard Worker
1078*9880d681SAndroid Build Coastguard WorkerThe ``FP128`` record (code 14) adds an ``fp128`` (128-bit floating point) type
1079*9880d681SAndroid Build Coastguard Workerto the type table.
1080*9880d681SAndroid Build Coastguard Worker
1081*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_PPC_FP128 Record
1082*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^^
1083*9880d681SAndroid Build Coastguard Worker
1084*9880d681SAndroid Build Coastguard Worker``[PPC_FP128]``
1085*9880d681SAndroid Build Coastguard Worker
1086*9880d681SAndroid Build Coastguard WorkerThe ``PPC_FP128`` record (code 15) adds a ``ppc_fp128`` (128-bit floating point)
1087*9880d681SAndroid Build Coastguard Workertype to the type table.
1088*9880d681SAndroid Build Coastguard Worker
1089*9880d681SAndroid Build Coastguard WorkerTYPE_CODE_METADATA Record
1090*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^^^^^
1091*9880d681SAndroid Build Coastguard Worker
1092*9880d681SAndroid Build Coastguard Worker``[METADATA]``
1093*9880d681SAndroid Build Coastguard Worker
1094*9880d681SAndroid Build Coastguard WorkerThe ``METADATA`` record (code 16) adds a ``metadata`` type to the type table.
1095*9880d681SAndroid Build Coastguard Worker
1096*9880d681SAndroid Build Coastguard Worker.. _CONSTANTS_BLOCK:
1097*9880d681SAndroid Build Coastguard Worker
1098*9880d681SAndroid Build Coastguard WorkerCONSTANTS_BLOCK Contents
1099*9880d681SAndroid Build Coastguard Worker------------------------
1100*9880d681SAndroid Build Coastguard Worker
1101*9880d681SAndroid Build Coastguard WorkerThe ``CONSTANTS_BLOCK`` block (id 11) ...
1102*9880d681SAndroid Build Coastguard Worker
1103*9880d681SAndroid Build Coastguard Worker.. _FUNCTION_BLOCK:
1104*9880d681SAndroid Build Coastguard Worker
1105*9880d681SAndroid Build Coastguard WorkerFUNCTION_BLOCK Contents
1106*9880d681SAndroid Build Coastguard Worker-----------------------
1107*9880d681SAndroid Build Coastguard Worker
1108*9880d681SAndroid Build Coastguard WorkerThe ``FUNCTION_BLOCK`` block (id 12) ...
1109*9880d681SAndroid Build Coastguard Worker
1110*9880d681SAndroid Build Coastguard WorkerIn addition to the record types described below, a ``FUNCTION_BLOCK`` block may
1111*9880d681SAndroid Build Coastguard Workercontain the following sub-blocks:
1112*9880d681SAndroid Build Coastguard Worker
1113*9880d681SAndroid Build Coastguard Worker* `CONSTANTS_BLOCK`_
1114*9880d681SAndroid Build Coastguard Worker* `VALUE_SYMTAB_BLOCK`_
1115*9880d681SAndroid Build Coastguard Worker* `METADATA_ATTACHMENT`_
1116*9880d681SAndroid Build Coastguard Worker
1117*9880d681SAndroid Build Coastguard Worker.. _TYPE_SYMTAB_BLOCK:
1118*9880d681SAndroid Build Coastguard Worker
1119*9880d681SAndroid Build Coastguard WorkerTYPE_SYMTAB_BLOCK Contents
1120*9880d681SAndroid Build Coastguard Worker--------------------------
1121*9880d681SAndroid Build Coastguard Worker
1122*9880d681SAndroid Build Coastguard WorkerThe ``TYPE_SYMTAB_BLOCK`` block (id 13) contains entries which map between
1123*9880d681SAndroid Build Coastguard Workermodule-level named types and their corresponding type indices.
1124*9880d681SAndroid Build Coastguard Worker
1125*9880d681SAndroid Build Coastguard Worker.. _TST_CODE_ENTRY:
1126*9880d681SAndroid Build Coastguard Worker
1127*9880d681SAndroid Build Coastguard WorkerTST_CODE_ENTRY Record
1128*9880d681SAndroid Build Coastguard Worker^^^^^^^^^^^^^^^^^^^^^
1129*9880d681SAndroid Build Coastguard Worker
1130*9880d681SAndroid Build Coastguard Worker``[ENTRY, typeid, ...string...]``
1131*9880d681SAndroid Build Coastguard Worker
1132*9880d681SAndroid Build Coastguard WorkerThe ``ENTRY`` record (code 1) contains a variable number of values, with the
1133*9880d681SAndroid Build Coastguard Workerfirst giving the type index of the designated type, and the remaining values
1134*9880d681SAndroid Build Coastguard Workergiving the character codes of the type name. Each entry corresponds to a single
1135*9880d681SAndroid Build Coastguard Workernamed type.
1136*9880d681SAndroid Build Coastguard Worker
1137*9880d681SAndroid Build Coastguard Worker.. _VALUE_SYMTAB_BLOCK:
1138*9880d681SAndroid Build Coastguard Worker
1139*9880d681SAndroid Build Coastguard WorkerVALUE_SYMTAB_BLOCK Contents
1140*9880d681SAndroid Build Coastguard Worker---------------------------
1141*9880d681SAndroid Build Coastguard Worker
1142*9880d681SAndroid Build Coastguard WorkerThe ``VALUE_SYMTAB_BLOCK`` block (id 14) ...
1143*9880d681SAndroid Build Coastguard Worker
1144*9880d681SAndroid Build Coastguard Worker.. _METADATA_BLOCK:
1145*9880d681SAndroid Build Coastguard Worker
1146*9880d681SAndroid Build Coastguard WorkerMETADATA_BLOCK Contents
1147*9880d681SAndroid Build Coastguard Worker-----------------------
1148*9880d681SAndroid Build Coastguard Worker
1149*9880d681SAndroid Build Coastguard WorkerThe ``METADATA_BLOCK`` block (id 15) ...
1150*9880d681SAndroid Build Coastguard Worker
1151*9880d681SAndroid Build Coastguard Worker.. _METADATA_ATTACHMENT:
1152*9880d681SAndroid Build Coastguard Worker
1153*9880d681SAndroid Build Coastguard WorkerMETADATA_ATTACHMENT Contents
1154*9880d681SAndroid Build Coastguard Worker----------------------------
1155*9880d681SAndroid Build Coastguard Worker
1156*9880d681SAndroid Build Coastguard WorkerThe ``METADATA_ATTACHMENT`` block (id 16) ...
1157