1 //===- LLVMBitCodes.h - Enum values for the LLVM bitcode format -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by Chris Lattner and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This header defines Bitcode enum values for LLVM IR bitcode files.
12 // The enum values defined in this file should be considered permanent. If
13 // new features are added, they should have values added at the end of the
16 //===----------------------------------------------------------------------===//
18 #ifndef LLVM_BITCODE_LLVMBITCODES_H
19 #define LLVM_BITCODE_LLVMBITCODES_H
21 #include "llvm/Bitcode/BitCodes.h"
25 // The only top-level block type defined is for a module.
30 // Module sub-block id's
32 MODULEINFO_BLOCK_ID = 2,
33 GLOBALCONSTANTS_BLOCK_ID = 3,
34 FUNCTION_BLOCK_ID = 4,
35 TYPE_SYMTAB_BLOCK_ID = 5,
36 VALUE_SYMTAB_BLOCK_ID = 6
40 /// MODULE blocks have a number of optional fields and subblocks.
42 MODULE_CODE_VERSION = 1, // VERSION: [version#]
43 MODULE_CODE_TRIPLE = 2, // TRIPLE: [strlen, strchr x N]
44 MODULE_CODE_DATALAYOUT = 3, // DATALAYOUT: [strlen, strchr x N]
45 MODULE_CODE_ASM = 4, // ASM: [strlen, strchr x N]
46 MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strlen, strchr x N]
47 MODULE_CODE_DEPLIB = 6, // DEPLIB: [strlen, strchr x N]
49 // GLOBALVAR: [type, isconst, initid,
50 // linkage, alignment, section, visibility, threadlocal]
51 MODULE_CODE_GLOBALVAR = 7,
53 // FUNCTION: [type, callingconv, isproto, linkage, alignment, section,
55 MODULE_CODE_FUNCTION = 8
58 /// TYPE blocks have codes for each type primitive they use.
60 TYPE_CODE_NUMENTRY = 1, // TYPE_CODE_NUMENTRY: [numentries]
61 TYPE_CODE_META = 2, // TYPE_CODE_META: [metacode]... - Future use
64 TYPE_CODE_VOID = 3, // VOID
65 TYPE_CODE_FLOAT = 4, // FLOAT
66 TYPE_CODE_DOUBLE = 5, // DOUBLE
67 TYPE_CODE_LABEL = 6, // LABEL
68 TYPE_CODE_OPAQUE = 7, // OPAQUE
69 TYPE_CODE_INTEGER = 8, // INTEGER: [width]
70 TYPE_CODE_POINTER = 9, // POINTER: [pointee type]
71 TYPE_CODE_FUNCTION = 10, // FUNCTION: [vararg, retty, #pararms, paramty N]
72 TYPE_CODE_STRUCT = 11, // STRUCT: [ispacked, #elts, eltty x N]
73 TYPE_CODE_ARRAY = 12, // ARRAY: [numelts, eltty]
74 TYPE_CODE_VECTOR = 13 // VECTOR: [numelts, eltty]
75 // Any other type code is assumed to be an unknown type.
79 // The type symbol table only has one code (TST_ENTRY_CODE).
80 enum TypeSymtabCodes {
81 TST_ENTRY_CODE = 1 // TST_ENTRY: [typeid, namelen, namechar x N]
84 // The value symbol table only has one code (VST_ENTRY_CODE).
85 enum ValueSymtabCodes {
86 VST_ENTRY_CODE = 1 // VST_ENTRY: [valid, namelen, namechar x N]
89 } // End bitc namespace
90 } // End llvm namespace