Import the boost scoped_ptr class to LLVM. This patch was prepared by
[oota-llvm.git] / docs / BitCodeFormat.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2                       "http://www.w3.org/TR/html4/strict.dtd">
3 <html>
4 <head>
5   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6   <title>LLVM Bitcode File Format</title>
7   <link rel="stylesheet" href="llvm.css" type="text/css">
8 </head>
9 <body>
10 <div class="doc_title"> LLVM Bitcode File Format </div>
11 <ol>
12   <li><a href="#abstract">Abstract</a></li>
13   <li><a href="#overview">Overview</a></li>
14   <li><a href="#bitstream">Bitstream Format</a>
15     <ol>
16     <li><a href="#magic">Magic Numbers</a></li>
17     <li><a href="#primitives">Primitives</a></li>
18     <li><a href="#abbrevid">Abbreviation IDs</a></li>
19     <li><a href="#blocks">Blocks</a></li>
20     <li><a href="#datarecord">Data Records</a></li>
21     <li><a href="#abbreviations">Abbreviations</a></li>
22     <li><a href="#stdblocks">Standard Blocks</a></li>
23     </ol>
24   </li>
25   <li><a href="#llvmir">LLVM IR Encoding</a>
26     <ol>
27     <li><a href="#basics">Basics</a></li>
28     </ol>
29   </li>
30 </ol>
31 <div class="doc_author">
32   <p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
33   and <a href="http://www.reverberate.org">Joshua Haberman</a>.
34 </p>
35 </div>
36
37 <!-- *********************************************************************** -->
38 <div class="doc_section"> <a name="abstract">Abstract</a></div>
39 <!-- *********************************************************************** -->
40
41 <div class="doc_text">
42
43 <p>This document describes the LLVM bitstream file format and the encoding of
44 the LLVM IR into it.</p>
45
46 </div>
47
48 <!-- *********************************************************************** -->
49 <div class="doc_section"> <a name="overview">Overview</a></div>
50 <!-- *********************************************************************** -->
51
52 <div class="doc_text">
53
54 <p>
55 What is commonly known as the LLVM bitcode file format (also, sometimes
56 anachronistically known as bytecode) is actually two things: a <a 
57 href="#bitstream">bitstream container format</a>
58 and an <a href="#llvmir">encoding of LLVM IR</a> into the container format.</p>
59
60 <p>
61 The bitstream format is an abstract encoding of structured data, very
62 similar to XML in some ways.  Like XML, bitstream files contain tags, and nested
63 structures, and you can parse the file without having to understand the tags.
64 Unlike XML, the bitstream format is a binary encoding, and unlike XML it
65 provides a mechanism for the file to self-describe "abbreviations", which are
66 effectively size optimizations for the content.</p>
67
68 <p>This document first describes the LLVM bitstream format, then describes the
69 record structure used by LLVM IR files.
70 </p>
71
72 </div>
73
74 <!-- *********************************************************************** -->
75 <div class="doc_section"> <a name="bitstream">Bitstream Format</a></div>
76 <!-- *********************************************************************** -->
77
78 <div class="doc_text">
79
80 <p>
81 The bitstream format is literally a stream of bits, with a very simple
82 structure.  This structure consists of the following concepts:
83 </p>
84
85 <ul>
86 <li>A "<a href="#magic">magic number</a>" that identifies the contents of
87     the stream.</li>
88 <li>Encoding <a href="#primitives">primitives</a> like variable bit-rate
89     integers.</li> 
90 <li><a href="#blocks">Blocks</a>, which define nested content.</li> 
91 <li><a href="#datarecord">Data Records</a>, which describe entities within the
92     file.</li> 
93 <li>Abbreviations, which specify compression optimizations for the file.</li> 
94 </ul>
95
96 <p>Note that the <a 
97 href="CommandGuide/html/llvm-bcanalyzer.html">llvm-bcanalyzer</a> tool can be
98 used to dump and inspect arbitrary bitstreams, which is very useful for
99 understanding the encoding.</p>
100
101 </div>
102
103 <!-- ======================================================================= -->
104 <div class="doc_subsection"><a name="magic">Magic Numbers</a>
105 </div>
106
107 <div class="doc_text">
108
109 <p>The first two bytes of a bitcode file are 'BC' (0x42, 0x43).
110 The second two bytes are an application-specific magic number.  Generic
111 bitcode tools can look at only the first two bytes to verify the file is
112 bitcode, while application-specific programs will want to look at all four.</p>
113
114 </div>
115
116 <!-- ======================================================================= -->
117 <div class="doc_subsection"><a name="primitives">Primitives</a>
118 </div>
119
120 <div class="doc_text">
121
122 <p>
123 A bitstream literally consists of a stream of bits, which are read in order
124 starting with the least significant bit of each byte.  The stream is made up of a
125 number of primitive values that encode a stream of unsigned integer values.
126 These
127 integers are are encoded in two ways: either as <a href="#fixedwidth">Fixed
128 Width Integers</a> or as <a href="#variablewidth">Variable Width
129 Integers</a>.
130 </p>
131
132 </div>
133
134 <!-- _______________________________________________________________________ -->
135 <div class="doc_subsubsection"> <a name="fixedwidth">Fixed Width Integers</a>
136 </div>
137
138 <div class="doc_text">
139
140 <p>Fixed-width integer values have their low bits emitted directly to the file.
141    For example, a 3-bit integer value encodes 1 as 001.  Fixed width integers
142    are used when there are a well-known number of options for a field.  For
143    example, boolean values are usually encoded with a 1-bit wide integer. 
144 </p>
145
146 </div>
147
148 <!-- _______________________________________________________________________ -->
149 <div class="doc_subsubsection"> <a name="variablewidth">Variable Width
150 Integers</a></div>
151
152 <div class="doc_text">
153
154 <p>Variable-width integer (VBR) values encode values of arbitrary size,
155 optimizing for the case where the values are small.  Given a 4-bit VBR field,
156 any 3-bit value (0 through 7) is encoded directly, with the high bit set to
157 zero.  Values larger than N-1 bits emit their bits in a series of N-1 bit
158 chunks, where all but the last set the high bit.</p>
159
160 <p>For example, the value 27 (0x1B) is encoded as 1011 0011 when emitted as a
161 vbr4 value.  The first set of four bits indicates the value 3 (011) with a
162 continuation piece (indicated by a high bit of 1).  The next word indicates a
163 value of 24 (011 << 3) with no continuation.  The sum (3+24) yields the value
164 27.
165 </p>
166
167 </div>
168
169 <!-- _______________________________________________________________________ -->
170 <div class="doc_subsubsection"> <a name="char6">6-bit characters</a></div>
171
172 <div class="doc_text">
173
174 <p>6-bit characters encode common characters into a fixed 6-bit field.  They
175 represent the following characters with the following 6-bit values:</p>
176
177 <ul>
178 <li>'a' .. 'z' - 0 .. 25</li>
179 <li>'A' .. 'Z' - 26 .. 51</li>
180 <li>'0' .. '9' - 52 .. 61</li>
181 <li>'.' - 62</li>
182 <li>'_' - 63</li>
183 </ul>
184
185 <p>This encoding is only suitable for encoding characters and strings that
186 consist only of the above characters.  It is completely incapable of encoding
187 characters not in the set.</p>
188
189 </div>
190
191 <!-- _______________________________________________________________________ -->
192 <div class="doc_subsubsection"> <a name="wordalign">Word Alignment</a></div>
193
194 <div class="doc_text">
195
196 <p>Occasionally, it is useful to emit zero bits until the bitstream is a
197 multiple of 32 bits.  This ensures that the bit position in the stream can be
198 represented as a multiple of 32-bit words.</p>
199
200 </div>
201
202
203 <!-- ======================================================================= -->
204 <div class="doc_subsection"><a name="abbrevid">Abbreviation IDs</a>
205 </div>
206
207 <div class="doc_text">
208
209 <p>
210 A bitstream is a sequential series of <a href="#blocks">Blocks</a> and
211 <a href="#datarecord">Data Records</a>.  Both of these start with an
212 abbreviation ID encoded as a fixed-bitwidth field.  The width is specified by
213 the current block, as described below.  The value of the abbreviation ID
214 specifies either a builtin ID (which have special meanings, defined below) or
215 one of the abbreviation IDs defined by the stream itself.
216 </p>
217
218 <p>
219 The set of builtin abbrev IDs is:
220 </p>
221
222 <ul>
223 <li>0 - <a href="#END_BLOCK">END_BLOCK</a> - This abbrev ID marks the end of the
224     current block.</li>
225 <li>1 - <a href="#ENTER_SUBBLOCK">ENTER_SUBBLOCK</a> - This abbrev ID marks the
226     beginning of a new block.</li>
227 <li>2 - <a href="#DEFINE_ABBREV">DEFINE_ABBREV</a> - This defines a new
228     abbreviation.</li>
229 <li>3 - <a href="#UNABBREV_RECORD">UNABBREV_RECORD</a> - This ID specifies the
230     definition of an unabbreviated record.</li>
231 </ul>
232
233 <p>Abbreviation IDs 4 and above are defined by the stream itself, and specify
234 an <a href="#abbrev_records">abbreviated record encoding</a>.</p>
235
236 </div>
237
238 <!-- ======================================================================= -->
239 <div class="doc_subsection"><a name="blocks">Blocks</a>
240 </div>
241
242 <div class="doc_text">
243
244 <p>
245 Blocks in a bitstream denote nested regions of the stream, and are identified by
246 a content-specific id number (for example, LLVM IR uses an ID of 12 to represent
247 function bodies).  Block IDs 0-7 are reserved for <a href="#stdblocks">standard blocks</a>
248 whose meaning is defined by Bitcode; block IDs 8 and greater are
249 application specific. Nested blocks capture the hierachical structure of the data
250 encoded in it, and various properties are associated with blocks as the file is
251 parsed.  Block definitions allow the reader to efficiently skip blocks
252 in constant time if the reader wants a summary of blocks, or if it wants to
253 efficiently skip data they do not understand.  The LLVM IR reader uses this
254 mechanism to skip function bodies, lazily reading them on demand.
255 </p>
256
257 <p>
258 When reading and encoding the stream, several properties are maintained for the
259 block.  In particular, each block maintains:
260 </p>
261
262 <ol>
263 <li>A current abbrev id width.  This value starts at 2, and is set every time a
264     block record is entered.  The block entry specifies the abbrev id width for
265     the body of the block.</li>
266
267 <li>A set of abbreviations.  Abbreviations may be defined within a block, in
268     which case they are only defined in that block (neither subblocks nor
269     enclosing blocks see the abbreviation).  Abbreviations can also be defined
270     inside a <a href="#BLOCKINFO">BLOCKINFO</a> block, in which case they are
271     defined in all blocks that match the ID that the BLOCKINFO block is describing.
272 </li>
273 </ol>
274
275 <p>As sub blocks are entered, these properties are saved and the new sub-block
276 has its own set of abbreviations, and its own abbrev id width.  When a sub-block
277 is popped, the saved values are restored.</p>
278
279 </div>
280
281 <!-- _______________________________________________________________________ -->
282 <div class="doc_subsubsection"> <a name="ENTER_SUBBLOCK">ENTER_SUBBLOCK
283 Encoding</a></div>
284
285 <div class="doc_text">
286
287 <p><tt>[ENTER_SUBBLOCK, blockid<sub>vbr8</sub>, newabbrevlen<sub>vbr4</sub>,
288      &lt;align32bits&gt;, blocklen<sub>32</sub>]</tt></p>
289
290 <p>
291 The ENTER_SUBBLOCK abbreviation ID specifies the start of a new block record.
292 The <tt>blockid</tt> value is encoded as a 8-bit VBR identifier, and indicates
293 the type of block being entered (which can be a <a href="#stdblocks">standard
294 block</a> or an application-specific block).  The
295 <tt>newabbrevlen</tt> value is a 4-bit VBR which specifies the
296 abbrev id width for the sub-block.  The <tt>blocklen</tt> is a 32-bit aligned
297 value that specifies the size of the subblock, in 32-bit words.  This value
298 allows the reader to skip over the entire block in one jump.
299 </p>
300
301 </div>
302
303 <!-- _______________________________________________________________________ -->
304 <div class="doc_subsubsection"> <a name="END_BLOCK">END_BLOCK
305 Encoding</a></div>
306
307 <div class="doc_text">
308
309 <p><tt>[END_BLOCK, &lt;align32bits&gt;]</tt></p>
310
311 <p>
312 The END_BLOCK abbreviation ID specifies the end of the current block record.
313 Its end is aligned to 32-bits to ensure that the size of the block is an even
314 multiple of 32-bits.</p>
315
316 </div>
317
318
319
320 <!-- ======================================================================= -->
321 <div class="doc_subsection"><a name="datarecord">Data Records</a>
322 </div>
323
324 <div class="doc_text">
325 <p>
326 Data records consist of a record code and a number of (up to) 64-bit integer
327 values.  The interpretation of the code and values is application specific and
328 there are multiple different ways to encode a record (with an unabbrev record
329 or with an abbreviation).  In the LLVM IR format, for example, there is a record
330 which encodes the target triple of a module.  The code is MODULE_CODE_TRIPLE,
331 and the values of the record are the ascii codes for the characters in the
332 string.</p>
333
334 </div>
335
336 <!-- _______________________________________________________________________ -->
337 <div class="doc_subsubsection"> <a name="UNABBREV_RECORD">UNABBREV_RECORD
338 Encoding</a></div>
339
340 <div class="doc_text">
341
342 <p><tt>[UNABBREV_RECORD, code<sub>vbr6</sub>, numops<sub>vbr6</sub>,
343        op0<sub>vbr6</sub>, op1<sub>vbr6</sub>, ...]</tt></p>
344
345 <p>An UNABBREV_RECORD provides a default fallback encoding, which is both
346 completely general and also extremely inefficient.  It can describe an arbitrary
347 record, by emitting the code and operands as vbrs.</p>
348
349 <p>For example, emitting an LLVM IR target triple as an unabbreviated record
350 requires emitting the UNABBREV_RECORD abbrevid, a vbr6 for the
351 MODULE_CODE_TRIPLE code, a vbr6 for the length of the string (which is equal to
352 the number of operands), and a vbr6 for each character.  Since there are no
353 letters with value less than 32, each letter would need to be emitted as at
354 least a two-part VBR, which means that each letter would require at least 12
355 bits.  This is not an efficient encoding, but it is fully general.</p>
356
357 </div>
358
359 <!-- _______________________________________________________________________ -->
360 <div class="doc_subsubsection"> <a name="abbrev_records">Abbreviated Record
361 Encoding</a></div>
362
363 <div class="doc_text">
364
365 <p><tt>[&lt;abbrevid&gt;, fields...]</tt></p>
366
367 <p>An abbreviated record is a abbreviation id followed by a set of fields that
368 are encoded according to the <a href="#abbreviations">abbreviation 
369 definition</a>.  This allows records to be encoded significantly more densely
370 than records encoded with the <a href="#UNABBREV_RECORD">UNABBREV_RECORD</a>
371 type, and allows the abbreviation types to be specified in the stream itself,
372 which allows the files to be completely self describing.  The actual encoding
373 of abbreviations is defined below.
374 </p>
375
376 </div>
377
378 <!-- ======================================================================= -->
379 <div class="doc_subsection"><a name="abbreviations">Abbreviations</a>
380 </div>
381
382 <div class="doc_text">
383 <p>
384 Abbreviations are an important form of compression for bitstreams.  The idea is
385 to specify a dense encoding for a class of records once, then use that encoding
386 to emit many records.  It takes space to emit the encoding into the file, but
387 the space is recouped (hopefully plus some) when the records that use it are
388 emitted.
389 </p>
390
391 <p>
392 Abbreviations can be determined dynamically per client, per file.  Since the
393 abbreviations are stored in the bitstream itself, different streams of the same
394 format can contain different sets of abbreviations if the specific stream does
395 not need it.  As a concrete example, LLVM IR files usually emit an abbreviation
396 for binary operators.  If a specific LLVM module contained no or few binary
397 operators, the abbreviation does not need to be emitted.
398 </p>
399 </div>
400
401 <!-- _______________________________________________________________________ -->
402 <div class="doc_subsubsection"><a name="DEFINE_ABBREV">DEFINE_ABBREV
403  Encoding</a></div>
404
405 <div class="doc_text">
406
407 <p><tt>[DEFINE_ABBREV, numabbrevops<sub>vbr5</sub>, abbrevop0, abbrevop1,
408  ...]</tt></p>
409
410 <p>A DEFINE_ABBREV record adds an abbreviation to the list of currently
411 defined abbreviations in the scope of this block.  This definition only
412 exists inside this immediate block -- it is not visible in subblocks or
413 enclosing blocks.
414 Abbreviations are implicitly assigned IDs
415 sequentially starting from 4 (the first application-defined abbreviation ID).
416 Any abbreviations defined in a BLOCKINFO record receive IDs first, in order,
417 followed by any abbreviations defined within the block itself.
418 Abbreviated data records reference this ID to indicate what abbreviation
419 they are invoking.</p>
420
421 <p>An abbreviation definition consists of the DEFINE_ABBREV abbrevid followed
422 by a VBR that specifies the number of abbrev operands, then the abbrev
423 operands themselves.  Abbreviation operands come in three forms.  They all start
424 with a single bit that indicates whether the abbrev operand is a literal operand
425 (when the bit is 1) or an encoding operand (when the bit is 0).</p>
426
427 <ol>
428 <li>Literal operands - <tt>[1<sub>1</sub>, litvalue<sub>vbr8</sub>]</tt> -
429 Literal operands specify that the value in the result
430 is always a single specific value.  This specific value is emitted as a vbr8
431 after the bit indicating that it is a literal operand.</li>
432 <li>Encoding info without data - <tt>[0<sub>1</sub>, encoding<sub>3</sub>]</tt>
433  - Operand encodings that do not have extra data are just emitted as their code.
434 </li>
435 <li>Encoding info with data - <tt>[0<sub>1</sub>, encoding<sub>3</sub>, 
436 value<sub>vbr5</sub>]</tt> - Operand encodings that do have extra data are
437 emitted as their code, followed by the extra data.
438 </li>
439 </ol>
440
441 <p>The possible operand encodings are:</p>
442
443 <ul>
444 <li>1 - Fixed - The field should be emitted as a <a 
445     href="#fixedwidth">fixed-width value</a>, whose width
446     is specified by the operand's extra data.</li>
447 <li>2 - VBR - The field should be emitted as a <a 
448     href="#variablewidth">variable-width value</a>, whose width
449     is specified by the operand's extra data.</li>
450 <li>3 - Array - This field is an array of values.  The array operand has no
451     extra data, but expects another operand to follow it which indicates the
452     element type of the array.  When reading an array in an abbreviated record,
453     the first integer is a vbr6 that indicates the array length, followed by
454     the encoded elements of the array.  An array may only occur as the last
455     operand of an abbreviation (except for the one final operand that gives
456     the array's type).</li>
457 <li>4 - Char6 - This field should be emitted as a <a href="#char6">char6-encoded
458     value</a>.  This operand type takes no extra data.</li>
459 </ul>
460
461 <p>For example, target triples in LLVM modules are encoded as a record of the
462 form <tt>[TRIPLE, 'a', 'b', 'c', 'd']</tt>.  Consider if the bitstream emitted
463 the following abbrev entry:</p>
464
465 <ul>
466 <li><tt>[0, Fixed, 4]</tt></li>
467 <li><tt>[0, Array]</tt></li>
468 <li><tt>[0, Char6]</tt></li>
469 </ul>
470
471 <p>When emitting a record with this abbreviation, the above entry would be
472 emitted as:</p>
473
474 <p><tt>[4<sub>abbrevwidth</sub>, 2<sub>4</sub>, 4<sub>vbr6</sub>,
475    0<sub>6</sub>, 1<sub>6</sub>, 2<sub>6</sub>, 3<sub>6</sub>]</tt></p>
476
477 <p>These values are:</p>
478
479 <ol>
480 <li>The first value, 4, is the abbreviation ID for this abbreviation.</li>
481 <li>The second value, 2, is the code for TRIPLE in LLVM IR files.</li>
482 <li>The third value, 4, is the length of the array.</li>
483 <li>The rest of the values are the char6 encoded values for "abcd".</li>
484 </ol>
485
486 <p>With this abbreviation, the triple is emitted with only 37 bits (assuming a
487 abbrev id width of 3).  Without the abbreviation, significantly more space would
488 be required to emit the target triple.  Also, since the TRIPLE value is not
489 emitted as a literal in the abbreviation, the abbreviation can also be used for
490 any other string value.
491 </p>
492
493 </div>
494
495 <!-- ======================================================================= -->
496 <div class="doc_subsection"><a name="stdblocks">Standard Blocks</a>
497 </div>
498
499 <div class="doc_text">
500
501 <p>
502 In addition to the basic block structure and record encodings, the bitstream
503 also defines specific builtin block types.  These block types specify how the
504 stream is to be decoded or other metadata.  In the future, new standard blocks
505 may be added.  Block IDs 0-7 are reserved for standard blocks.
506 </p>
507
508 </div>
509
510 <!-- _______________________________________________________________________ -->
511 <div class="doc_subsubsection"><a name="BLOCKINFO">#0 - BLOCKINFO
512 Block</a></div>
513
514 <div class="doc_text">
515
516 <p>The BLOCKINFO block allows the description of metadata for other blocks.  The
517   currently specified records are:</p>
518  
519 <ul>
520 <li><tt>[SETBID (#1), blockid]</tt></li>
521 <li><tt>[DEFINE_ABBREV, ...]</tt></li>
522 </ul>
523
524 <p>
525 The SETBID record indicates which block ID is being described.  SETBID
526 records can occur multiple times throughout the block to change which
527 block ID is being described.  There must be a SETBID record prior to
528 any other records.
529 </p>
530
531 <p>
532 Standard DEFINE_ABBREV records can occur inside BLOCKINFO blocks, but unlike
533 their occurrence in normal blocks, the abbreviation is defined for blocks
534 matching the block ID we are describing, <i>not</i> the BLOCKINFO block itself.
535 The abbreviations defined in BLOCKINFO blocks receive abbreviation ids
536 as described in <a href="#DEFINE_ABBREV">DEFINE_ABBREV</a>.
537 </p>
538
539 <p>
540 Note that although the data in BLOCKINFO blocks is described as "metadata," the
541 abbreviations they contain are essential for parsing records from the
542 corresponding blocks.  It is not safe to skip them.
543 </p>
544
545 </div>
546
547 <!-- *********************************************************************** -->
548 <div class="doc_section"> <a name="llvmir">LLVM IR Encoding</a></div>
549 <!-- *********************************************************************** -->
550
551 <div class="doc_text">
552
553 <p>LLVM IR is encoded into a bitstream by defining blocks and records.  It uses
554 blocks for things like constant pools, functions, symbol tables, etc.  It uses
555 records for things like instructions, global variable descriptors, type
556 descriptions, etc.  This document does not describe the set of abbreviations
557 that the writer uses, as these are fully self-described in the file, and the
558 reader is not allowed to build in any knowledge of this.</p>
559
560 </div>
561
562 <!-- ======================================================================= -->
563 <div class="doc_subsection"><a name="basics">Basics</a>
564 </div>
565
566 <!-- _______________________________________________________________________ -->
567 <div class="doc_subsubsection"><a name="ir_magic">LLVM IR Magic Number</a></div>
568
569 <div class="doc_text">
570
571 <p>
572 The magic number for LLVM IR files is:
573 </p>
574
575 <p><tt>[0x0<sub>4</sub>, 0xC<sub>4</sub>, 0xE<sub>4</sub>, 0xD<sub>4</sub>]</tt></p>
576
577 <p>When combined with the bitcode magic number and viewed as bytes, this is "BC 0xC0DE".</p>
578
579 </div>
580
581 <!-- _______________________________________________________________________ -->
582 <div class="doc_subsubsection"><a name="ir_signed_vbr">Signed VBRs</a></div>
583
584 <div class="doc_text">
585
586 <p>
587 <a href="#variablewidth">Variable Width Integers</a> are an efficient way to
588 encode arbitrary sized unsigned values, but is an extremely inefficient way to
589 encode signed values (as signed values are otherwise treated as maximally large
590 unsigned values).</p>
591
592 <p>As such, signed vbr values of a specific width are emitted as follows:</p>
593
594 <ul>
595 <li>Positive values are emitted as vbrs of the specified width, but with their
596     value shifted left by one.</li>
597 <li>Negative values are emitted as vbrs of the specified width, but the negated
598     value is shifted left by one, and the low bit is set.</li>
599 </ul>
600
601 <p>With this encoding, small positive and small negative values can both be
602 emitted efficiently.</p>
603
604 </div>
605
606
607 <!-- _______________________________________________________________________ -->
608 <div class="doc_subsubsection"><a name="ir_blocks">LLVM IR Blocks</a></div>
609
610 <div class="doc_text">
611
612 <p>
613 LLVM IR is defined with the following blocks:
614 </p>
615
616 <ul>
617 <li>8  - MODULE_BLOCK - This is the top-level block that contains the
618     entire module, and describes a variety of per-module information.</li>
619 <li>9  - PARAMATTR_BLOCK - This enumerates the parameter attributes.</li>
620 <li>10 - TYPE_BLOCK - This describes all of the types in the module.</li>
621 <li>11 - CONSTANTS_BLOCK - This describes constants for a module or
622     function.</li>
623 <li>12 - FUNCTION_BLOCK - This describes a function body.</li>
624 <li>13 - TYPE_SYMTAB_BLOCK - This describes the type symbol table.</li>
625 <li>14 - VALUE_SYMTAB_BLOCK - This describes a value symbol table.</li>
626 </ul>
627
628 </div>
629
630 <!-- ======================================================================= -->
631 <div class="doc_subsection"><a name="MODULE_BLOCK">MODULE_BLOCK Contents</a>
632 </div>
633
634 <div class="doc_text">
635
636 <p>
637 </p>
638
639 </div>
640
641
642 <!-- *********************************************************************** -->
643 <hr>
644 <address> <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
645  src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"></a>
646 <a href="http://validator.w3.org/check/referer"><img
647  src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!"></a>
648  <a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
649 <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
650 Last modified: $Date$
651 </address>
652 </body>
653 </html>