Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:43:22

0001 //===- LLVMBitCodes.h - Enum values for the LLVM bitcode format -*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This header defines Bitcode enum values for LLVM IR bitcode files.
0010 //
0011 // The enum values defined in this file should be considered permanent.  If
0012 // new features are added, they should have values added at the end of the
0013 // respective lists.
0014 //
0015 //===----------------------------------------------------------------------===//
0016 
0017 #ifndef LLVM_BITCODE_LLVMBITCODES_H
0018 #define LLVM_BITCODE_LLVMBITCODES_H
0019 
0020 // This is the only file included, and it, in turn, is a leaf header.
0021 // This allows external tools to dump the AST of this file and analyze it for
0022 // changes without needing to fully or partially build LLVM itself.
0023 #include "llvm/Bitstream/BitCodeEnums.h"
0024 
0025 namespace llvm {
0026 namespace bitc {
0027 // The only top-level block types are MODULE, IDENTIFICATION, STRTAB and SYMTAB.
0028 enum BlockIDs {
0029   // Blocks
0030   MODULE_BLOCK_ID = FIRST_APPLICATION_BLOCKID,
0031 
0032   // Module sub-block id's.
0033   PARAMATTR_BLOCK_ID,
0034   PARAMATTR_GROUP_BLOCK_ID,
0035 
0036   CONSTANTS_BLOCK_ID,
0037   FUNCTION_BLOCK_ID,
0038 
0039   // Block intended to contains information on the bitcode versioning.
0040   // Can be used to provide better error messages when we fail to parse a
0041   // bitcode file.
0042   IDENTIFICATION_BLOCK_ID,
0043 
0044   VALUE_SYMTAB_BLOCK_ID,
0045   METADATA_BLOCK_ID,
0046   METADATA_ATTACHMENT_ID,
0047 
0048   TYPE_BLOCK_ID_NEW,
0049 
0050   USELIST_BLOCK_ID,
0051 
0052   MODULE_STRTAB_BLOCK_ID,
0053   GLOBALVAL_SUMMARY_BLOCK_ID,
0054 
0055   OPERAND_BUNDLE_TAGS_BLOCK_ID,
0056 
0057   METADATA_KIND_BLOCK_ID,
0058 
0059   STRTAB_BLOCK_ID,
0060 
0061   FULL_LTO_GLOBALVAL_SUMMARY_BLOCK_ID,
0062 
0063   SYMTAB_BLOCK_ID,
0064 
0065   SYNC_SCOPE_NAMES_BLOCK_ID,
0066 };
0067 
0068 /// Identification block contains a string that describes the producer details,
0069 /// and an epoch that defines the auto-upgrade capability.
0070 enum IdentificationCodes {
0071   IDENTIFICATION_CODE_STRING = 1, // IDENTIFICATION:      [strchr x N]
0072   IDENTIFICATION_CODE_EPOCH = 2,  // EPOCH:               [epoch#]
0073 };
0074 
0075 /// The epoch that defines the auto-upgrade compatibility for the bitcode.
0076 ///
0077 /// LLVM guarantees in a major release that a minor release can read bitcode
0078 /// generated by previous minor releases. We translate this by making the reader
0079 /// accepting only bitcode with the same epoch, except for the X.0 release which
0080 /// also accepts N-1.
0081 enum { BITCODE_CURRENT_EPOCH = 0 };
0082 
0083 /// MODULE blocks have a number of optional fields and subblocks.
0084 enum ModuleCodes {
0085   MODULE_CODE_VERSION = 1,     // VERSION:     [version#]
0086   MODULE_CODE_TRIPLE = 2,      // TRIPLE:      [strchr x N]
0087   MODULE_CODE_DATALAYOUT = 3,  // DATALAYOUT:  [strchr x N]
0088   MODULE_CODE_ASM = 4,         // ASM:         [strchr x N]
0089   MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strchr x N]
0090 
0091   // Deprecated, but still needed to read old bitcode files.
0092   MODULE_CODE_DEPLIB = 6, // DEPLIB:      [strchr x N]
0093 
0094   // GLOBALVAR: [pointer type, isconst, initid,
0095   //             linkage, alignment, section, visibility, threadlocal]
0096   MODULE_CODE_GLOBALVAR = 7,
0097 
0098   // FUNCTION:  [type, callingconv, isproto, linkage, paramattrs, alignment,
0099   //             section, visibility, gc, unnamed_addr]
0100   MODULE_CODE_FUNCTION = 8,
0101 
0102   // ALIAS: [alias type, aliasee val#, linkage, visibility]
0103   MODULE_CODE_ALIAS_OLD = 9,
0104 
0105   MODULE_CODE_GCNAME = 11, // GCNAME: [strchr x N]
0106   MODULE_CODE_COMDAT = 12, // COMDAT: [selection_kind, name]
0107 
0108   MODULE_CODE_VSTOFFSET = 13, // VSTOFFSET: [offset]
0109 
0110   // ALIAS: [alias value type, addrspace, aliasee val#, linkage, visibility]
0111   MODULE_CODE_ALIAS = 14,
0112 
0113   MODULE_CODE_METADATA_VALUES_UNUSED = 15,
0114 
0115   // SOURCE_FILENAME: [namechar x N]
0116   MODULE_CODE_SOURCE_FILENAME = 16,
0117 
0118   // HASH: [5*i32]
0119   MODULE_CODE_HASH = 17,
0120 
0121   // IFUNC: [ifunc value type, addrspace, resolver val#, linkage, visibility]
0122   MODULE_CODE_IFUNC = 18,
0123 };
0124 
0125 /// PARAMATTR blocks have code for defining a parameter attribute set.
0126 enum AttributeCodes {
0127   // Deprecated, but still needed to read old bitcode files.
0128   PARAMATTR_CODE_ENTRY_OLD = 1, // ENTRY: [paramidx0, attr0,
0129                                 //         paramidx1, attr1...]
0130   PARAMATTR_CODE_ENTRY = 2,     // ENTRY: [attrgrp0, attrgrp1, ...]
0131   PARAMATTR_GRP_CODE_ENTRY = 3  // ENTRY: [grpid, idx, attr0, attr1, ...]
0132 };
0133 
0134 /// TYPE blocks have codes for each type primitive they use.
0135 enum TypeCodes {
0136   TYPE_CODE_NUMENTRY = 1, // NUMENTRY: [numentries]
0137 
0138   // Type Codes
0139   TYPE_CODE_VOID = 2,    // VOID
0140   TYPE_CODE_FLOAT = 3,   // FLOAT
0141   TYPE_CODE_DOUBLE = 4,  // DOUBLE
0142   TYPE_CODE_LABEL = 5,   // LABEL
0143   TYPE_CODE_OPAQUE = 6,  // OPAQUE
0144   TYPE_CODE_INTEGER = 7, // INTEGER: [width]
0145   TYPE_CODE_POINTER = 8, // POINTER: [pointee type]
0146 
0147   TYPE_CODE_FUNCTION_OLD = 9, // FUNCTION: [vararg, attrid, retty,
0148                               //            paramty x N]
0149 
0150   TYPE_CODE_HALF = 10, // HALF
0151 
0152   TYPE_CODE_ARRAY = 11,  // ARRAY: [numelts, eltty]
0153   TYPE_CODE_VECTOR = 12, // VECTOR: [numelts, eltty]
0154 
0155   // These are not with the other floating point types because they're
0156   // a late addition, and putting them in the right place breaks
0157   // binary compatibility.
0158   TYPE_CODE_X86_FP80 = 13,  // X86 LONG DOUBLE
0159   TYPE_CODE_FP128 = 14,     // LONG DOUBLE (112 bit mantissa)
0160   TYPE_CODE_PPC_FP128 = 15, // PPC LONG DOUBLE (2 doubles)
0161 
0162   TYPE_CODE_METADATA = 16, // METADATA
0163 
0164   TYPE_CODE_X86_MMX = 17, // X86 MMX
0165 
0166   TYPE_CODE_STRUCT_ANON = 18,  // STRUCT_ANON: [ispacked, eltty x N]
0167   TYPE_CODE_STRUCT_NAME = 19,  // STRUCT_NAME: [strchr x N]
0168   TYPE_CODE_STRUCT_NAMED = 20, // STRUCT_NAMED: [ispacked, eltty x N]
0169 
0170   TYPE_CODE_FUNCTION = 21, // FUNCTION: [vararg, retty, paramty x N]
0171 
0172   TYPE_CODE_TOKEN = 22, // TOKEN
0173 
0174   TYPE_CODE_BFLOAT = 23,  // BRAIN FLOATING POINT
0175   TYPE_CODE_X86_AMX = 24, // X86 AMX
0176 
0177   TYPE_CODE_OPAQUE_POINTER = 25, // OPAQUE_POINTER: [addrspace]
0178 
0179   TYPE_CODE_TARGET_TYPE = 26, // TARGET_TYPE
0180 };
0181 
0182 enum OperandBundleTagCode {
0183   OPERAND_BUNDLE_TAG = 1, // TAG: [strchr x N]
0184 };
0185 
0186 enum SyncScopeNameCode {
0187   SYNC_SCOPE_NAME = 1,
0188 };
0189 
0190 // Value symbol table codes.
0191 enum ValueSymtabCodes {
0192   VST_CODE_ENTRY = 1,   // VST_ENTRY: [valueid, namechar x N]
0193   VST_CODE_BBENTRY = 2, // VST_BBENTRY: [bbid, namechar x N]
0194   VST_CODE_FNENTRY = 3, // VST_FNENTRY: [valueid, offset, namechar x N]
0195   // VST_COMBINED_ENTRY: [valueid, refguid]
0196   VST_CODE_COMBINED_ENTRY = 5
0197 };
0198 
0199 // The module path symbol table only has one code (MST_CODE_ENTRY).
0200 enum ModulePathSymtabCodes {
0201   MST_CODE_ENTRY = 1, // MST_ENTRY: [modid, namechar x N]
0202   MST_CODE_HASH = 2,  // MST_HASH:  [5*i32]
0203 };
0204 
0205 // The summary section uses different codes in the per-module
0206 // and combined index cases.
0207 enum GlobalValueSummarySymtabCodes {
0208   // PERMODULE: [valueid, flags, instcount, numrefs, numrefs x valueid,
0209   //             n x (valueid)]
0210   FS_PERMODULE = 1,
0211   // PERMODULE_PROFILE: [valueid, flags, instcount, numrefs,
0212   //                     numrefs x valueid,
0213   //                     n x (valueid, hotness+tailcall)]
0214   FS_PERMODULE_PROFILE = 2,
0215   // PERMODULE_GLOBALVAR_INIT_REFS: [valueid, flags, n x valueid]
0216   FS_PERMODULE_GLOBALVAR_INIT_REFS = 3,
0217   // COMBINED: [valueid, modid, flags, instcount, numrefs, numrefs x valueid,
0218   //            n x (valueid)]
0219   FS_COMBINED = 4,
0220   // COMBINED_PROFILE: [valueid, modid, flags, instcount, numrefs,
0221   //                    numrefs x valueid,
0222   //                    n x (valueid, hotness+tailcall)]
0223   FS_COMBINED_PROFILE = 5,
0224   // COMBINED_GLOBALVAR_INIT_REFS: [valueid, modid, flags, n x valueid]
0225   FS_COMBINED_GLOBALVAR_INIT_REFS = 6,
0226   // ALIAS: [valueid, flags, valueid]
0227   FS_ALIAS = 7,
0228   // COMBINED_ALIAS: [valueid, modid, flags, valueid]
0229   FS_COMBINED_ALIAS = 8,
0230   // COMBINED_ORIGINAL_NAME: [original_name_hash]
0231   FS_COMBINED_ORIGINAL_NAME = 9,
0232   // VERSION of the summary, bumped when adding flags for instance.
0233   FS_VERSION = 10,
0234   // The list of llvm.type.test type identifiers used by the following function
0235   // that are used other than by an llvm.assume.
0236   // [n x typeid]
0237   FS_TYPE_TESTS = 11,
0238   // The list of virtual calls made by this function using
0239   // llvm.assume(llvm.type.test) intrinsics that do not have all constant
0240   // integer arguments.
0241   // [n x (typeid, offset)]
0242   FS_TYPE_TEST_ASSUME_VCALLS = 12,
0243   // The list of virtual calls made by this function using
0244   // llvm.type.checked.load intrinsics that do not have all constant integer
0245   // arguments.
0246   // [n x (typeid, offset)]
0247   FS_TYPE_CHECKED_LOAD_VCALLS = 13,
0248   // Identifies a virtual call made by this function using an
0249   // llvm.assume(llvm.type.test) intrinsic with all constant integer arguments.
0250   // [typeid, offset, n x arg]
0251   FS_TYPE_TEST_ASSUME_CONST_VCALL = 14,
0252   // Identifies a virtual call made by this function using an
0253   // llvm.type.checked.load intrinsic with all constant integer arguments.
0254   // [typeid, offset, n x arg]
0255   FS_TYPE_CHECKED_LOAD_CONST_VCALL = 15,
0256   // Assigns a GUID to a value ID. This normally appears only in combined
0257   // summaries, but it can also appear in per-module summaries for PGO data.
0258   // [valueid, guid]
0259   FS_VALUE_GUID = 16,
0260   // The list of local functions with CFI jump tables. Function names are
0261   // strings in strtab.
0262   // [n * name]
0263   FS_CFI_FUNCTION_DEFS = 17,
0264   // The list of external functions with CFI jump tables. Function names are
0265   // strings in strtab.
0266   // [n * name]
0267   FS_CFI_FUNCTION_DECLS = 18,
0268   // Per-module summary that also adds relative block frequency to callee info.
0269   // PERMODULE_RELBF: [valueid, flags, instcount, numrefs,
0270   //                   numrefs x valueid,
0271   //                   n x (valueid, relblockfreq+tailcall)]
0272   FS_PERMODULE_RELBF = 19,
0273   // Index-wide flags
0274   FS_FLAGS = 20,
0275   // Maps type identifier to summary information for that type identifier.
0276   // Produced by the thin link (only lives in combined index).
0277   // TYPE_ID: [typeid, kind, bitwidth, align, size, bitmask, inlinebits,
0278   //           n x (typeid, kind, name, numrba,
0279   //                numrba x (numarg, numarg x arg, kind, info, byte, bit))]
0280   FS_TYPE_ID = 21,
0281   // For background see overview at https://llvm.org/docs/TypeMetadata.html.
0282   // The type metadata includes both the type identifier and the offset of
0283   // the address point of the type (the address held by objects of that type
0284   // which may not be the beginning of the virtual table). Vtable definitions
0285   // are decorated with type metadata for the types they are compatible with.
0286   //
0287   // Maps type identifier to summary information for that type identifier
0288   // computed from type metadata: the valueid of each vtable definition
0289   // decorated with a type metadata for that identifier, and the offset from
0290   // the corresponding type metadata.
0291   // Exists in the per-module summary to provide information to thin link
0292   // for index-based whole program devirtualization.
0293   // TYPE_ID_METADATA: [typeid, n x (valueid, offset)]
0294   FS_TYPE_ID_METADATA = 22,
0295   // Summarizes vtable definition for use in index-based whole program
0296   // devirtualization during the thin link.
0297   // PERMODULE_VTABLE_GLOBALVAR_INIT_REFS: [valueid, flags, varflags,
0298   //                                        numrefs, numrefs x valueid,
0299   //                                        n x (valueid, offset)]
0300   FS_PERMODULE_VTABLE_GLOBALVAR_INIT_REFS = 23,
0301   // The total number of basic blocks in the module.
0302   FS_BLOCK_COUNT = 24,
0303   // Range information for accessed offsets for every argument.
0304   // [n x (paramno, range, numcalls, numcalls x (callee_guid, paramno, range))]
0305   FS_PARAM_ACCESS = 25,
0306   // Summary of per-module memprof callsite metadata.
0307   // [valueid, n x stackidindex]
0308   FS_PERMODULE_CALLSITE_INFO = 26,
0309   // Summary of per-module allocation memprof metadata.
0310   // [nummib, nummib x (alloc type, context radix tree index),
0311   // [nummib x (numcontext x total size)]?]
0312   FS_PERMODULE_ALLOC_INFO = 27,
0313   // Summary of combined index memprof callsite metadata.
0314   // [valueid, context radix tree index, numver,
0315   //  numver x version]
0316   FS_COMBINED_CALLSITE_INFO = 28,
0317   // Summary of combined index allocation memprof metadata.
0318   // [nummib, numver,
0319   //  nummib x (alloc type, numstackids, numstackids x stackidindex),
0320   //  numver x version]
0321   FS_COMBINED_ALLOC_INFO = 29,
0322   // List of all stack ids referenced by index in the callsite and alloc infos.
0323   // [n x stack id]
0324   FS_STACK_IDS = 30,
0325   // List of all full stack id pairs corresponding to the total sizes recorded
0326   // at the end of the alloc info when reporting of hinted bytes is enabled.
0327   // We use a fixed-width array, which is more efficient as these ids typically
0328   // are close to 64 bits in size. The max fixed width value supported is 32
0329   // bits so each 64-bit context id hash is recorded as a pair (upper 32 bits
0330   // first). This record must immediately precede the associated alloc info, and
0331   // the entries must be in the exact same order as the corresponding sizes.
0332   // [nummib x (numcontext x full stack id)]
0333   FS_ALLOC_CONTEXT_IDS = 31,
0334   // Linearized radix tree of allocation contexts. See the description above the
0335   // CallStackRadixTreeBuilder class in ProfileData/MemProf.h for format.
0336   // [n x entry]
0337   FS_CONTEXT_RADIX_TREE_ARRAY = 32,
0338 };
0339 
0340 enum MetadataCodes {
0341   METADATA_STRING_OLD = 1,     // MDSTRING:      [values]
0342   METADATA_VALUE = 2,          // VALUE:         [type num, value num]
0343   METADATA_NODE = 3,           // NODE:          [n x md num]
0344   METADATA_NAME = 4,           // STRING:        [values]
0345   METADATA_DISTINCT_NODE = 5,  // DISTINCT_NODE: [n x md num]
0346   METADATA_KIND = 6,           // [n x [id, name]]
0347   METADATA_LOCATION = 7,       // [distinct, line, col, scope, inlined-at?]
0348   METADATA_OLD_NODE = 8,       // OLD_NODE:      [n x (type num, value num)]
0349   METADATA_OLD_FN_NODE = 9,    // OLD_FN_NODE:   [n x (type num, value num)]
0350   METADATA_NAMED_NODE = 10,    // NAMED_NODE:    [n x mdnodes]
0351   METADATA_ATTACHMENT = 11,    // [m x [value, [n x [id, mdnode]]]
0352   METADATA_GENERIC_DEBUG = 12, // [distinct, tag, vers, header, n x md num]
0353   METADATA_SUBRANGE = 13,      // [distinct, count, lo]
0354   METADATA_ENUMERATOR = 14,    // [isUnsigned|distinct, value, name]
0355   METADATA_BASIC_TYPE = 15,    // [distinct, tag, name, size, align, enc]
0356   METADATA_FILE = 16, // [distinct, filename, directory, checksumkind, checksum]
0357   METADATA_DERIVED_TYPE = 17,       // [distinct, ...]
0358   METADATA_COMPOSITE_TYPE = 18,     // [distinct, ...]
0359   METADATA_SUBROUTINE_TYPE = 19,    // [distinct, flags, types, cc]
0360   METADATA_COMPILE_UNIT = 20,       // [distinct, ...]
0361   METADATA_SUBPROGRAM = 21,         // [distinct, ...]
0362   METADATA_LEXICAL_BLOCK = 22,      // [distinct, scope, file, line, column]
0363   METADATA_LEXICAL_BLOCK_FILE = 23, //[distinct, scope, file, discriminator]
0364   METADATA_NAMESPACE = 24, // [distinct, scope, file, name, line, exportSymbols]
0365   METADATA_TEMPLATE_TYPE = 25,   // [distinct, scope, name, type, ...]
0366   METADATA_TEMPLATE_VALUE = 26,  // [distinct, scope, name, type, value, ...]
0367   METADATA_GLOBAL_VAR = 27,      // [distinct, ...]
0368   METADATA_LOCAL_VAR = 28,       // [distinct, ...]
0369   METADATA_EXPRESSION = 29,      // [distinct, n x element]
0370   METADATA_OBJC_PROPERTY = 30,   // [distinct, name, file, line, ...]
0371   METADATA_IMPORTED_ENTITY = 31, // [distinct, tag, scope, entity, line, name]
0372   METADATA_MODULE = 32,          // [distinct, scope, name, ...]
0373   METADATA_MACRO = 33,           // [distinct, macinfo, line, name, value]
0374   METADATA_MACRO_FILE = 34,      // [distinct, macinfo, line, file, ...]
0375   METADATA_STRINGS = 35,         // [count, offset] blob([lengths][chars])
0376   METADATA_GLOBAL_DECL_ATTACHMENT = 36, // [valueid, n x [id, mdnode]]
0377   METADATA_GLOBAL_VAR_EXPR = 37,        // [distinct, var, expr]
0378   METADATA_INDEX_OFFSET = 38,           // [offset]
0379   METADATA_INDEX = 39,                  // [bitpos]
0380   METADATA_LABEL = 40,                  // [distinct, scope, name, file, line]
0381   METADATA_STRING_TYPE = 41,            // [distinct, name, size, align,...]
0382   // Codes 42 and 43 are reserved for support for Fortran array specific debug
0383   // info.
0384   METADATA_COMMON_BLOCK = 44,     // [distinct, scope, name, variable,...]
0385   METADATA_GENERIC_SUBRANGE = 45, // [distinct, count, lo, up, stride]
0386   METADATA_ARG_LIST = 46,         // [n x [type num, value num]]
0387   METADATA_ASSIGN_ID = 47,        // [distinct, ...]
0388 };
0389 
0390 // The constants block (CONSTANTS_BLOCK_ID) describes emission for each
0391 // constant and maintains an implicit current type value.
0392 enum ConstantsCodes {
0393   CST_CODE_SETTYPE = 1,          // SETTYPE:       [typeid]
0394   CST_CODE_NULL = 2,             // NULL
0395   CST_CODE_UNDEF = 3,            // UNDEF
0396   CST_CODE_INTEGER = 4,          // INTEGER:       [intval]
0397   CST_CODE_WIDE_INTEGER = 5,     // WIDE_INTEGER:  [n x intval]
0398   CST_CODE_FLOAT = 6,            // FLOAT:         [fpval]
0399   CST_CODE_AGGREGATE = 7,        // AGGREGATE:     [n x value number]
0400   CST_CODE_STRING = 8,           // STRING:        [values]
0401   CST_CODE_CSTRING = 9,          // CSTRING:       [values]
0402   CST_CODE_CE_BINOP = 10,        // CE_BINOP:      [opcode, opval, opval]
0403   CST_CODE_CE_CAST = 11,         // CE_CAST:       [opcode, opty, opval]
0404   CST_CODE_CE_GEP_OLD = 12,      // CE_GEP:        [n x operands]
0405   CST_CODE_CE_SELECT = 13,       // CE_SELECT:     [opval, opval, opval]
0406   CST_CODE_CE_EXTRACTELT = 14,   // CE_EXTRACTELT: [opty, opval, opval]
0407   CST_CODE_CE_INSERTELT = 15,    // CE_INSERTELT:  [opval, opval, opval]
0408   CST_CODE_CE_SHUFFLEVEC = 16,   // CE_SHUFFLEVEC: [opval, opval, opval]
0409   CST_CODE_CE_CMP = 17,          // CE_CMP:        [opty, opval, opval, pred]
0410   CST_CODE_INLINEASM_OLD = 18,   // INLINEASM:     [sideeffect|alignstack,
0411                                  //                 asmstr,conststr]
0412   CST_CODE_CE_SHUFVEC_EX = 19,   // SHUFVEC_EX:    [opty, opval, opval, opval]
0413   CST_CODE_CE_INBOUNDS_GEP = 20, // INBOUNDS_GEP:  [n x operands]
0414   CST_CODE_BLOCKADDRESS = 21,    // CST_CODE_BLOCKADDRESS [fnty, fnval, bb#]
0415   CST_CODE_DATA = 22,            // DATA:          [n x elements]
0416   CST_CODE_INLINEASM_OLD2 = 23,  // INLINEASM:     [sideeffect|alignstack|
0417                                  //                 asmdialect,asmstr,conststr]
0418   CST_CODE_CE_GEP_WITH_INRANGE_INDEX_OLD = 24, //  [opty, flags, n x operands]
0419   CST_CODE_CE_UNOP = 25,                       // CE_UNOP:      [opcode, opval]
0420   CST_CODE_POISON = 26,                        // POISON
0421   CST_CODE_DSO_LOCAL_EQUIVALENT = 27, // DSO_LOCAL_EQUIVALENT [gvty, gv]
0422   CST_CODE_INLINEASM_OLD3 = 28,       // INLINEASM:     [sideeffect|alignstack|
0423                                       //                 asmdialect|unwind,
0424                                       //                 asmstr,conststr]
0425   CST_CODE_NO_CFI_VALUE = 29,         // NO_CFI [ fty, f ]
0426   CST_CODE_INLINEASM = 30,            // INLINEASM:     [fnty,
0427                                       //                 sideeffect|alignstack|
0428                                       //                 asmdialect|unwind,
0429                                       //                 asmstr,conststr]
0430   CST_CODE_CE_GEP_WITH_INRANGE = 31,  // [opty, flags, range, n x operands]
0431   CST_CODE_CE_GEP = 32,               // [opty, flags, n x operands]
0432   CST_CODE_PTRAUTH = 33,              // [ptr, key, disc, addrdisc]
0433 };
0434 
0435 /// CastOpcodes - These are values used in the bitcode files to encode which
0436 /// cast a CST_CODE_CE_CAST or a XXX refers to.  The values of these enums
0437 /// have no fixed relation to the LLVM IR enum values.  Changing these will
0438 /// break compatibility with old files.
0439 enum CastOpcodes {
0440   CAST_TRUNC = 0,
0441   CAST_ZEXT = 1,
0442   CAST_SEXT = 2,
0443   CAST_FPTOUI = 3,
0444   CAST_FPTOSI = 4,
0445   CAST_UITOFP = 5,
0446   CAST_SITOFP = 6,
0447   CAST_FPTRUNC = 7,
0448   CAST_FPEXT = 8,
0449   CAST_PTRTOINT = 9,
0450   CAST_INTTOPTR = 10,
0451   CAST_BITCAST = 11,
0452   CAST_ADDRSPACECAST = 12
0453 };
0454 
0455 /// UnaryOpcodes - These are values used in the bitcode files to encode which
0456 /// unop a CST_CODE_CE_UNOP or a XXX refers to.  The values of these enums
0457 /// have no fixed relation to the LLVM IR enum values.  Changing these will
0458 /// break compatibility with old files.
0459 enum UnaryOpcodes {
0460   UNOP_FNEG = 0
0461 };
0462 
0463 /// BinaryOpcodes - These are values used in the bitcode files to encode which
0464 /// binop a CST_CODE_CE_BINOP or a XXX refers to.  The values of these enums
0465 /// have no fixed relation to the LLVM IR enum values.  Changing these will
0466 /// break compatibility with old files.
0467 enum BinaryOpcodes {
0468   BINOP_ADD = 0,
0469   BINOP_SUB = 1,
0470   BINOP_MUL = 2,
0471   BINOP_UDIV = 3,
0472   BINOP_SDIV = 4, // overloaded for FP
0473   BINOP_UREM = 5,
0474   BINOP_SREM = 6, // overloaded for FP
0475   BINOP_SHL = 7,
0476   BINOP_LSHR = 8,
0477   BINOP_ASHR = 9,
0478   BINOP_AND = 10,
0479   BINOP_OR = 11,
0480   BINOP_XOR = 12
0481 };
0482 
0483 /// These are values used in the bitcode files to encode AtomicRMW operations.
0484 /// The values of these enums have no fixed relation to the LLVM IR enum
0485 /// values.  Changing these will break compatibility with old files.
0486 enum RMWOperations {
0487   RMW_XCHG = 0,
0488   RMW_ADD = 1,
0489   RMW_SUB = 2,
0490   RMW_AND = 3,
0491   RMW_NAND = 4,
0492   RMW_OR = 5,
0493   RMW_XOR = 6,
0494   RMW_MAX = 7,
0495   RMW_MIN = 8,
0496   RMW_UMAX = 9,
0497   RMW_UMIN = 10,
0498   RMW_FADD = 11,
0499   RMW_FSUB = 12,
0500   RMW_FMAX = 13,
0501   RMW_FMIN = 14,
0502   RMW_UINC_WRAP = 15,
0503   RMW_UDEC_WRAP = 16,
0504   RMW_USUB_COND = 17,
0505   RMW_USUB_SAT = 18
0506 };
0507 
0508 /// OverflowingBinaryOperatorOptionalFlags - Flags for serializing
0509 /// OverflowingBinaryOperator's SubclassOptionalData contents.
0510 enum OverflowingBinaryOperatorOptionalFlags {
0511   OBO_NO_UNSIGNED_WRAP = 0,
0512   OBO_NO_SIGNED_WRAP = 1
0513 };
0514 
0515 /// TruncInstOptionalFlags - Flags for serializing
0516 /// TruncInstOptionalFlags's SubclassOptionalData contents.
0517 enum TruncInstOptionalFlags {
0518   TIO_NO_UNSIGNED_WRAP = 0,
0519   TIO_NO_SIGNED_WRAP = 1
0520 };
0521 
0522 /// FastMath Flags
0523 /// This is a fixed layout derived from the bitcode emitted by LLVM 5.0
0524 /// intended to decouple the in-memory representation from the serialization.
0525 enum FastMathMap {
0526   UnsafeAlgebra   = (1 << 0), // Legacy
0527   NoNaNs          = (1 << 1),
0528   NoInfs          = (1 << 2),
0529   NoSignedZeros   = (1 << 3),
0530   AllowReciprocal = (1 << 4),
0531   AllowContract   = (1 << 5),
0532   ApproxFunc      = (1 << 6),
0533   AllowReassoc    = (1 << 7)
0534 };
0535 
0536 /// Flags for serializing PossiblyNonNegInst's SubclassOptionalData contents.
0537 enum PossiblyNonNegInstOptionalFlags { PNNI_NON_NEG = 0 };
0538 
0539 /// PossiblyExactOperatorOptionalFlags - Flags for serializing
0540 /// PossiblyExactOperator's SubclassOptionalData contents.
0541 enum PossiblyExactOperatorOptionalFlags { PEO_EXACT = 0 };
0542 
0543 /// PossiblyDisjointInstOptionalFlags - Flags for serializing
0544 /// PossiblyDisjointInst's SubclassOptionalData contents.
0545 enum PossiblyDisjointInstOptionalFlags { PDI_DISJOINT = 0 };
0546 
0547 /// Mark to distinguish metadata from value in an operator bundle.
0548 enum MetadataOperandBundleValueMarker { OB_METADATA = 0x80000000 };
0549 
0550 /// GetElementPtrOptionalFlags - Flags for serializing
0551 /// GEPOperator's SubclassOptionalData contents.
0552 enum GetElementPtrOptionalFlags {
0553   GEP_INBOUNDS = 0,
0554   GEP_NUSW = 1,
0555   GEP_NUW = 2,
0556 };
0557 
0558 /// ICmpOptionalFlags - Flags for serializing
0559 /// ICmpOptionalFlags's SubclassOptionalData contents.
0560 enum ICmpOptionalFlags { ICMP_SAME_SIGN = 0 };
0561 
0562 /// Encoded AtomicOrdering values.
0563 enum AtomicOrderingCodes {
0564   ORDERING_NOTATOMIC = 0,
0565   ORDERING_UNORDERED = 1,
0566   ORDERING_MONOTONIC = 2,
0567   ORDERING_ACQUIRE = 3,
0568   ORDERING_RELEASE = 4,
0569   ORDERING_ACQREL = 5,
0570   ORDERING_SEQCST = 6
0571 };
0572 
0573 /// Markers and flags for call instruction.
0574 enum CallMarkersFlags {
0575   CALL_TAIL = 0,
0576   CALL_CCONV = 1,
0577   CALL_MUSTTAIL = 14,
0578   CALL_EXPLICIT_TYPE = 15,
0579   CALL_NOTAIL = 16,
0580   CALL_FMF = 17 // Call has optional fast-math-flags.
0581 };
0582 
0583 // The function body block (FUNCTION_BLOCK_ID) describes function bodies.  It
0584 // can contain a constant block (CONSTANTS_BLOCK_ID).
0585 enum FunctionCodes {
0586   FUNC_CODE_DECLAREBLOCKS = 1, // DECLAREBLOCKS: [n]
0587 
0588   FUNC_CODE_INST_BINOP = 2,      // BINOP:      [opcode, ty, opval, opval]
0589   FUNC_CODE_INST_CAST = 3,       // CAST:       [opcode, ty, opty, opval]
0590   FUNC_CODE_INST_GEP_OLD = 4,    // GEP:        [n x operands]
0591   FUNC_CODE_INST_SELECT = 5,     // SELECT:     [ty, opval, opval, opval]
0592   FUNC_CODE_INST_EXTRACTELT = 6, // EXTRACTELT: [opty, opval, opval]
0593   FUNC_CODE_INST_INSERTELT = 7,  // INSERTELT:  [ty, opval, opval, opval]
0594   FUNC_CODE_INST_SHUFFLEVEC = 8, // SHUFFLEVEC: [ty, opval, opval, opval]
0595   FUNC_CODE_INST_CMP = 9,        // CMP:        [opty, opval, opval, pred]
0596 
0597   FUNC_CODE_INST_RET = 10,    // RET:        [opty,opval<both optional>]
0598   FUNC_CODE_INST_BR = 11,     // BR:         [bb#, bb#, cond] or [bb#]
0599   FUNC_CODE_INST_SWITCH = 12, // SWITCH:     [opty, op0, op1, ...]
0600   FUNC_CODE_INST_INVOKE = 13, // INVOKE:     [attr, fnty, op0,op1, ...]
0601   // 14 is unused.
0602   FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE
0603 
0604   FUNC_CODE_INST_PHI = 16, // PHI:        [ty, val0,bb0, ...]
0605   // 17 is unused.
0606   // 18 is unused.
0607   FUNC_CODE_INST_ALLOCA = 19, // ALLOCA:     [instty, opty, op, align]
0608   FUNC_CODE_INST_LOAD = 20,   // LOAD:       [opty, op, align, vol]
0609   // 21 is unused.
0610   // 22 is unused.
0611   FUNC_CODE_INST_VAARG = 23, // VAARG:      [valistty, valist, instty]
0612   // This store code encodes the pointer type, rather than the value type
0613   // this is so information only available in the pointer type (e.g. address
0614   // spaces) is retained.
0615   FUNC_CODE_INST_STORE_OLD = 24, // STORE:      [ptrty,ptr,val, align, vol]
0616   // 25 is unused.
0617   FUNC_CODE_INST_EXTRACTVAL = 26, // EXTRACTVAL: [n x operands]
0618   FUNC_CODE_INST_INSERTVAL = 27,  // INSERTVAL:  [n x operands]
0619   // fcmp/icmp returning Int1TY or vector of Int1Ty. Same as CMP, exists to
0620   // support legacy vicmp/vfcmp instructions.
0621   FUNC_CODE_INST_CMP2 = 28, // CMP2:       [opty, opval, opval, pred]
0622   // new select on i1 or [N x i1]
0623   FUNC_CODE_INST_VSELECT = 29, // VSELECT:    [ty,opval,opval,predty,pred]
0624   FUNC_CODE_INST_INBOUNDS_GEP_OLD = 30, // INBOUNDS_GEP: [n x operands]
0625   FUNC_CODE_INST_INDIRECTBR = 31,       // INDIRECTBR: [opty, op0, op1, ...]
0626   // 32 is unused.
0627   FUNC_CODE_DEBUG_LOC_AGAIN = 33, // DEBUG_LOC_AGAIN
0628 
0629   FUNC_CODE_INST_CALL = 34, // CALL:    [attr, cc, fnty, fnid, args...]
0630 
0631   FUNC_CODE_DEBUG_LOC = 35,          // DEBUG_LOC:  [Line,Col,ScopeVal, IAVal]
0632   FUNC_CODE_INST_FENCE = 36,         // FENCE: [ordering, synchscope]
0633   FUNC_CODE_INST_CMPXCHG_OLD = 37,   // CMPXCHG: [ptrty, ptr, cmp, val, vol,
0634                                      //            ordering, synchscope,
0635                                      //            failure_ordering?, weak?]
0636   FUNC_CODE_INST_ATOMICRMW_OLD = 38, // ATOMICRMW: [ptrty,ptr,val, operation,
0637                                      //             align, vol,
0638                                      //             ordering, synchscope]
0639   FUNC_CODE_INST_RESUME = 39,        // RESUME:     [opval]
0640   FUNC_CODE_INST_LANDINGPAD_OLD =
0641       40,                         // LANDINGPAD: [ty,val,val,num,id0,val0...]
0642   FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [opty, op, align, vol,
0643                                   //        ordering, synchscope]
0644   FUNC_CODE_INST_STOREATOMIC_OLD = 42, // STORE: [ptrty,ptr,val, align, vol
0645                                        //         ordering, synchscope]
0646   FUNC_CODE_INST_GEP = 43,             // GEP:  [inbounds, n x operands]
0647   FUNC_CODE_INST_STORE = 44,       // STORE: [ptrty,ptr,valty,val, align, vol]
0648   FUNC_CODE_INST_STOREATOMIC = 45, // STORE: [ptrty,ptr,val, align, vol
0649   FUNC_CODE_INST_CMPXCHG = 46,     // CMPXCHG: [ptrty, ptr, cmp, val, vol,
0650                                    //           success_ordering, synchscope,
0651                                    //           failure_ordering, weak]
0652   FUNC_CODE_INST_LANDINGPAD = 47,  // LANDINGPAD: [ty,val,num,id0,val0...]
0653   FUNC_CODE_INST_CLEANUPRET = 48,  // CLEANUPRET: [val] or [val,bb#]
0654   FUNC_CODE_INST_CATCHRET = 49,    // CATCHRET: [val,bb#]
0655   FUNC_CODE_INST_CATCHPAD = 50,    // CATCHPAD: [bb#,bb#,num,args...]
0656   FUNC_CODE_INST_CLEANUPPAD = 51,  // CLEANUPPAD: [num,args...]
0657   FUNC_CODE_INST_CATCHSWITCH =
0658       52, // CATCHSWITCH: [num,args...] or [num,args...,bb]
0659   // 53 is unused.
0660   // 54 is unused.
0661   FUNC_CODE_OPERAND_BUNDLE = 55,  // OPERAND_BUNDLE: [tag#, value...]
0662   FUNC_CODE_INST_UNOP = 56,       // UNOP:       [opcode, ty, opval]
0663   FUNC_CODE_INST_CALLBR = 57,     // CALLBR:     [attr, cc, norm, transfs,
0664                                   //              fnty, fnid, args...]
0665   FUNC_CODE_INST_FREEZE = 58,     // FREEZE: [opty, opval]
0666   FUNC_CODE_INST_ATOMICRMW = 59,  // ATOMICRMW: [ptrty, ptr, valty, val,
0667                                   //             operation, align, vol,
0668                                   //             ordering, synchscope]
0669   FUNC_CODE_BLOCKADDR_USERS = 60, // BLOCKADDR_USERS: [value...]
0670 
0671   FUNC_CODE_DEBUG_RECORD_VALUE =
0672       61, // [DILocation, DILocalVariable, DIExpression, ValueAsMetadata]
0673   FUNC_CODE_DEBUG_RECORD_DECLARE =
0674       62, // [DILocation, DILocalVariable, DIExpression, ValueAsMetadata]
0675   FUNC_CODE_DEBUG_RECORD_ASSIGN =
0676       63, // [DILocation, DILocalVariable, DIExpression, ValueAsMetadata,
0677           //  DIAssignID, DIExpression (addr), ValueAsMetadata (addr)]
0678   FUNC_CODE_DEBUG_RECORD_VALUE_SIMPLE =
0679       64, // [DILocation, DILocalVariable, DIExpression, Value]
0680   FUNC_CODE_DEBUG_RECORD_LABEL = 65, // [DILocation, DILabel]
0681 };
0682 
0683 enum UseListCodes {
0684   USELIST_CODE_DEFAULT = 1, // DEFAULT: [index..., value-id]
0685   USELIST_CODE_BB = 2       // BB: [index..., bb-id]
0686 };
0687 
0688 enum AttributeKindCodes {
0689   // = 0 is unused
0690   ATTR_KIND_ALIGNMENT = 1,
0691   ATTR_KIND_ALWAYS_INLINE = 2,
0692   ATTR_KIND_BY_VAL = 3,
0693   ATTR_KIND_INLINE_HINT = 4,
0694   ATTR_KIND_IN_REG = 5,
0695   ATTR_KIND_MIN_SIZE = 6,
0696   ATTR_KIND_NAKED = 7,
0697   ATTR_KIND_NEST = 8,
0698   ATTR_KIND_NO_ALIAS = 9,
0699   ATTR_KIND_NO_BUILTIN = 10,
0700   ATTR_KIND_NO_CAPTURE = 11,
0701   ATTR_KIND_NO_DUPLICATE = 12,
0702   ATTR_KIND_NO_IMPLICIT_FLOAT = 13,
0703   ATTR_KIND_NO_INLINE = 14,
0704   ATTR_KIND_NON_LAZY_BIND = 15,
0705   ATTR_KIND_NO_RED_ZONE = 16,
0706   ATTR_KIND_NO_RETURN = 17,
0707   ATTR_KIND_NO_UNWIND = 18,
0708   ATTR_KIND_OPTIMIZE_FOR_SIZE = 19,
0709   ATTR_KIND_READ_NONE = 20,
0710   ATTR_KIND_READ_ONLY = 21,
0711   ATTR_KIND_RETURNED = 22,
0712   ATTR_KIND_RETURNS_TWICE = 23,
0713   ATTR_KIND_S_EXT = 24,
0714   ATTR_KIND_STACK_ALIGNMENT = 25,
0715   ATTR_KIND_STACK_PROTECT = 26,
0716   ATTR_KIND_STACK_PROTECT_REQ = 27,
0717   ATTR_KIND_STACK_PROTECT_STRONG = 28,
0718   ATTR_KIND_STRUCT_RET = 29,
0719   ATTR_KIND_SANITIZE_ADDRESS = 30,
0720   ATTR_KIND_SANITIZE_THREAD = 31,
0721   ATTR_KIND_SANITIZE_MEMORY = 32,
0722   ATTR_KIND_UW_TABLE = 33,
0723   ATTR_KIND_Z_EXT = 34,
0724   ATTR_KIND_BUILTIN = 35,
0725   ATTR_KIND_COLD = 36,
0726   ATTR_KIND_OPTIMIZE_NONE = 37,
0727   ATTR_KIND_IN_ALLOCA = 38,
0728   ATTR_KIND_NON_NULL = 39,
0729   ATTR_KIND_JUMP_TABLE = 40,
0730   ATTR_KIND_DEREFERENCEABLE = 41,
0731   ATTR_KIND_DEREFERENCEABLE_OR_NULL = 42,
0732   ATTR_KIND_CONVERGENT = 43,
0733   ATTR_KIND_SAFESTACK = 44,
0734   ATTR_KIND_ARGMEMONLY = 45,
0735   ATTR_KIND_SWIFT_SELF = 46,
0736   ATTR_KIND_SWIFT_ERROR = 47,
0737   ATTR_KIND_NO_RECURSE = 48,
0738   ATTR_KIND_INACCESSIBLEMEM_ONLY = 49,
0739   ATTR_KIND_INACCESSIBLEMEM_OR_ARGMEMONLY = 50,
0740   ATTR_KIND_ALLOC_SIZE = 51,
0741   ATTR_KIND_WRITEONLY = 52,
0742   ATTR_KIND_SPECULATABLE = 53,
0743   ATTR_KIND_STRICT_FP = 54,
0744   ATTR_KIND_SANITIZE_HWADDRESS = 55,
0745   ATTR_KIND_NOCF_CHECK = 56,
0746   ATTR_KIND_OPT_FOR_FUZZING = 57,
0747   ATTR_KIND_SHADOWCALLSTACK = 58,
0748   ATTR_KIND_SPECULATIVE_LOAD_HARDENING = 59,
0749   ATTR_KIND_IMMARG = 60,
0750   ATTR_KIND_WILLRETURN = 61,
0751   ATTR_KIND_NOFREE = 62,
0752   ATTR_KIND_NOSYNC = 63,
0753   ATTR_KIND_SANITIZE_MEMTAG = 64,
0754   ATTR_KIND_PREALLOCATED = 65,
0755   ATTR_KIND_NO_MERGE = 66,
0756   ATTR_KIND_NULL_POINTER_IS_VALID = 67,
0757   ATTR_KIND_NOUNDEF = 68,
0758   ATTR_KIND_BYREF = 69,
0759   ATTR_KIND_MUSTPROGRESS = 70,
0760   ATTR_KIND_NO_CALLBACK = 71,
0761   ATTR_KIND_HOT = 72,
0762   ATTR_KIND_NO_PROFILE = 73,
0763   ATTR_KIND_VSCALE_RANGE = 74,
0764   ATTR_KIND_SWIFT_ASYNC = 75,
0765   ATTR_KIND_NO_SANITIZE_COVERAGE = 76,
0766   ATTR_KIND_ELEMENTTYPE = 77,
0767   ATTR_KIND_DISABLE_SANITIZER_INSTRUMENTATION = 78,
0768   ATTR_KIND_NO_SANITIZE_BOUNDS = 79,
0769   ATTR_KIND_ALLOC_ALIGN = 80,
0770   ATTR_KIND_ALLOCATED_POINTER = 81,
0771   ATTR_KIND_ALLOC_KIND = 82,
0772   ATTR_KIND_PRESPLIT_COROUTINE = 83,
0773   ATTR_KIND_FNRETTHUNK_EXTERN = 84,
0774   ATTR_KIND_SKIP_PROFILE = 85,
0775   ATTR_KIND_MEMORY = 86,
0776   ATTR_KIND_NOFPCLASS = 87,
0777   ATTR_KIND_OPTIMIZE_FOR_DEBUGGING = 88,
0778   ATTR_KIND_WRITABLE = 89,
0779   ATTR_KIND_CORO_ONLY_DESTROY_WHEN_COMPLETE = 90,
0780   ATTR_KIND_DEAD_ON_UNWIND = 91,
0781   ATTR_KIND_RANGE = 92,
0782   ATTR_KIND_SANITIZE_NUMERICAL_STABILITY = 93,
0783   ATTR_KIND_INITIALIZES = 94,
0784   ATTR_KIND_HYBRID_PATCHABLE = 95,
0785   ATTR_KIND_SANITIZE_REALTIME = 96,
0786   ATTR_KIND_SANITIZE_REALTIME_BLOCKING = 97,
0787   ATTR_KIND_CORO_ELIDE_SAFE = 98,
0788   ATTR_KIND_NO_EXT = 99,
0789   ATTR_KIND_NO_DIVERGENCE_SOURCE = 100,
0790   ATTR_KIND_SANITIZE_TYPE = 101,
0791   ATTR_KIND_CAPTURES = 102,
0792 };
0793 
0794 enum ComdatSelectionKindCodes {
0795   COMDAT_SELECTION_KIND_ANY = 1,
0796   COMDAT_SELECTION_KIND_EXACT_MATCH = 2,
0797   COMDAT_SELECTION_KIND_LARGEST = 3,
0798   COMDAT_SELECTION_KIND_NO_DUPLICATES = 4,
0799   COMDAT_SELECTION_KIND_SAME_SIZE = 5,
0800 };
0801 
0802 enum StrtabCodes {
0803   STRTAB_BLOB = 1,
0804 };
0805 
0806 enum SymtabCodes {
0807   SYMTAB_BLOB = 1,
0808 };
0809 
0810 } // End bitc namespace
0811 } // End llvm namespace
0812 
0813 #endif