• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
28   MODULE_BLOCK_ID = FIRST_APPLICATION_BLOCKID,
29 
30   // Module sub-block id's.
31   PARAMATTR_BLOCK_ID,
32   PARAMATTR_GROUP_BLOCK_ID,
33 
34   CONSTANTS_BLOCK_ID,
35   FUNCTION_BLOCK_ID,
36 
37   // Block intended to contains information on the bitcode versioning.
38   // Can be used to provide better error messages when we fail to parse a
39   // bitcode file.
40   IDENTIFICATION_BLOCK_ID,
41 
42   VALUE_SYMTAB_BLOCK_ID,
43   METADATA_BLOCK_ID,
44   METADATA_ATTACHMENT_ID,
45 
46   TYPE_BLOCK_ID_NEW,
47 
48   USELIST_BLOCK_ID,
49 
50   MODULE_STRTAB_BLOCK_ID,
51   GLOBALVAL_SUMMARY_BLOCK_ID,
52 
53   OPERAND_BUNDLE_TAGS_BLOCK_ID,
54 
55   METADATA_KIND_BLOCK_ID
56 };
57 
58 /// Identification block contains a string that describes the producer details,
59 /// and an epoch that defines the auto-upgrade capability.
60 enum IdentificationCodes {
61   IDENTIFICATION_CODE_STRING = 1, // IDENTIFICATION:      [strchr x N]
62   IDENTIFICATION_CODE_EPOCH = 2,  // EPOCH:               [epoch#]
63 };
64 
65 /// The epoch that defines the auto-upgrade compatibility for the bitcode.
66 ///
67 /// LLVM guarantees in a major release that a minor release can read bitcode
68 /// generated by previous minor releases. We translate this by making the reader
69 /// accepting only bitcode with the same epoch, except for the X.0 release which
70 /// also accepts N-1.
71 enum { BITCODE_CURRENT_EPOCH = 0 };
72 
73 /// MODULE blocks have a number of optional fields and subblocks.
74 enum ModuleCodes {
75   MODULE_CODE_VERSION = 1,     // VERSION:     [version#]
76   MODULE_CODE_TRIPLE = 2,      // TRIPLE:      [strchr x N]
77   MODULE_CODE_DATALAYOUT = 3,  // DATALAYOUT:  [strchr x N]
78   MODULE_CODE_ASM = 4,         // ASM:         [strchr x N]
79   MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strchr x N]
80 
81   // FIXME: Remove DEPLIB in 4.0.
82   MODULE_CODE_DEPLIB = 6, // DEPLIB:      [strchr x N]
83 
84   // GLOBALVAR: [pointer type, isconst, initid,
85   //             linkage, alignment, section, visibility, threadlocal]
86   MODULE_CODE_GLOBALVAR = 7,
87 
88   // FUNCTION:  [type, callingconv, isproto, linkage, paramattrs, alignment,
89   //             section, visibility, gc, unnamed_addr]
90   MODULE_CODE_FUNCTION = 8,
91 
92   // ALIAS: [alias type, aliasee val#, linkage, visibility]
93   MODULE_CODE_ALIAS_OLD = 9,
94 
95   // MODULE_CODE_PURGEVALS: [numvals]
96   MODULE_CODE_PURGEVALS = 10,
97 
98   MODULE_CODE_GCNAME = 11, // GCNAME: [strchr x N]
99   MODULE_CODE_COMDAT = 12, // COMDAT: [selection_kind, name]
100 
101   MODULE_CODE_VSTOFFSET = 13, // VSTOFFSET: [offset]
102 
103   // ALIAS: [alias value type, addrspace, aliasee val#, linkage, visibility]
104   MODULE_CODE_ALIAS = 14,
105 
106   MODULE_CODE_METADATA_VALUES_UNUSED = 15,
107 
108   // SOURCE_FILENAME: [namechar x N]
109   MODULE_CODE_SOURCE_FILENAME = 16,
110 
111   // HASH: [5*i32]
112   MODULE_CODE_HASH = 17,
113 
114   // IFUNC: [ifunc value type, addrspace, resolver val#, linkage, visibility]
115   MODULE_CODE_IFUNC = 18,
116 };
117 
118 /// PARAMATTR blocks have code for defining a parameter attribute set.
119 enum AttributeCodes {
120   // FIXME: Remove `PARAMATTR_CODE_ENTRY_OLD' in 4.0
121   PARAMATTR_CODE_ENTRY_OLD = 1, // ENTRY: [paramidx0, attr0,
122                                 //         paramidx1, attr1...]
123   PARAMATTR_CODE_ENTRY = 2,     // ENTRY: [paramidx0, attrgrp0,
124                                 //         paramidx1, attrgrp1, ...]
125   PARAMATTR_GRP_CODE_ENTRY = 3  // ENTRY: [id, attr0, att1, ...]
126 };
127 
128 /// TYPE blocks have codes for each type primitive they use.
129 enum TypeCodes {
130   TYPE_CODE_NUMENTRY = 1, // NUMENTRY: [numentries]
131 
132   // Type Codes
133   TYPE_CODE_VOID = 2,    // VOID
134   TYPE_CODE_FLOAT = 3,   // FLOAT
135   TYPE_CODE_DOUBLE = 4,  // DOUBLE
136   TYPE_CODE_LABEL = 5,   // LABEL
137   TYPE_CODE_OPAQUE = 6,  // OPAQUE
138   TYPE_CODE_INTEGER = 7, // INTEGER: [width]
139   TYPE_CODE_POINTER = 8, // POINTER: [pointee type]
140 
141   TYPE_CODE_FUNCTION_OLD = 9, // FUNCTION: [vararg, attrid, retty,
142                               //            paramty x N]
143 
144   TYPE_CODE_HALF = 10, // HALF
145 
146   TYPE_CODE_ARRAY = 11,  // ARRAY: [numelts, eltty]
147   TYPE_CODE_VECTOR = 12, // VECTOR: [numelts, eltty]
148 
149   // These are not with the other floating point types because they're
150   // a late addition, and putting them in the right place breaks
151   // binary compatibility.
152   TYPE_CODE_X86_FP80 = 13,  // X86 LONG DOUBLE
153   TYPE_CODE_FP128 = 14,     // LONG DOUBLE (112 bit mantissa)
154   TYPE_CODE_PPC_FP128 = 15, // PPC LONG DOUBLE (2 doubles)
155 
156   TYPE_CODE_METADATA = 16, // METADATA
157 
158   TYPE_CODE_X86_MMX = 17, // X86 MMX
159 
160   TYPE_CODE_STRUCT_ANON = 18,  // STRUCT_ANON: [ispacked, eltty x N]
161   TYPE_CODE_STRUCT_NAME = 19,  // STRUCT_NAME: [strchr x N]
162   TYPE_CODE_STRUCT_NAMED = 20, // STRUCT_NAMED: [ispacked, eltty x N]
163 
164   TYPE_CODE_FUNCTION = 21, // FUNCTION: [vararg, retty, paramty x N]
165 
166   TYPE_CODE_TOKEN = 22 // TOKEN
167 };
168 
169 enum OperandBundleTagCode {
170   OPERAND_BUNDLE_TAG = 1, // TAG: [strchr x N]
171 };
172 
173 // The type symbol table only has one code (TST_ENTRY_CODE).
174 enum TypeSymtabCodes {
175   TST_CODE_ENTRY = 1 // TST_ENTRY: [typeid, namechar x N]
176 };
177 
178 // Value symbol table codes.
179 enum ValueSymtabCodes {
180   VST_CODE_ENTRY = 1,   // VST_ENTRY: [valueid, namechar x N]
181   VST_CODE_BBENTRY = 2, // VST_BBENTRY: [bbid, namechar x N]
182   VST_CODE_FNENTRY = 3, // VST_FNENTRY: [valueid, offset, namechar x N]
183   // VST_COMBINED_ENTRY: [valueid, refguid]
184   VST_CODE_COMBINED_ENTRY = 5
185 };
186 
187 // The module path symbol table only has one code (MST_CODE_ENTRY).
188 enum ModulePathSymtabCodes {
189   MST_CODE_ENTRY = 1, // MST_ENTRY: [modid, namechar x N]
190   MST_CODE_HASH = 2,  // MST_HASH:  [5*i32]
191 };
192 
193 // The summary section uses different codes in the per-module
194 // and combined index cases.
195 enum GlobalValueSummarySymtabCodes {
196   // PERMODULE: [valueid, flags, instcount, numrefs, numrefs x valueid,
197   //             n x (valueid, callsitecount)]
198   FS_PERMODULE = 1,
199   // PERMODULE_PROFILE: [valueid, flags, instcount, numrefs,
200   //                     numrefs x valueid,
201   //                     n x (valueid, callsitecount, profilecount)]
202   FS_PERMODULE_PROFILE = 2,
203   // PERMODULE_GLOBALVAR_INIT_REFS: [valueid, flags, n x valueid]
204   FS_PERMODULE_GLOBALVAR_INIT_REFS = 3,
205   // COMBINED: [valueid, modid, flags, instcount, numrefs, numrefs x valueid,
206   //            n x (valueid, callsitecount)]
207   FS_COMBINED = 4,
208   // COMBINED_PROFILE: [valueid, modid, flags, instcount, numrefs,
209   //                    numrefs x valueid,
210   //                    n x (valueid, callsitecount, profilecount)]
211   FS_COMBINED_PROFILE = 5,
212   // COMBINED_GLOBALVAR_INIT_REFS: [valueid, modid, flags, n x valueid]
213   FS_COMBINED_GLOBALVAR_INIT_REFS = 6,
214   // ALIAS: [valueid, flags, valueid]
215   FS_ALIAS = 7,
216   // COMBINED_ALIAS: [valueid, modid, flags, valueid]
217   FS_COMBINED_ALIAS = 8,
218   // COMBINED_ORIGINAL_NAME: [original_name_hash]
219   FS_COMBINED_ORIGINAL_NAME = 9,
220   // VERSION of the summary, bumped when adding flags for instance.
221   FS_VERSION = 10,
222 };
223 
224 enum MetadataCodes {
225   METADATA_STRING_OLD = 1,       // MDSTRING:      [values]
226   METADATA_VALUE = 2,            // VALUE:         [type num, value num]
227   METADATA_NODE = 3,             // NODE:          [n x md num]
228   METADATA_NAME = 4,             // STRING:        [values]
229   METADATA_DISTINCT_NODE = 5,    // DISTINCT_NODE: [n x md num]
230   METADATA_KIND = 6,             // [n x [id, name]]
231   METADATA_LOCATION = 7,         // [distinct, line, col, scope, inlined-at?]
232   METADATA_OLD_NODE = 8,         // OLD_NODE:      [n x (type num, value num)]
233   METADATA_OLD_FN_NODE = 9,      // OLD_FN_NODE:   [n x (type num, value num)]
234   METADATA_NAMED_NODE = 10,      // NAMED_NODE:    [n x mdnodes]
235   METADATA_ATTACHMENT = 11,      // [m x [value, [n x [id, mdnode]]]
236   METADATA_GENERIC_DEBUG = 12,   // [distinct, tag, vers, header, n x md num]
237   METADATA_SUBRANGE = 13,        // [distinct, count, lo]
238   METADATA_ENUMERATOR = 14,      // [distinct, value, name]
239   METADATA_BASIC_TYPE = 15,      // [distinct, tag, name, size, align, enc]
240   METADATA_FILE = 16,            // [distinct, filename, directory]
241   METADATA_DERIVED_TYPE = 17,    // [distinct, ...]
242   METADATA_COMPOSITE_TYPE = 18,  // [distinct, ...]
243   METADATA_SUBROUTINE_TYPE = 19, // [distinct, flags, types, cc]
244   METADATA_COMPILE_UNIT = 20,    // [distinct, ...]
245   METADATA_SUBPROGRAM = 21,      // [distinct, ...]
246   METADATA_LEXICAL_BLOCK = 22,   // [distinct, scope, file, line, column]
247   METADATA_LEXICAL_BLOCK_FILE = 23, //[distinct, scope, file, discriminator]
248   METADATA_NAMESPACE = 24,          // [distinct, scope, file, name, line]
249   METADATA_TEMPLATE_TYPE = 25,      // [distinct, scope, name, type, ...]
250   METADATA_TEMPLATE_VALUE = 26,     // [distinct, scope, name, type, value, ...]
251   METADATA_GLOBAL_VAR = 27,         // [distinct, ...]
252   METADATA_LOCAL_VAR = 28,          // [distinct, ...]
253   METADATA_EXPRESSION = 29,         // [distinct, n x element]
254   METADATA_OBJC_PROPERTY = 30,      // [distinct, name, file, line, ...]
255   METADATA_IMPORTED_ENTITY = 31, // [distinct, tag, scope, entity, line, name]
256   METADATA_MODULE = 32,          // [distinct, scope, name, ...]
257   METADATA_MACRO = 33,           // [distinct, macinfo, line, name, value]
258   METADATA_MACRO_FILE = 34,      // [distinct, macinfo, line, file, ...]
259   METADATA_STRINGS = 35,         // [count, offset] blob([lengths][chars])
260   METADATA_GLOBAL_DECL_ATTACHMENT = 36, // [valueid, n x [id, mdnode]]
261 };
262 
263 // The constants block (CONSTANTS_BLOCK_ID) describes emission for each
264 // constant and maintains an implicit current type value.
265 enum ConstantsCodes {
266   CST_CODE_SETTYPE = 1,          // SETTYPE:       [typeid]
267   CST_CODE_NULL = 2,             // NULL
268   CST_CODE_UNDEF = 3,            // UNDEF
269   CST_CODE_INTEGER = 4,          // INTEGER:       [intval]
270   CST_CODE_WIDE_INTEGER = 5,     // WIDE_INTEGER:  [n x intval]
271   CST_CODE_FLOAT = 6,            // FLOAT:         [fpval]
272   CST_CODE_AGGREGATE = 7,        // AGGREGATE:     [n x value number]
273   CST_CODE_STRING = 8,           // STRING:        [values]
274   CST_CODE_CSTRING = 9,          // CSTRING:       [values]
275   CST_CODE_CE_BINOP = 10,        // CE_BINOP:      [opcode, opval, opval]
276   CST_CODE_CE_CAST = 11,         // CE_CAST:       [opcode, opty, opval]
277   CST_CODE_CE_GEP = 12,          // CE_GEP:        [n x operands]
278   CST_CODE_CE_SELECT = 13,       // CE_SELECT:     [opval, opval, opval]
279   CST_CODE_CE_EXTRACTELT = 14,   // CE_EXTRACTELT: [opty, opval, opval]
280   CST_CODE_CE_INSERTELT = 15,    // CE_INSERTELT:  [opval, opval, opval]
281   CST_CODE_CE_SHUFFLEVEC = 16,   // CE_SHUFFLEVEC: [opval, opval, opval]
282   CST_CODE_CE_CMP = 17,          // CE_CMP:        [opty, opval, opval, pred]
283   CST_CODE_INLINEASM_OLD = 18,   // INLINEASM:     [sideeffect|alignstack,
284                                  //                 asmstr,conststr]
285   CST_CODE_CE_SHUFVEC_EX = 19,   // SHUFVEC_EX:    [opty, opval, opval, opval]
286   CST_CODE_CE_INBOUNDS_GEP = 20, // INBOUNDS_GEP:  [n x operands]
287   CST_CODE_BLOCKADDRESS = 21,    // CST_CODE_BLOCKADDRESS [fnty, fnval, bb#]
288   CST_CODE_DATA = 22,            // DATA:          [n x elements]
289   CST_CODE_INLINEASM = 23        // INLINEASM:     [sideeffect|alignstack|
290                                  //                 asmdialect,asmstr,conststr]
291 };
292 
293 /// CastOpcodes - These are values used in the bitcode files to encode which
294 /// cast a CST_CODE_CE_CAST or a XXX refers to.  The values of these enums
295 /// have no fixed relation to the LLVM IR enum values.  Changing these will
296 /// break compatibility with old files.
297 enum CastOpcodes {
298   CAST_TRUNC = 0,
299   CAST_ZEXT = 1,
300   CAST_SEXT = 2,
301   CAST_FPTOUI = 3,
302   CAST_FPTOSI = 4,
303   CAST_UITOFP = 5,
304   CAST_SITOFP = 6,
305   CAST_FPTRUNC = 7,
306   CAST_FPEXT = 8,
307   CAST_PTRTOINT = 9,
308   CAST_INTTOPTR = 10,
309   CAST_BITCAST = 11,
310   CAST_ADDRSPACECAST = 12
311 };
312 
313 /// BinaryOpcodes - These are values used in the bitcode files to encode which
314 /// binop a CST_CODE_CE_BINOP or a XXX refers to.  The values of these enums
315 /// have no fixed relation to the LLVM IR enum values.  Changing these will
316 /// break compatibility with old files.
317 enum BinaryOpcodes {
318   BINOP_ADD = 0,
319   BINOP_SUB = 1,
320   BINOP_MUL = 2,
321   BINOP_UDIV = 3,
322   BINOP_SDIV = 4, // overloaded for FP
323   BINOP_UREM = 5,
324   BINOP_SREM = 6, // overloaded for FP
325   BINOP_SHL = 7,
326   BINOP_LSHR = 8,
327   BINOP_ASHR = 9,
328   BINOP_AND = 10,
329   BINOP_OR = 11,
330   BINOP_XOR = 12
331 };
332 
333 /// These are values used in the bitcode files to encode AtomicRMW operations.
334 /// The values of these enums have no fixed relation to the LLVM IR enum
335 /// values.  Changing these will break compatibility with old files.
336 enum RMWOperations {
337   RMW_XCHG = 0,
338   RMW_ADD = 1,
339   RMW_SUB = 2,
340   RMW_AND = 3,
341   RMW_NAND = 4,
342   RMW_OR = 5,
343   RMW_XOR = 6,
344   RMW_MAX = 7,
345   RMW_MIN = 8,
346   RMW_UMAX = 9,
347   RMW_UMIN = 10
348 };
349 
350 /// OverflowingBinaryOperatorOptionalFlags - Flags for serializing
351 /// OverflowingBinaryOperator's SubclassOptionalData contents.
352 enum OverflowingBinaryOperatorOptionalFlags {
353   OBO_NO_UNSIGNED_WRAP = 0,
354   OBO_NO_SIGNED_WRAP = 1
355 };
356 
357 /// PossiblyExactOperatorOptionalFlags - Flags for serializing
358 /// PossiblyExactOperator's SubclassOptionalData contents.
359 enum PossiblyExactOperatorOptionalFlags { PEO_EXACT = 0 };
360 
361 /// Encoded AtomicOrdering values.
362 enum AtomicOrderingCodes {
363   ORDERING_NOTATOMIC = 0,
364   ORDERING_UNORDERED = 1,
365   ORDERING_MONOTONIC = 2,
366   ORDERING_ACQUIRE = 3,
367   ORDERING_RELEASE = 4,
368   ORDERING_ACQREL = 5,
369   ORDERING_SEQCST = 6
370 };
371 
372 /// Encoded SynchronizationScope values.
373 enum AtomicSynchScopeCodes {
374   SYNCHSCOPE_SINGLETHREAD = 0,
375   SYNCHSCOPE_CROSSTHREAD = 1
376 };
377 
378 /// Markers and flags for call instruction.
379 enum CallMarkersFlags {
380   CALL_TAIL = 0,
381   CALL_CCONV = 1,
382   CALL_MUSTTAIL = 14,
383   CALL_EXPLICIT_TYPE = 15,
384   CALL_NOTAIL = 16,
385   CALL_FMF = 17 // Call has optional fast-math-flags.
386 };
387 
388 // The function body block (FUNCTION_BLOCK_ID) describes function bodies.  It
389 // can contain a constant block (CONSTANTS_BLOCK_ID).
390 enum FunctionCodes {
391   FUNC_CODE_DECLAREBLOCKS = 1, // DECLAREBLOCKS: [n]
392 
393   FUNC_CODE_INST_BINOP = 2,      // BINOP:      [opcode, ty, opval, opval]
394   FUNC_CODE_INST_CAST = 3,       // CAST:       [opcode, ty, opty, opval]
395   FUNC_CODE_INST_GEP_OLD = 4,    // GEP:        [n x operands]
396   FUNC_CODE_INST_SELECT = 5,     // SELECT:     [ty, opval, opval, opval]
397   FUNC_CODE_INST_EXTRACTELT = 6, // EXTRACTELT: [opty, opval, opval]
398   FUNC_CODE_INST_INSERTELT = 7,  // INSERTELT:  [ty, opval, opval, opval]
399   FUNC_CODE_INST_SHUFFLEVEC = 8, // SHUFFLEVEC: [ty, opval, opval, opval]
400   FUNC_CODE_INST_CMP = 9,        // CMP:        [opty, opval, opval, pred]
401 
402   FUNC_CODE_INST_RET = 10,    // RET:        [opty,opval<both optional>]
403   FUNC_CODE_INST_BR = 11,     // BR:         [bb#, bb#, cond] or [bb#]
404   FUNC_CODE_INST_SWITCH = 12, // SWITCH:     [opty, op0, op1, ...]
405   FUNC_CODE_INST_INVOKE = 13, // INVOKE:     [attr, fnty, op0,op1, ...]
406   // 14 is unused.
407   FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE
408 
409   FUNC_CODE_INST_PHI = 16, // PHI:        [ty, val0,bb0, ...]
410   // 17 is unused.
411   // 18 is unused.
412   FUNC_CODE_INST_ALLOCA = 19, // ALLOCA:     [instty, opty, op, align]
413   FUNC_CODE_INST_LOAD = 20,   // LOAD:       [opty, op, align, vol]
414   // 21 is unused.
415   // 22 is unused.
416   FUNC_CODE_INST_VAARG = 23, // VAARG:      [valistty, valist, instty]
417   // This store code encodes the pointer type, rather than the value type
418   // this is so information only available in the pointer type (e.g. address
419   // spaces) is retained.
420   FUNC_CODE_INST_STORE_OLD = 24, // STORE:      [ptrty,ptr,val, align, vol]
421   // 25 is unused.
422   FUNC_CODE_INST_EXTRACTVAL = 26, // EXTRACTVAL: [n x operands]
423   FUNC_CODE_INST_INSERTVAL = 27,  // INSERTVAL:  [n x operands]
424   // fcmp/icmp returning Int1TY or vector of Int1Ty. Same as CMP, exists to
425   // support legacy vicmp/vfcmp instructions.
426   FUNC_CODE_INST_CMP2 = 28, // CMP2:       [opty, opval, opval, pred]
427   // new select on i1 or [N x i1]
428   FUNC_CODE_INST_VSELECT = 29, // VSELECT:    [ty,opval,opval,predty,pred]
429   FUNC_CODE_INST_INBOUNDS_GEP_OLD = 30, // INBOUNDS_GEP: [n x operands]
430   FUNC_CODE_INST_INDIRECTBR = 31,       // INDIRECTBR: [opty, op0, op1, ...]
431   // 32 is unused.
432   FUNC_CODE_DEBUG_LOC_AGAIN = 33, // DEBUG_LOC_AGAIN
433 
434   FUNC_CODE_INST_CALL = 34, // CALL:    [attr, cc, fnty, fnid, args...]
435 
436   FUNC_CODE_DEBUG_LOC = 35,        // DEBUG_LOC:  [Line,Col,ScopeVal, IAVal]
437   FUNC_CODE_INST_FENCE = 36,       // FENCE: [ordering, synchscope]
438   FUNC_CODE_INST_CMPXCHG_OLD = 37, // CMPXCHG: [ptrty,ptr,cmp,new, align, vol,
439                                    //           ordering, synchscope]
440   FUNC_CODE_INST_ATOMICRMW = 38,   // ATOMICRMW: [ptrty,ptr,val, operation,
441                                    //             align, vol,
442                                    //             ordering, synchscope]
443   FUNC_CODE_INST_RESUME = 39,      // RESUME:     [opval]
444   FUNC_CODE_INST_LANDINGPAD_OLD =
445       40,                         // LANDINGPAD: [ty,val,val,num,id0,val0...]
446   FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [opty, op, align, vol,
447                                   //        ordering, synchscope]
448   FUNC_CODE_INST_STOREATOMIC_OLD = 42, // STORE: [ptrty,ptr,val, align, vol
449                                        //         ordering, synchscope]
450   FUNC_CODE_INST_GEP = 43,             // GEP:  [inbounds, n x operands]
451   FUNC_CODE_INST_STORE = 44,       // STORE: [ptrty,ptr,valty,val, align, vol]
452   FUNC_CODE_INST_STOREATOMIC = 45, // STORE: [ptrty,ptr,val, align, vol
453   FUNC_CODE_INST_CMPXCHG = 46,     // CMPXCHG: [ptrty,ptr,valty,cmp,new, align,
454                                    //           vol,ordering,synchscope]
455   FUNC_CODE_INST_LANDINGPAD = 47,  // LANDINGPAD: [ty,val,num,id0,val0...]
456   FUNC_CODE_INST_CLEANUPRET = 48,  // CLEANUPRET: [val] or [val,bb#]
457   FUNC_CODE_INST_CATCHRET = 49,    // CATCHRET: [val,bb#]
458   FUNC_CODE_INST_CATCHPAD = 50,    // CATCHPAD: [bb#,bb#,num,args...]
459   FUNC_CODE_INST_CLEANUPPAD = 51,  // CLEANUPPAD: [num,args...]
460   FUNC_CODE_INST_CATCHSWITCH =
461       52, // CATCHSWITCH: [num,args...] or [num,args...,bb]
462   // 53 is unused.
463   // 54 is unused.
464   FUNC_CODE_OPERAND_BUNDLE = 55, // OPERAND_BUNDLE: [tag#, value...]
465 };
466 
467 enum UseListCodes {
468   USELIST_CODE_DEFAULT = 1, // DEFAULT: [index..., value-id]
469   USELIST_CODE_BB = 2       // BB: [index..., bb-id]
470 };
471 
472 enum AttributeKindCodes {
473   // = 0 is unused
474   ATTR_KIND_ALIGNMENT = 1,
475   ATTR_KIND_ALWAYS_INLINE = 2,
476   ATTR_KIND_BY_VAL = 3,
477   ATTR_KIND_INLINE_HINT = 4,
478   ATTR_KIND_IN_REG = 5,
479   ATTR_KIND_MIN_SIZE = 6,
480   ATTR_KIND_NAKED = 7,
481   ATTR_KIND_NEST = 8,
482   ATTR_KIND_NO_ALIAS = 9,
483   ATTR_KIND_NO_BUILTIN = 10,
484   ATTR_KIND_NO_CAPTURE = 11,
485   ATTR_KIND_NO_DUPLICATE = 12,
486   ATTR_KIND_NO_IMPLICIT_FLOAT = 13,
487   ATTR_KIND_NO_INLINE = 14,
488   ATTR_KIND_NON_LAZY_BIND = 15,
489   ATTR_KIND_NO_RED_ZONE = 16,
490   ATTR_KIND_NO_RETURN = 17,
491   ATTR_KIND_NO_UNWIND = 18,
492   ATTR_KIND_OPTIMIZE_FOR_SIZE = 19,
493   ATTR_KIND_READ_NONE = 20,
494   ATTR_KIND_READ_ONLY = 21,
495   ATTR_KIND_RETURNED = 22,
496   ATTR_KIND_RETURNS_TWICE = 23,
497   ATTR_KIND_S_EXT = 24,
498   ATTR_KIND_STACK_ALIGNMENT = 25,
499   ATTR_KIND_STACK_PROTECT = 26,
500   ATTR_KIND_STACK_PROTECT_REQ = 27,
501   ATTR_KIND_STACK_PROTECT_STRONG = 28,
502   ATTR_KIND_STRUCT_RET = 29,
503   ATTR_KIND_SANITIZE_ADDRESS = 30,
504   ATTR_KIND_SANITIZE_THREAD = 31,
505   ATTR_KIND_SANITIZE_MEMORY = 32,
506   ATTR_KIND_UW_TABLE = 33,
507   ATTR_KIND_Z_EXT = 34,
508   ATTR_KIND_BUILTIN = 35,
509   ATTR_KIND_COLD = 36,
510   ATTR_KIND_OPTIMIZE_NONE = 37,
511   ATTR_KIND_IN_ALLOCA = 38,
512   ATTR_KIND_NON_NULL = 39,
513   ATTR_KIND_JUMP_TABLE = 40,
514   ATTR_KIND_DEREFERENCEABLE = 41,
515   ATTR_KIND_DEREFERENCEABLE_OR_NULL = 42,
516   ATTR_KIND_CONVERGENT = 43,
517   ATTR_KIND_SAFESTACK = 44,
518   ATTR_KIND_ARGMEMONLY = 45,
519   ATTR_KIND_SWIFT_SELF = 46,
520   ATTR_KIND_SWIFT_ERROR = 47,
521   ATTR_KIND_NO_RECURSE = 48,
522   ATTR_KIND_INACCESSIBLEMEM_ONLY = 49,
523   ATTR_KIND_INACCESSIBLEMEM_OR_ARGMEMONLY = 50,
524   ATTR_KIND_ALLOC_SIZE = 51,
525   ATTR_KIND_WRITEONLY = 52
526 };
527 
528 enum ComdatSelectionKindCodes {
529   COMDAT_SELECTION_KIND_ANY = 1,
530   COMDAT_SELECTION_KIND_EXACT_MATCH = 2,
531   COMDAT_SELECTION_KIND_LARGEST = 3,
532   COMDAT_SELECTION_KIND_NO_DUPLICATES = 4,
533   COMDAT_SELECTION_KIND_SAME_SIZE = 5,
534 };
535 
536 } // End bitc namespace
537 } // End llvm namespace
538 
539 #endif
540