1 //===-- llvm/Bytecode/Format.h - VM bytecode file format info ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header defines intrinsic constants that are useful to libraries that
11 // need to hack on bytecode files directly, like the reader and writer.
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_BYTECODE_FORMAT_H
16 #define LLVM_BYTECODE_FORMAT_H
20 class BytecodeFormat { // Throw the constants into a poorman's namespace...
21 BytecodeFormat(); // do not implement
23 /// The the identifier and the size of the block are encoded into a single
24 /// vbr_uint32 with 5 bits for the block identifier and 27-bits for block
25 /// length. This limits blocks to a maximum of
26 /// 128MBytes of data, and block types to 31 which should be sufficient
27 /// for the foreseeable usage. Because the values of block identifiers MUST
28 /// fit within 5 bits (values 1-31), this enumeration is used to ensure
29 /// smaller values are used for 1.3 and subsequent bytecode versions.
30 /// @brief The block number identifiers used in LLVM 1.3 bytecode
32 enum BytecodeBlockIdentifiers {
34 Reserved_DoNotUse = 0, ///< Zero value is forbidden, do not use.
35 ModuleBlockID = 1, ///< Module block that contains other blocks.
36 FunctionBlockID = 2, ///< Function block identifier
37 ConstantPoolBlockID = 3, ///< Constant pool identifier
38 ValueSymbolTableBlockID= 4, ///< Value Symbol table identifier
39 ModuleGlobalInfoBlockID= 5, ///< Module global info identifier
40 GlobalTypePlaneBlockID = 6, ///< Global type plan identifier
41 InstructionListBlockID = 7, ///< All instructions in a function
43 //CompactionTableBlockID = 8, << Placeholder for removed block type
45 TypeSymbolTableBlockID = 9, ///< Value Symbol table identifier
46 // Not a block id, just used to count them
51 } // End llvm namespace