LLVM  3.7.0
LLVMBitCodes.h
Go to the documentation of this file.
1 //===- LLVMBitCodes.h - Enum values for the LLVM bitcode format -*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This header defines Bitcode enum values for LLVM IR bitcode files.
11 //
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
14 // respective lists.
15 //
16 //===----------------------------------------------------------------------===//
17 
18 #ifndef LLVM_BITCODE_LLVMBITCODES_H
19 #define LLVM_BITCODE_LLVMBITCODES_H
20 
21 #include "llvm/Bitcode/BitCodes.h"
22 
23 namespace llvm {
24 namespace bitc {
25  // The only top-level block type defined is for a module.
26  enum BlockIDs {
27  // Blocks
29 
30  // Module sub-block id's.
33 
36 
38 
42 
44 
46  };
47 
48 
49  /// MODULE blocks have a number of optional fields and subblocks.
50  enum ModuleCodes {
51  MODULE_CODE_VERSION = 1, // VERSION: [version#]
52  MODULE_CODE_TRIPLE = 2, // TRIPLE: [strchr x N]
53  MODULE_CODE_DATALAYOUT = 3, // DATALAYOUT: [strchr x N]
54  MODULE_CODE_ASM = 4, // ASM: [strchr x N]
55  MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strchr x N]
56 
57  // FIXME: Remove DEPLIB in 4.0.
58  MODULE_CODE_DEPLIB = 6, // DEPLIB: [strchr x N]
59 
60  // GLOBALVAR: [pointer type, isconst, initid,
61  // linkage, alignment, section, visibility, threadlocal]
63 
64  // FUNCTION: [type, callingconv, isproto, linkage, paramattrs, alignment,
65  // section, visibility, gc, unnamed_addr]
67 
68  // ALIAS: [alias type, aliasee val#, linkage, visibility]
70 
71  // MODULE_CODE_PURGEVALS: [numvals]
73 
74  MODULE_CODE_GCNAME = 11, // GCNAME: [strchr x N]
75  MODULE_CODE_COMDAT = 12, // COMDAT: [selection_kind, name]
76  };
77 
78  /// PARAMATTR blocks have code for defining a parameter attribute set.
80  // FIXME: Remove `PARAMATTR_CODE_ENTRY_OLD' in 4.0
81  PARAMATTR_CODE_ENTRY_OLD = 1, // ENTRY: [paramidx0, attr0,
82  // paramidx1, attr1...]
83  PARAMATTR_CODE_ENTRY = 2, // ENTRY: [paramidx0, attrgrp0,
84  // paramidx1, attrgrp1, ...]
85  PARAMATTR_GRP_CODE_ENTRY = 3 // ENTRY: [id, attr0, att1, ...]
86  };
87 
88  /// TYPE blocks have codes for each type primitive they use.
89  enum TypeCodes {
90  TYPE_CODE_NUMENTRY = 1, // NUMENTRY: [numentries]
91 
92  // Type Codes
93  TYPE_CODE_VOID = 2, // VOID
94  TYPE_CODE_FLOAT = 3, // FLOAT
95  TYPE_CODE_DOUBLE = 4, // DOUBLE
96  TYPE_CODE_LABEL = 5, // LABEL
97  TYPE_CODE_OPAQUE = 6, // OPAQUE
98  TYPE_CODE_INTEGER = 7, // INTEGER: [width]
99  TYPE_CODE_POINTER = 8, // POINTER: [pointee type]
100 
101  TYPE_CODE_FUNCTION_OLD = 9, // FUNCTION: [vararg, attrid, retty,
102  // paramty x N]
103 
104  TYPE_CODE_HALF = 10, // HALF
105 
106  TYPE_CODE_ARRAY = 11, // ARRAY: [numelts, eltty]
107  TYPE_CODE_VECTOR = 12, // VECTOR: [numelts, eltty]
108 
109  // These are not with the other floating point types because they're
110  // a late addition, and putting them in the right place breaks
111  // binary compatibility.
112  TYPE_CODE_X86_FP80 = 13, // X86 LONG DOUBLE
113  TYPE_CODE_FP128 = 14, // LONG DOUBLE (112 bit mantissa)
114  TYPE_CODE_PPC_FP128= 15, // PPC LONG DOUBLE (2 doubles)
115 
116  TYPE_CODE_METADATA = 16, // METADATA
117 
118  TYPE_CODE_X86_MMX = 17, // X86 MMX
119 
120  TYPE_CODE_STRUCT_ANON = 18, // STRUCT_ANON: [ispacked, eltty x N]
121  TYPE_CODE_STRUCT_NAME = 19, // STRUCT_NAME: [strchr x N]
122  TYPE_CODE_STRUCT_NAMED = 20,// STRUCT_NAMED: [ispacked, eltty x N]
123 
124  TYPE_CODE_FUNCTION = 21 // FUNCTION: [vararg, retty, paramty x N]
125  };
126 
127  // The type symbol table only has one code (TST_ENTRY_CODE).
129  TST_CODE_ENTRY = 1 // TST_ENTRY: [typeid, namechar x N]
130  };
131 
132  // The value symbol table only has one code (VST_ENTRY_CODE).
134  VST_CODE_ENTRY = 1, // VST_ENTRY: [valid, namechar x N]
135  VST_CODE_BBENTRY = 2 // VST_BBENTRY: [bbid, namechar x N]
136  };
137 
139  METADATA_STRING = 1, // MDSTRING: [values]
140  METADATA_VALUE = 2, // VALUE: [type num, value num]
141  METADATA_NODE = 3, // NODE: [n x md num]
142  METADATA_NAME = 4, // STRING: [values]
143  METADATA_DISTINCT_NODE = 5, // DISTINCT_NODE: [n x md num]
144  METADATA_KIND = 6, // [n x [id, name]]
145  METADATA_LOCATION = 7, // [distinct, line, col, scope, inlined-at?]
146  METADATA_OLD_NODE = 8, // OLD_NODE: [n x (type num, value num)]
147  METADATA_OLD_FN_NODE = 9, // OLD_FN_NODE: [n x (type num, value num)]
148  METADATA_NAMED_NODE = 10, // NAMED_NODE: [n x mdnodes]
149  METADATA_ATTACHMENT = 11, // [m x [value, [n x [id, mdnode]]]
150  METADATA_GENERIC_DEBUG = 12, // [distinct, tag, vers, header, n x md num]
151  METADATA_SUBRANGE = 13, // [distinct, count, lo]
152  METADATA_ENUMERATOR = 14, // [distinct, value, name]
153  METADATA_BASIC_TYPE = 15, // [distinct, tag, name, size, align, enc]
154  METADATA_FILE = 16, // [distinct, filename, directory]
155  METADATA_DERIVED_TYPE = 17, // [distinct, ...]
156  METADATA_COMPOSITE_TYPE= 18, // [distinct, ...]
157  METADATA_SUBROUTINE_TYPE=19, // [distinct, flags, types]
158  METADATA_COMPILE_UNIT = 20, // [distinct, ...]
159  METADATA_SUBPROGRAM = 21, // [distinct, ...]
160  METADATA_LEXICAL_BLOCK = 22, // [distinct, scope, file, line, column]
161  METADATA_LEXICAL_BLOCK_FILE=23,//[distinct, scope, file, discriminator]
162  METADATA_NAMESPACE = 24, // [distinct, scope, file, name, line]
163  METADATA_TEMPLATE_TYPE = 25, // [distinct, scope, name, type, ...]
164  METADATA_TEMPLATE_VALUE= 26, // [distinct, scope, name, type, value, ...]
165  METADATA_GLOBAL_VAR = 27, // [distinct, ...]
166  METADATA_LOCAL_VAR = 28, // [distinct, ...]
167  METADATA_EXPRESSION = 29, // [distinct, n x element]
168  METADATA_OBJC_PROPERTY = 30, // [distinct, name, file, line, ...]
169  METADATA_IMPORTED_ENTITY=31, // [distinct, tag, scope, entity, line, name]
170  METADATA_MODULE=32, // [distinct, scope, name, ...]
171  };
172 
173  // The constants block (CONSTANTS_BLOCK_ID) describes emission for each
174  // constant and maintains an implicit current type value.
176  CST_CODE_SETTYPE = 1, // SETTYPE: [typeid]
177  CST_CODE_NULL = 2, // NULL
178  CST_CODE_UNDEF = 3, // UNDEF
179  CST_CODE_INTEGER = 4, // INTEGER: [intval]
180  CST_CODE_WIDE_INTEGER = 5, // WIDE_INTEGER: [n x intval]
181  CST_CODE_FLOAT = 6, // FLOAT: [fpval]
182  CST_CODE_AGGREGATE = 7, // AGGREGATE: [n x value number]
183  CST_CODE_STRING = 8, // STRING: [values]
184  CST_CODE_CSTRING = 9, // CSTRING: [values]
185  CST_CODE_CE_BINOP = 10, // CE_BINOP: [opcode, opval, opval]
186  CST_CODE_CE_CAST = 11, // CE_CAST: [opcode, opty, opval]
187  CST_CODE_CE_GEP = 12, // CE_GEP: [n x operands]
188  CST_CODE_CE_SELECT = 13, // CE_SELECT: [opval, opval, opval]
189  CST_CODE_CE_EXTRACTELT = 14, // CE_EXTRACTELT: [opty, opval, opval]
190  CST_CODE_CE_INSERTELT = 15, // CE_INSERTELT: [opval, opval, opval]
191  CST_CODE_CE_SHUFFLEVEC = 16, // CE_SHUFFLEVEC: [opval, opval, opval]
192  CST_CODE_CE_CMP = 17, // CE_CMP: [opty, opval, opval, pred]
193  CST_CODE_INLINEASM_OLD = 18, // INLINEASM: [sideeffect|alignstack,
194  // asmstr,conststr]
195  CST_CODE_CE_SHUFVEC_EX = 19, // SHUFVEC_EX: [opty, opval, opval, opval]
196  CST_CODE_CE_INBOUNDS_GEP = 20,// INBOUNDS_GEP: [n x operands]
197  CST_CODE_BLOCKADDRESS = 21, // CST_CODE_BLOCKADDRESS [fnty, fnval, bb#]
198  CST_CODE_DATA = 22, // DATA: [n x elements]
199  CST_CODE_INLINEASM = 23 // INLINEASM: [sideeffect|alignstack|
200  // asmdialect,asmstr,conststr]
201  };
202 
203  /// CastOpcodes - These are values used in the bitcode files to encode which
204  /// cast a CST_CODE_CE_CAST or a XXX refers to. The values of these enums
205  /// have no fixed relation to the LLVM IR enum values. Changing these will
206  /// break compatibility with old files.
207  enum CastOpcodes {
221  };
222 
223  /// BinaryOpcodes - These are values used in the bitcode files to encode which
224  /// binop a CST_CODE_CE_BINOP or a XXX refers to. The values of these enums
225  /// have no fixed relation to the LLVM IR enum values. Changing these will
226  /// break compatibility with old files.
232  BINOP_SDIV = 4, // overloaded for FP
234  BINOP_SREM = 6, // overloaded for FP
238  BINOP_AND = 10,
239  BINOP_OR = 11,
241  };
242 
243  /// These are values used in the bitcode files to encode AtomicRMW operations.
244  /// The values of these enums have no fixed relation to the LLVM IR enum
245  /// values. Changing these will break compatibility with old files.
247  RMW_XCHG = 0,
248  RMW_ADD = 1,
249  RMW_SUB = 2,
250  RMW_AND = 3,
251  RMW_NAND = 4,
252  RMW_OR = 5,
253  RMW_XOR = 6,
254  RMW_MAX = 7,
255  RMW_MIN = 8,
256  RMW_UMAX = 9,
257  RMW_UMIN = 10
258  };
259 
260  /// OverflowingBinaryOperatorOptionalFlags - Flags for serializing
261  /// OverflowingBinaryOperator's SubclassOptionalData contents.
265  };
266 
267  /// PossiblyExactOperatorOptionalFlags - Flags for serializing
268  /// PossiblyExactOperator's SubclassOptionalData contents.
271  };
272 
273  /// Encoded AtomicOrdering values.
282  };
283 
284  /// Encoded SynchronizationScope values.
288  };
289 
290  // The function body block (FUNCTION_BLOCK_ID) describes function bodies. It
291  // can contain a constant block (CONSTANTS_BLOCK_ID).
293  FUNC_CODE_DECLAREBLOCKS = 1, // DECLAREBLOCKS: [n]
294 
295  FUNC_CODE_INST_BINOP = 2, // BINOP: [opcode, ty, opval, opval]
296  FUNC_CODE_INST_CAST = 3, // CAST: [opcode, ty, opty, opval]
297  FUNC_CODE_INST_GEP_OLD = 4, // GEP: [n x operands]
298  FUNC_CODE_INST_SELECT = 5, // SELECT: [ty, opval, opval, opval]
299  FUNC_CODE_INST_EXTRACTELT = 6, // EXTRACTELT: [opty, opval, opval]
300  FUNC_CODE_INST_INSERTELT = 7, // INSERTELT: [ty, opval, opval, opval]
301  FUNC_CODE_INST_SHUFFLEVEC = 8, // SHUFFLEVEC: [ty, opval, opval, opval]
302  FUNC_CODE_INST_CMP = 9, // CMP: [opty, opval, opval, pred]
303 
304  FUNC_CODE_INST_RET = 10, // RET: [opty,opval<both optional>]
305  FUNC_CODE_INST_BR = 11, // BR: [bb#, bb#, cond] or [bb#]
306  FUNC_CODE_INST_SWITCH = 12, // SWITCH: [opty, op0, op1, ...]
307  FUNC_CODE_INST_INVOKE = 13, // INVOKE: [attr, fnty, op0,op1, ...]
308  // 14 is unused.
309  FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE
310 
311  FUNC_CODE_INST_PHI = 16, // PHI: [ty, val0,bb0, ...]
312  // 17 is unused.
313  // 18 is unused.
314  FUNC_CODE_INST_ALLOCA = 19, // ALLOCA: [instty, opty, op, align]
315  FUNC_CODE_INST_LOAD = 20, // LOAD: [opty, op, align, vol]
316  // 21 is unused.
317  // 22 is unused.
318  FUNC_CODE_INST_VAARG = 23, // VAARG: [valistty, valist, instty]
319  // This store code encodes the pointer type, rather than the value type
320  // this is so information only available in the pointer type (e.g. address
321  // spaces) is retained.
322  FUNC_CODE_INST_STORE_OLD = 24, // STORE: [ptrty,ptr,val, align, vol]
323  // 25 is unused.
324  FUNC_CODE_INST_EXTRACTVAL = 26, // EXTRACTVAL: [n x operands]
325  FUNC_CODE_INST_INSERTVAL = 27, // INSERTVAL: [n x operands]
326  // fcmp/icmp returning Int1TY or vector of Int1Ty. Same as CMP, exists to
327  // support legacy vicmp/vfcmp instructions.
328  FUNC_CODE_INST_CMP2 = 28, // CMP2: [opty, opval, opval, pred]
329  // new select on i1 or [N x i1]
330  FUNC_CODE_INST_VSELECT = 29, // VSELECT: [ty,opval,opval,predty,pred]
331  FUNC_CODE_INST_INBOUNDS_GEP_OLD = 30, // INBOUNDS_GEP: [n x operands]
332  FUNC_CODE_INST_INDIRECTBR = 31, // INDIRECTBR: [opty, op0, op1, ...]
333  // 32 is unused.
334  FUNC_CODE_DEBUG_LOC_AGAIN = 33, // DEBUG_LOC_AGAIN
335 
336  FUNC_CODE_INST_CALL = 34, // CALL: [attr, cc, fnty, fnid, args...]
337 
338  FUNC_CODE_DEBUG_LOC = 35, // DEBUG_LOC: [Line,Col,ScopeVal, IAVal]
339  FUNC_CODE_INST_FENCE = 36, // FENCE: [ordering, synchscope]
340  FUNC_CODE_INST_CMPXCHG_OLD = 37, // CMPXCHG: [ptrty,ptr,cmp,new, align, vol,
341  // ordering, synchscope]
342  FUNC_CODE_INST_ATOMICRMW = 38, // ATOMICRMW: [ptrty,ptr,val, operation,
343  // align, vol,
344  // ordering, synchscope]
345  FUNC_CODE_INST_RESUME = 39, // RESUME: [opval]
346  FUNC_CODE_INST_LANDINGPAD_OLD = 40, // LANDINGPAD: [ty,val,val,num,id0,val0...]
347  FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [opty, op, align, vol,
348  // ordering, synchscope]
349  FUNC_CODE_INST_STOREATOMIC_OLD = 42, // STORE: [ptrty,ptr,val, align, vol
350  // ordering, synchscope]
351  FUNC_CODE_INST_GEP = 43, // GEP: [inbounds, n x operands]
352  FUNC_CODE_INST_STORE = 44, // STORE: [ptrty,ptr,valty,val, align, vol]
353  FUNC_CODE_INST_STOREATOMIC = 45, // STORE: [ptrty,ptr,val, align, vol
354  FUNC_CODE_INST_CMPXCHG = 46, // CMPXCHG: [ptrty,ptr,valty,cmp,new, align,
355  // vol,ordering,synchscope]
356  FUNC_CODE_INST_LANDINGPAD = 47, // LANDINGPAD: [ty,val,num,id0,val0...]
357  };
358 
360  USELIST_CODE_DEFAULT = 1, // DEFAULT: [index..., value-id]
361  USELIST_CODE_BB = 2 // BB: [index..., bb-id]
362  };
363 
365  // = 0 is unused
411  };
412 
419  };
420 
421 } // End bitc namespace
422 } // End llvm namespace
423 
424 #endif
PossiblyExactOperatorOptionalFlags
PossiblyExactOperatorOptionalFlags - Flags for serializing PossiblyExactOperator's SubclassOptionalDa...
Definition: LLVMBitCodes.h:269
CastOpcodes
CastOpcodes - These are values used in the bitcode files to encode which cast a CST_CODE_CE_CAST or a...
Definition: LLVMBitCodes.h:207
AtomicSynchScopeCodes
Encoded SynchronizationScope values.
Definition: LLVMBitCodes.h:285
BinaryOpcodes
BinaryOpcodes - These are values used in the bitcode files to encode which binop a CST_CODE_CE_BINOP ...
Definition: LLVMBitCodes.h:227
AttributeCodes
PARAMATTR blocks have code for defining a parameter attribute set.
Definition: LLVMBitCodes.h:79
ComdatSelectionKindCodes
Definition: LLVMBitCodes.h:413
OverflowingBinaryOperatorOptionalFlags
OverflowingBinaryOperatorOptionalFlags - Flags for serializing OverflowingBinaryOperator's SubclassOp...
Definition: LLVMBitCodes.h:262
ModuleCodes
MODULE blocks have a number of optional fields and subblocks.
Definition: LLVMBitCodes.h:50
AtomicOrderingCodes
Encoded AtomicOrdering values.
Definition: LLVMBitCodes.h:274
TypeCodes
TYPE blocks have codes for each type primitive they use.
Definition: LLVMBitCodes.h:89
RMWOperations
These are values used in the bitcode files to encode AtomicRMW operations.
Definition: LLVMBitCodes.h:246