1 | //===- LLVMBitCodes.h - Enum values for the LLVM bitcode format -*- C++ -*-===// |
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | // |
9 | // This header defines Bitcode enum values for LLVM IR bitcode files. |
10 | // |
11 | // The enum values defined in this file should be considered permanent. If |
12 | // new features are added, they should have values added at the end of the |
13 | // respective lists. |
14 | // |
15 | //===----------------------------------------------------------------------===// |
16 | |
17 | #ifndef LLVM_BITCODE_LLVMBITCODES_H |
18 | #define LLVM_BITCODE_LLVMBITCODES_H |
19 | |
20 | // This is the only file included, and it, in turn, is a leaf header. |
21 | // This allows external tools to dump the AST of this file and analyze it for |
22 | // changes without needing to fully or partially build LLVM itself. |
23 | #include "llvm/Bitstream/BitCodeEnums.h" |
24 | |
25 | namespace llvm { |
26 | namespace bitc { |
27 | // The only top-level block types are MODULE, IDENTIFICATION, STRTAB and SYMTAB. |
28 | enum BlockIDs { |
29 | // Blocks |
30 | MODULE_BLOCK_ID = FIRST_APPLICATION_BLOCKID, |
31 | |
32 | // Module sub-block id's. |
33 | PARAMATTR_BLOCK_ID, |
34 | PARAMATTR_GROUP_BLOCK_ID, |
35 | |
36 | CONSTANTS_BLOCK_ID, |
37 | FUNCTION_BLOCK_ID, |
38 | |
39 | // Block intended to contains information on the bitcode versioning. |
40 | // Can be used to provide better error messages when we fail to parse a |
41 | // bitcode file. |
42 | IDENTIFICATION_BLOCK_ID, |
43 | |
44 | VALUE_SYMTAB_BLOCK_ID, |
45 | METADATA_BLOCK_ID, |
46 | METADATA_ATTACHMENT_ID, |
47 | |
48 | TYPE_BLOCK_ID_NEW, |
49 | |
50 | USELIST_BLOCK_ID, |
51 | |
52 | MODULE_STRTAB_BLOCK_ID, |
53 | GLOBALVAL_SUMMARY_BLOCK_ID, |
54 | |
55 | OPERAND_BUNDLE_TAGS_BLOCK_ID, |
56 | |
57 | METADATA_KIND_BLOCK_ID, |
58 | |
59 | STRTAB_BLOCK_ID, |
60 | |
61 | FULL_LTO_GLOBALVAL_SUMMARY_BLOCK_ID, |
62 | |
63 | SYMTAB_BLOCK_ID, |
64 | |
65 | SYNC_SCOPE_NAMES_BLOCK_ID, |
66 | }; |
67 | |
68 | /// Identification block contains a string that describes the producer details, |
69 | /// and an epoch that defines the auto-upgrade capability. |
70 | enum IdentificationCodes { |
71 | IDENTIFICATION_CODE_STRING = 1, // IDENTIFICATION: [strchr x N] |
72 | IDENTIFICATION_CODE_EPOCH = 2, // EPOCH: [epoch#] |
73 | }; |
74 | |
75 | /// The epoch that defines the auto-upgrade compatibility for the bitcode. |
76 | /// |
77 | /// LLVM guarantees in a major release that a minor release can read bitcode |
78 | /// generated by previous minor releases. We translate this by making the reader |
79 | /// accepting only bitcode with the same epoch, except for the X.0 release which |
80 | /// also accepts N-1. |
81 | enum { BITCODE_CURRENT_EPOCH = 0 }; |
82 | |
83 | /// MODULE blocks have a number of optional fields and subblocks. |
84 | enum ModuleCodes { |
85 | MODULE_CODE_VERSION = 1, // VERSION: [version#] |
86 | MODULE_CODE_TRIPLE = 2, // TRIPLE: [strchr x N] |
87 | MODULE_CODE_DATALAYOUT = 3, // DATALAYOUT: [strchr x N] |
88 | MODULE_CODE_ASM = 4, // ASM: [strchr x N] |
89 | MODULE_CODE_SECTIONNAME = 5, // SECTIONNAME: [strchr x N] |
90 | |
91 | // Deprecated, but still needed to read old bitcode files. |
92 | MODULE_CODE_DEPLIB = 6, // DEPLIB: [strchr x N] |
93 | |
94 | // GLOBALVAR: [pointer type, isconst, initid, |
95 | // linkage, alignment, section, visibility, threadlocal] |
96 | MODULE_CODE_GLOBALVAR = 7, |
97 | |
98 | // FUNCTION: [type, callingconv, isproto, linkage, paramattrs, alignment, |
99 | // section, visibility, gc, unnamed_addr] |
100 | MODULE_CODE_FUNCTION = 8, |
101 | |
102 | // ALIAS: [alias type, aliasee val#, linkage, visibility] |
103 | MODULE_CODE_ALIAS_OLD = 9, |
104 | |
105 | MODULE_CODE_GCNAME = 11, // GCNAME: [strchr x N] |
106 | MODULE_CODE_COMDAT = 12, // COMDAT: [selection_kind, name] |
107 | |
108 | MODULE_CODE_VSTOFFSET = 13, // VSTOFFSET: [offset] |
109 | |
110 | // ALIAS: [alias value type, addrspace, aliasee val#, linkage, visibility] |
111 | MODULE_CODE_ALIAS = 14, |
112 | |
113 | MODULE_CODE_METADATA_VALUES_UNUSED = 15, |
114 | |
115 | // SOURCE_FILENAME: [namechar x N] |
116 | MODULE_CODE_SOURCE_FILENAME = 16, |
117 | |
118 | // HASH: [5*i32] |
119 | MODULE_CODE_HASH = 17, |
120 | |
121 | // IFUNC: [ifunc value type, addrspace, resolver val#, linkage, visibility] |
122 | MODULE_CODE_IFUNC = 18, |
123 | }; |
124 | |
125 | /// PARAMATTR blocks have code for defining a parameter attribute set. |
126 | enum AttributeCodes { |
127 | // Deprecated, but still needed to read old bitcode files. |
128 | PARAMATTR_CODE_ENTRY_OLD = 1, // ENTRY: [paramidx0, attr0, |
129 | // paramidx1, attr1...] |
130 | PARAMATTR_CODE_ENTRY = 2, // ENTRY: [attrgrp0, attrgrp1, ...] |
131 | PARAMATTR_GRP_CODE_ENTRY = 3 // ENTRY: [grpid, idx, attr0, attr1, ...] |
132 | }; |
133 | |
134 | /// TYPE blocks have codes for each type primitive they use. |
135 | enum TypeCodes { |
136 | TYPE_CODE_NUMENTRY = 1, // NUMENTRY: [numentries] |
137 | |
138 | // Type Codes |
139 | TYPE_CODE_VOID = 2, // VOID |
140 | TYPE_CODE_FLOAT = 3, // FLOAT |
141 | TYPE_CODE_DOUBLE = 4, // DOUBLE |
142 | TYPE_CODE_LABEL = 5, // LABEL |
143 | TYPE_CODE_OPAQUE = 6, // OPAQUE |
144 | TYPE_CODE_INTEGER = 7, // INTEGER: [width] |
145 | TYPE_CODE_POINTER = 8, // POINTER: [pointee type] |
146 | |
147 | TYPE_CODE_FUNCTION_OLD = 9, // FUNCTION: [vararg, attrid, retty, |
148 | // paramty x N] |
149 | |
150 | TYPE_CODE_HALF = 10, // HALF |
151 | |
152 | TYPE_CODE_ARRAY = 11, // ARRAY: [numelts, eltty] |
153 | TYPE_CODE_VECTOR = 12, // VECTOR: [numelts, eltty] |
154 | |
155 | // These are not with the other floating point types because they're |
156 | // a late addition, and putting them in the right place breaks |
157 | // binary compatibility. |
158 | TYPE_CODE_X86_FP80 = 13, // X86 LONG DOUBLE |
159 | TYPE_CODE_FP128 = 14, // LONG DOUBLE (112 bit mantissa) |
160 | TYPE_CODE_PPC_FP128 = 15, // PPC LONG DOUBLE (2 doubles) |
161 | |
162 | TYPE_CODE_METADATA = 16, // METADATA |
163 | |
164 | TYPE_CODE_X86_MMX = 17, // X86 MMX |
165 | |
166 | TYPE_CODE_STRUCT_ANON = 18, // STRUCT_ANON: [ispacked, eltty x N] |
167 | TYPE_CODE_STRUCT_NAME = 19, // STRUCT_NAME: [strchr x N] |
168 | TYPE_CODE_STRUCT_NAMED = 20, // STRUCT_NAMED: [ispacked, eltty x N] |
169 | |
170 | TYPE_CODE_FUNCTION = 21, // FUNCTION: [vararg, retty, paramty x N] |
171 | |
172 | TYPE_CODE_TOKEN = 22, // TOKEN |
173 | |
174 | TYPE_CODE_BFLOAT = 23, // BRAIN FLOATING POINT |
175 | TYPE_CODE_X86_AMX = 24, // X86 AMX |
176 | |
177 | TYPE_CODE_OPAQUE_POINTER = 25, // OPAQUE_POINTER: [addrspace] |
178 | |
179 | TYPE_CODE_TARGET_TYPE = 26, // TARGET_TYPE |
180 | }; |
181 | |
182 | enum OperandBundleTagCode { |
183 | OPERAND_BUNDLE_TAG = 1, // TAG: [strchr x N] |
184 | }; |
185 | |
186 | enum SyncScopeNameCode { |
187 | SYNC_SCOPE_NAME = 1, |
188 | }; |
189 | |
190 | // Value symbol table codes. |
191 | enum ValueSymtabCodes { |
192 | VST_CODE_ENTRY = 1, // VST_ENTRY: [valueid, namechar x N] |
193 | VST_CODE_BBENTRY = 2, // VST_BBENTRY: [bbid, namechar x N] |
194 | VST_CODE_FNENTRY = 3, // VST_FNENTRY: [valueid, offset, namechar x N] |
195 | // VST_COMBINED_ENTRY: [valueid, refguid] |
196 | VST_CODE_COMBINED_ENTRY = 5 |
197 | }; |
198 | |
199 | // The module path symbol table only has one code (MST_CODE_ENTRY). |
200 | enum ModulePathSymtabCodes { |
201 | MST_CODE_ENTRY = 1, // MST_ENTRY: [modid, namechar x N] |
202 | MST_CODE_HASH = 2, // MST_HASH: [5*i32] |
203 | }; |
204 | |
205 | // The summary section uses different codes in the per-module |
206 | // and combined index cases. |
207 | enum GlobalValueSummarySymtabCodes { |
208 | // PERMODULE: [valueid, flags, instcount, numrefs, numrefs x valueid, |
209 | // n x (valueid)] |
210 | FS_PERMODULE = 1, |
211 | // PERMODULE_PROFILE: [valueid, flags, instcount, numrefs, |
212 | // numrefs x valueid, |
213 | // n x (valueid, hotness+tailcall)] |
214 | FS_PERMODULE_PROFILE = 2, |
215 | // PERMODULE_GLOBALVAR_INIT_REFS: [valueid, flags, n x valueid] |
216 | FS_PERMODULE_GLOBALVAR_INIT_REFS = 3, |
217 | // COMBINED: [valueid, modid, flags, instcount, numrefs, numrefs x valueid, |
218 | // n x (valueid)] |
219 | FS_COMBINED = 4, |
220 | // COMBINED_PROFILE: [valueid, modid, flags, instcount, numrefs, |
221 | // numrefs x valueid, |
222 | // n x (valueid, hotness+tailcall)] |
223 | FS_COMBINED_PROFILE = 5, |
224 | // COMBINED_GLOBALVAR_INIT_REFS: [valueid, modid, flags, n x valueid] |
225 | FS_COMBINED_GLOBALVAR_INIT_REFS = 6, |
226 | // ALIAS: [valueid, flags, valueid] |
227 | FS_ALIAS = 7, |
228 | // COMBINED_ALIAS: [valueid, modid, flags, valueid] |
229 | FS_COMBINED_ALIAS = 8, |
230 | // COMBINED_ORIGINAL_NAME: [original_name_hash] |
231 | FS_COMBINED_ORIGINAL_NAME = 9, |
232 | // VERSION of the summary, bumped when adding flags for instance. |
233 | FS_VERSION = 10, |
234 | // The list of llvm.type.test type identifiers used by the following function |
235 | // that are used other than by an llvm.assume. |
236 | // [n x typeid] |
237 | FS_TYPE_TESTS = 11, |
238 | // The list of virtual calls made by this function using |
239 | // llvm.assume(llvm.type.test) intrinsics that do not have all constant |
240 | // integer arguments. |
241 | // [n x (typeid, offset)] |
242 | FS_TYPE_TEST_ASSUME_VCALLS = 12, |
243 | // The list of virtual calls made by this function using |
244 | // llvm.type.checked.load intrinsics that do not have all constant integer |
245 | // arguments. |
246 | // [n x (typeid, offset)] |
247 | FS_TYPE_CHECKED_LOAD_VCALLS = 13, |
248 | // Identifies a virtual call made by this function using an |
249 | // llvm.assume(llvm.type.test) intrinsic with all constant integer arguments. |
250 | // [typeid, offset, n x arg] |
251 | FS_TYPE_TEST_ASSUME_CONST_VCALL = 14, |
252 | // Identifies a virtual call made by this function using an |
253 | // llvm.type.checked.load intrinsic with all constant integer arguments. |
254 | // [typeid, offset, n x arg] |
255 | FS_TYPE_CHECKED_LOAD_CONST_VCALL = 15, |
256 | // Assigns a GUID to a value ID. This normally appears only in combined |
257 | // summaries, but it can also appear in per-module summaries for PGO data. |
258 | // [valueid, guid] |
259 | FS_VALUE_GUID = 16, |
260 | // The list of local functions with CFI jump tables. Function names are |
261 | // strings in strtab. |
262 | // [n * name] |
263 | FS_CFI_FUNCTION_DEFS = 17, |
264 | // The list of external functions with CFI jump tables. Function names are |
265 | // strings in strtab. |
266 | // [n * name] |
267 | FS_CFI_FUNCTION_DECLS = 18, |
268 | // Per-module summary that also adds relative block frequency to callee info. |
269 | // PERMODULE_RELBF: [valueid, flags, instcount, numrefs, |
270 | // numrefs x valueid, |
271 | // n x (valueid, relblockfreq+tailcall)] |
272 | FS_PERMODULE_RELBF = 19, |
273 | // Index-wide flags |
274 | FS_FLAGS = 20, |
275 | // Maps type identifier to summary information for that type identifier. |
276 | // Produced by the thin link (only lives in combined index). |
277 | // TYPE_ID: [typeid, kind, bitwidth, align, size, bitmask, inlinebits, |
278 | // n x (typeid, kind, name, numrba, |
279 | // numrba x (numarg, numarg x arg, kind, info, byte, bit))] |
280 | FS_TYPE_ID = 21, |
281 | // For background see overview at https://llvm.org/docs/TypeMetadata.html. |
282 | // The type metadata includes both the type identifier and the offset of |
283 | // the address point of the type (the address held by objects of that type |
284 | // which may not be the beginning of the virtual table). Vtable definitions |
285 | // are decorated with type metadata for the types they are compatible with. |
286 | // |
287 | // Maps type identifier to summary information for that type identifier |
288 | // computed from type metadata: the valueid of each vtable definition |
289 | // decorated with a type metadata for that identifier, and the offset from |
290 | // the corresponding type metadata. |
291 | // Exists in the per-module summary to provide information to thin link |
292 | // for index-based whole program devirtualization. |
293 | // TYPE_ID_METADATA: [typeid, n x (valueid, offset)] |
294 | FS_TYPE_ID_METADATA = 22, |
295 | // Summarizes vtable definition for use in index-based whole program |
296 | // devirtualization during the thin link. |
297 | // PERMODULE_VTABLE_GLOBALVAR_INIT_REFS: [valueid, flags, varflags, |
298 | // numrefs, numrefs x valueid, |
299 | // n x (valueid, offset)] |
300 | FS_PERMODULE_VTABLE_GLOBALVAR_INIT_REFS = 23, |
301 | // The total number of basic blocks in the module. |
302 | FS_BLOCK_COUNT = 24, |
303 | // Range information for accessed offsets for every argument. |
304 | // [n x (paramno, range, numcalls, numcalls x (callee_guid, paramno, range))] |
305 | FS_PARAM_ACCESS = 25, |
306 | // Summary of per-module memprof callsite metadata. |
307 | // [valueid, n x stackidindex] |
308 | FS_PERMODULE_CALLSITE_INFO = 26, |
309 | // Summary of per-module allocation memprof metadata. |
310 | // [n x (alloc type, nummib, nummib x stackidindex)] |
311 | FS_PERMODULE_ALLOC_INFO = 27, |
312 | // Summary of combined index memprof callsite metadata. |
313 | // [valueid, numstackindices, numver, |
314 | // numstackindices x stackidindex, numver x version] |
315 | FS_COMBINED_CALLSITE_INFO = 28, |
316 | // Summary of combined index allocation memprof metadata. |
317 | // [nummib, numver, |
318 | // nummib x (alloc type, numstackids, numstackids x stackidindex), |
319 | // numver x version] |
320 | FS_COMBINED_ALLOC_INFO = 29, |
321 | FS_STACK_IDS = 30, |
322 | }; |
323 | |
324 | enum MetadataCodes { |
325 | METADATA_STRING_OLD = 1, // MDSTRING: [values] |
326 | METADATA_VALUE = 2, // VALUE: [type num, value num] |
327 | METADATA_NODE = 3, // NODE: [n x md num] |
328 | METADATA_NAME = 4, // STRING: [values] |
329 | METADATA_DISTINCT_NODE = 5, // DISTINCT_NODE: [n x md num] |
330 | METADATA_KIND = 6, // [n x [id, name]] |
331 | METADATA_LOCATION = 7, // [distinct, line, col, scope, inlined-at?] |
332 | METADATA_OLD_NODE = 8, // OLD_NODE: [n x (type num, value num)] |
333 | METADATA_OLD_FN_NODE = 9, // OLD_FN_NODE: [n x (type num, value num)] |
334 | METADATA_NAMED_NODE = 10, // NAMED_NODE: [n x mdnodes] |
335 | METADATA_ATTACHMENT = 11, // [m x [value, [n x [id, mdnode]]] |
336 | METADATA_GENERIC_DEBUG = 12, // [distinct, tag, vers, header, n x md num] |
337 | METADATA_SUBRANGE = 13, // [distinct, count, lo] |
338 | METADATA_ENUMERATOR = 14, // [isUnsigned|distinct, value, name] |
339 | METADATA_BASIC_TYPE = 15, // [distinct, tag, name, size, align, enc] |
340 | METADATA_FILE = 16, // [distinct, filename, directory, checksumkind, checksum] |
341 | METADATA_DERIVED_TYPE = 17, // [distinct, ...] |
342 | METADATA_COMPOSITE_TYPE = 18, // [distinct, ...] |
343 | METADATA_SUBROUTINE_TYPE = 19, // [distinct, flags, types, cc] |
344 | METADATA_COMPILE_UNIT = 20, // [distinct, ...] |
345 | METADATA_SUBPROGRAM = 21, // [distinct, ...] |
346 | METADATA_LEXICAL_BLOCK = 22, // [distinct, scope, file, line, column] |
347 | METADATA_LEXICAL_BLOCK_FILE = 23, //[distinct, scope, file, discriminator] |
348 | METADATA_NAMESPACE = 24, // [distinct, scope, file, name, line, exportSymbols] |
349 | METADATA_TEMPLATE_TYPE = 25, // [distinct, scope, name, type, ...] |
350 | METADATA_TEMPLATE_VALUE = 26, // [distinct, scope, name, type, value, ...] |
351 | METADATA_GLOBAL_VAR = 27, // [distinct, ...] |
352 | METADATA_LOCAL_VAR = 28, // [distinct, ...] |
353 | METADATA_EXPRESSION = 29, // [distinct, n x element] |
354 | METADATA_OBJC_PROPERTY = 30, // [distinct, name, file, line, ...] |
355 | METADATA_IMPORTED_ENTITY = 31, // [distinct, tag, scope, entity, line, name] |
356 | METADATA_MODULE = 32, // [distinct, scope, name, ...] |
357 | METADATA_MACRO = 33, // [distinct, macinfo, line, name, value] |
358 | METADATA_MACRO_FILE = 34, // [distinct, macinfo, line, file, ...] |
359 | METADATA_STRINGS = 35, // [count, offset] blob([lengths][chars]) |
360 | METADATA_GLOBAL_DECL_ATTACHMENT = 36, // [valueid, n x [id, mdnode]] |
361 | METADATA_GLOBAL_VAR_EXPR = 37, // [distinct, var, expr] |
362 | METADATA_INDEX_OFFSET = 38, // [offset] |
363 | METADATA_INDEX = 39, // [bitpos] |
364 | METADATA_LABEL = 40, // [distinct, scope, name, file, line] |
365 | METADATA_STRING_TYPE = 41, // [distinct, name, size, align,...] |
366 | // Codes 42 and 43 are reserved for support for Fortran array specific debug |
367 | // info. |
368 | METADATA_COMMON_BLOCK = 44, // [distinct, scope, name, variable,...] |
369 | METADATA_GENERIC_SUBRANGE = 45, // [distinct, count, lo, up, stride] |
370 | METADATA_ARG_LIST = 46, // [n x [type num, value num]] |
371 | METADATA_ASSIGN_ID = 47, // [distinct, ...] |
372 | }; |
373 | |
374 | // The constants block (CONSTANTS_BLOCK_ID) describes emission for each |
375 | // constant and maintains an implicit current type value. |
376 | enum ConstantsCodes { |
377 | CST_CODE_SETTYPE = 1, // SETTYPE: [typeid] |
378 | CST_CODE_NULL = 2, // NULL |
379 | CST_CODE_UNDEF = 3, // UNDEF |
380 | CST_CODE_INTEGER = 4, // INTEGER: [intval] |
381 | CST_CODE_WIDE_INTEGER = 5, // WIDE_INTEGER: [n x intval] |
382 | CST_CODE_FLOAT = 6, // FLOAT: [fpval] |
383 | CST_CODE_AGGREGATE = 7, // AGGREGATE: [n x value number] |
384 | CST_CODE_STRING = 8, // STRING: [values] |
385 | CST_CODE_CSTRING = 9, // CSTRING: [values] |
386 | CST_CODE_CE_BINOP = 10, // CE_BINOP: [opcode, opval, opval] |
387 | CST_CODE_CE_CAST = 11, // CE_CAST: [opcode, opty, opval] |
388 | CST_CODE_CE_GEP = 12, // CE_GEP: [n x operands] |
389 | CST_CODE_CE_SELECT = 13, // CE_SELECT: [opval, opval, opval] |
390 | = 14, // CE_EXTRACTELT: [opty, opval, opval] |
391 | CST_CODE_CE_INSERTELT = 15, // CE_INSERTELT: [opval, opval, opval] |
392 | CST_CODE_CE_SHUFFLEVEC = 16, // CE_SHUFFLEVEC: [opval, opval, opval] |
393 | CST_CODE_CE_CMP = 17, // CE_CMP: [opty, opval, opval, pred] |
394 | CST_CODE_INLINEASM_OLD = 18, // INLINEASM: [sideeffect|alignstack, |
395 | // asmstr,conststr] |
396 | CST_CODE_CE_SHUFVEC_EX = 19, // SHUFVEC_EX: [opty, opval, opval, opval] |
397 | CST_CODE_CE_INBOUNDS_GEP = 20, // INBOUNDS_GEP: [n x operands] |
398 | CST_CODE_BLOCKADDRESS = 21, // CST_CODE_BLOCKADDRESS [fnty, fnval, bb#] |
399 | CST_CODE_DATA = 22, // DATA: [n x elements] |
400 | CST_CODE_INLINEASM_OLD2 = 23, // INLINEASM: [sideeffect|alignstack| |
401 | // asmdialect,asmstr,conststr] |
402 | CST_CODE_CE_GEP_WITH_INRANGE_INDEX_OLD = 24, // [opty, flags, n x operands] |
403 | CST_CODE_CE_UNOP = 25, // CE_UNOP: [opcode, opval] |
404 | CST_CODE_POISON = 26, // POISON |
405 | CST_CODE_DSO_LOCAL_EQUIVALENT = 27, // DSO_LOCAL_EQUIVALENT [gvty, gv] |
406 | CST_CODE_INLINEASM_OLD3 = 28, // INLINEASM: [sideeffect|alignstack| |
407 | // asmdialect|unwind, |
408 | // asmstr,conststr] |
409 | CST_CODE_NO_CFI_VALUE = 29, // NO_CFI [ fty, f ] |
410 | CST_CODE_INLINEASM = 30, // INLINEASM: [fnty, |
411 | // sideeffect|alignstack| |
412 | // asmdialect|unwind, |
413 | // asmstr,conststr] |
414 | CST_CODE_CE_GEP_WITH_INRANGE = 31, // [opty, flags, range, n x operands] |
415 | }; |
416 | |
417 | /// CastOpcodes - These are values used in the bitcode files to encode which |
418 | /// cast a CST_CODE_CE_CAST or a XXX refers to. The values of these enums |
419 | /// have no fixed relation to the LLVM IR enum values. Changing these will |
420 | /// break compatibility with old files. |
421 | enum CastOpcodes { |
422 | CAST_TRUNC = 0, |
423 | CAST_ZEXT = 1, |
424 | CAST_SEXT = 2, |
425 | CAST_FPTOUI = 3, |
426 | CAST_FPTOSI = 4, |
427 | CAST_UITOFP = 5, |
428 | CAST_SITOFP = 6, |
429 | CAST_FPTRUNC = 7, |
430 | CAST_FPEXT = 8, |
431 | CAST_PTRTOINT = 9, |
432 | CAST_INTTOPTR = 10, |
433 | CAST_BITCAST = 11, |
434 | CAST_ADDRSPACECAST = 12 |
435 | }; |
436 | |
437 | /// UnaryOpcodes - These are values used in the bitcode files to encode which |
438 | /// unop a CST_CODE_CE_UNOP or a XXX refers to. The values of these enums |
439 | /// have no fixed relation to the LLVM IR enum values. Changing these will |
440 | /// break compatibility with old files. |
441 | enum UnaryOpcodes { |
442 | UNOP_FNEG = 0 |
443 | }; |
444 | |
445 | /// BinaryOpcodes - These are values used in the bitcode files to encode which |
446 | /// binop a CST_CODE_CE_BINOP or a XXX refers to. The values of these enums |
447 | /// have no fixed relation to the LLVM IR enum values. Changing these will |
448 | /// break compatibility with old files. |
449 | enum BinaryOpcodes { |
450 | BINOP_ADD = 0, |
451 | BINOP_SUB = 1, |
452 | BINOP_MUL = 2, |
453 | BINOP_UDIV = 3, |
454 | BINOP_SDIV = 4, // overloaded for FP |
455 | BINOP_UREM = 5, |
456 | BINOP_SREM = 6, // overloaded for FP |
457 | BINOP_SHL = 7, |
458 | BINOP_LSHR = 8, |
459 | BINOP_ASHR = 9, |
460 | BINOP_AND = 10, |
461 | BINOP_OR = 11, |
462 | BINOP_XOR = 12 |
463 | }; |
464 | |
465 | /// These are values used in the bitcode files to encode AtomicRMW operations. |
466 | /// The values of these enums have no fixed relation to the LLVM IR enum |
467 | /// values. Changing these will break compatibility with old files. |
468 | enum RMWOperations { |
469 | RMW_XCHG = 0, |
470 | RMW_ADD = 1, |
471 | RMW_SUB = 2, |
472 | RMW_AND = 3, |
473 | RMW_NAND = 4, |
474 | RMW_OR = 5, |
475 | RMW_XOR = 6, |
476 | RMW_MAX = 7, |
477 | RMW_MIN = 8, |
478 | RMW_UMAX = 9, |
479 | RMW_UMIN = 10, |
480 | RMW_FADD = 11, |
481 | RMW_FSUB = 12, |
482 | RMW_FMAX = 13, |
483 | RMW_FMIN = 14, |
484 | RMW_UINC_WRAP = 15, |
485 | RMW_UDEC_WRAP = 16 |
486 | }; |
487 | |
488 | /// OverflowingBinaryOperatorOptionalFlags - Flags for serializing |
489 | /// OverflowingBinaryOperator's SubclassOptionalData contents. |
490 | enum OverflowingBinaryOperatorOptionalFlags { |
491 | OBO_NO_UNSIGNED_WRAP = 0, |
492 | OBO_NO_SIGNED_WRAP = 1 |
493 | }; |
494 | |
495 | /// TruncInstOptionalFlags - Flags for serializing |
496 | /// TruncInstOptionalFlags's SubclassOptionalData contents. |
497 | enum TruncInstOptionalFlags { |
498 | TIO_NO_UNSIGNED_WRAP = 0, |
499 | TIO_NO_SIGNED_WRAP = 1 |
500 | }; |
501 | |
502 | /// FastMath Flags |
503 | /// This is a fixed layout derived from the bitcode emitted by LLVM 5.0 |
504 | /// intended to decouple the in-memory representation from the serialization. |
505 | enum FastMathMap { |
506 | UnsafeAlgebra = (1 << 0), // Legacy |
507 | NoNaNs = (1 << 1), |
508 | NoInfs = (1 << 2), |
509 | NoSignedZeros = (1 << 3), |
510 | AllowReciprocal = (1 << 4), |
511 | AllowContract = (1 << 5), |
512 | ApproxFunc = (1 << 6), |
513 | AllowReassoc = (1 << 7) |
514 | }; |
515 | |
516 | /// Flags for serializing PossiblyNonNegInst's SubclassOptionalData contents. |
517 | enum PossiblyNonNegInstOptionalFlags { PNNI_NON_NEG = 0 }; |
518 | |
519 | /// PossiblyExactOperatorOptionalFlags - Flags for serializing |
520 | /// PossiblyExactOperator's SubclassOptionalData contents. |
521 | enum PossiblyExactOperatorOptionalFlags { PEO_EXACT = 0 }; |
522 | |
523 | /// PossiblyDisjointInstOptionalFlags - Flags for serializing |
524 | /// PossiblyDisjointInst's SubclassOptionalData contents. |
525 | enum PossiblyDisjointInstOptionalFlags { PDI_DISJOINT = 0 }; |
526 | |
527 | /// Encoded AtomicOrdering values. |
528 | enum AtomicOrderingCodes { |
529 | ORDERING_NOTATOMIC = 0, |
530 | ORDERING_UNORDERED = 1, |
531 | ORDERING_MONOTONIC = 2, |
532 | ORDERING_ACQUIRE = 3, |
533 | ORDERING_RELEASE = 4, |
534 | ORDERING_ACQREL = 5, |
535 | ORDERING_SEQCST = 6 |
536 | }; |
537 | |
538 | /// Markers and flags for call instruction. |
539 | enum CallMarkersFlags { |
540 | CALL_TAIL = 0, |
541 | CALL_CCONV = 1, |
542 | CALL_MUSTTAIL = 14, |
543 | CALL_EXPLICIT_TYPE = 15, |
544 | CALL_NOTAIL = 16, |
545 | CALL_FMF = 17 // Call has optional fast-math-flags. |
546 | }; |
547 | |
548 | // The function body block (FUNCTION_BLOCK_ID) describes function bodies. It |
549 | // can contain a constant block (CONSTANTS_BLOCK_ID). |
550 | enum FunctionCodes { |
551 | FUNC_CODE_DECLAREBLOCKS = 1, // DECLAREBLOCKS: [n] |
552 | |
553 | FUNC_CODE_INST_BINOP = 2, // BINOP: [opcode, ty, opval, opval] |
554 | FUNC_CODE_INST_CAST = 3, // CAST: [opcode, ty, opty, opval] |
555 | FUNC_CODE_INST_GEP_OLD = 4, // GEP: [n x operands] |
556 | FUNC_CODE_INST_SELECT = 5, // SELECT: [ty, opval, opval, opval] |
557 | = 6, // EXTRACTELT: [opty, opval, opval] |
558 | FUNC_CODE_INST_INSERTELT = 7, // INSERTELT: [ty, opval, opval, opval] |
559 | FUNC_CODE_INST_SHUFFLEVEC = 8, // SHUFFLEVEC: [ty, opval, opval, opval] |
560 | FUNC_CODE_INST_CMP = 9, // CMP: [opty, opval, opval, pred] |
561 | |
562 | FUNC_CODE_INST_RET = 10, // RET: [opty,opval<both optional>] |
563 | FUNC_CODE_INST_BR = 11, // BR: [bb#, bb#, cond] or [bb#] |
564 | FUNC_CODE_INST_SWITCH = 12, // SWITCH: [opty, op0, op1, ...] |
565 | FUNC_CODE_INST_INVOKE = 13, // INVOKE: [attr, fnty, op0,op1, ...] |
566 | // 14 is unused. |
567 | FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE |
568 | |
569 | FUNC_CODE_INST_PHI = 16, // PHI: [ty, val0,bb0, ...] |
570 | // 17 is unused. |
571 | // 18 is unused. |
572 | FUNC_CODE_INST_ALLOCA = 19, // ALLOCA: [instty, opty, op, align] |
573 | FUNC_CODE_INST_LOAD = 20, // LOAD: [opty, op, align, vol] |
574 | // 21 is unused. |
575 | // 22 is unused. |
576 | FUNC_CODE_INST_VAARG = 23, // VAARG: [valistty, valist, instty] |
577 | // This store code encodes the pointer type, rather than the value type |
578 | // this is so information only available in the pointer type (e.g. address |
579 | // spaces) is retained. |
580 | FUNC_CODE_INST_STORE_OLD = 24, // STORE: [ptrty,ptr,val, align, vol] |
581 | // 25 is unused. |
582 | = 26, // EXTRACTVAL: [n x operands] |
583 | FUNC_CODE_INST_INSERTVAL = 27, // INSERTVAL: [n x operands] |
584 | // fcmp/icmp returning Int1TY or vector of Int1Ty. Same as CMP, exists to |
585 | // support legacy vicmp/vfcmp instructions. |
586 | FUNC_CODE_INST_CMP2 = 28, // CMP2: [opty, opval, opval, pred] |
587 | // new select on i1 or [N x i1] |
588 | FUNC_CODE_INST_VSELECT = 29, // VSELECT: [ty,opval,opval,predty,pred] |
589 | FUNC_CODE_INST_INBOUNDS_GEP_OLD = 30, // INBOUNDS_GEP: [n x operands] |
590 | FUNC_CODE_INST_INDIRECTBR = 31, // INDIRECTBR: [opty, op0, op1, ...] |
591 | // 32 is unused. |
592 | FUNC_CODE_DEBUG_LOC_AGAIN = 33, // DEBUG_LOC_AGAIN |
593 | |
594 | FUNC_CODE_INST_CALL = 34, // CALL: [attr, cc, fnty, fnid, args...] |
595 | |
596 | FUNC_CODE_DEBUG_LOC = 35, // DEBUG_LOC: [Line,Col,ScopeVal, IAVal] |
597 | FUNC_CODE_INST_FENCE = 36, // FENCE: [ordering, synchscope] |
598 | FUNC_CODE_INST_CMPXCHG_OLD = 37, // CMPXCHG: [ptrty, ptr, cmp, val, vol, |
599 | // ordering, synchscope, |
600 | // failure_ordering?, weak?] |
601 | FUNC_CODE_INST_ATOMICRMW_OLD = 38, // ATOMICRMW: [ptrty,ptr,val, operation, |
602 | // align, vol, |
603 | // ordering, synchscope] |
604 | FUNC_CODE_INST_RESUME = 39, // RESUME: [opval] |
605 | FUNC_CODE_INST_LANDINGPAD_OLD = |
606 | 40, // LANDINGPAD: [ty,val,val,num,id0,val0...] |
607 | FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [opty, op, align, vol, |
608 | // ordering, synchscope] |
609 | FUNC_CODE_INST_STOREATOMIC_OLD = 42, // STORE: [ptrty,ptr,val, align, vol |
610 | // ordering, synchscope] |
611 | FUNC_CODE_INST_GEP = 43, // GEP: [inbounds, n x operands] |
612 | FUNC_CODE_INST_STORE = 44, // STORE: [ptrty,ptr,valty,val, align, vol] |
613 | FUNC_CODE_INST_STOREATOMIC = 45, // STORE: [ptrty,ptr,val, align, vol |
614 | FUNC_CODE_INST_CMPXCHG = 46, // CMPXCHG: [ptrty, ptr, cmp, val, vol, |
615 | // success_ordering, synchscope, |
616 | // failure_ordering, weak] |
617 | FUNC_CODE_INST_LANDINGPAD = 47, // LANDINGPAD: [ty,val,num,id0,val0...] |
618 | FUNC_CODE_INST_CLEANUPRET = 48, // CLEANUPRET: [val] or [val,bb#] |
619 | FUNC_CODE_INST_CATCHRET = 49, // CATCHRET: [val,bb#] |
620 | FUNC_CODE_INST_CATCHPAD = 50, // CATCHPAD: [bb#,bb#,num,args...] |
621 | FUNC_CODE_INST_CLEANUPPAD = 51, // CLEANUPPAD: [num,args...] |
622 | FUNC_CODE_INST_CATCHSWITCH = |
623 | 52, // CATCHSWITCH: [num,args...] or [num,args...,bb] |
624 | // 53 is unused. |
625 | // 54 is unused. |
626 | FUNC_CODE_OPERAND_BUNDLE = 55, // OPERAND_BUNDLE: [tag#, value...] |
627 | FUNC_CODE_INST_UNOP = 56, // UNOP: [opcode, ty, opval] |
628 | FUNC_CODE_INST_CALLBR = 57, // CALLBR: [attr, cc, norm, transfs, |
629 | // fnty, fnid, args...] |
630 | FUNC_CODE_INST_FREEZE = 58, // FREEZE: [opty, opval] |
631 | FUNC_CODE_INST_ATOMICRMW = 59, // ATOMICRMW: [ptrty, ptr, valty, val, |
632 | // operation, align, vol, |
633 | // ordering, synchscope] |
634 | FUNC_CODE_BLOCKADDR_USERS = 60, // BLOCKADDR_USERS: [value...] |
635 | |
636 | FUNC_CODE_DEBUG_RECORD_VALUE = |
637 | 61, // [DILocation, DILocalVariable, DIExpression, ValueAsMetadata] |
638 | FUNC_CODE_DEBUG_RECORD_DECLARE = |
639 | 62, // [DILocation, DILocalVariable, DIExpression, ValueAsMetadata] |
640 | FUNC_CODE_DEBUG_RECORD_ASSIGN = |
641 | 63, // [DILocation, DILocalVariable, DIExpression, ValueAsMetadata, |
642 | // DIAssignID, DIExpression (addr), ValueAsMetadata (addr)] |
643 | FUNC_CODE_DEBUG_RECORD_VALUE_SIMPLE = |
644 | 64, // [DILocation, DILocalVariable, DIExpression, Value] |
645 | FUNC_CODE_DEBUG_RECORD_LABEL = 65, // [DILocation, DILabel] |
646 | }; |
647 | |
648 | enum UseListCodes { |
649 | USELIST_CODE_DEFAULT = 1, // DEFAULT: [index..., value-id] |
650 | USELIST_CODE_BB = 2 // BB: [index..., bb-id] |
651 | }; |
652 | |
653 | enum AttributeKindCodes { |
654 | // = 0 is unused |
655 | ATTR_KIND_ALIGNMENT = 1, |
656 | ATTR_KIND_ALWAYS_INLINE = 2, |
657 | ATTR_KIND_BY_VAL = 3, |
658 | ATTR_KIND_INLINE_HINT = 4, |
659 | ATTR_KIND_IN_REG = 5, |
660 | ATTR_KIND_MIN_SIZE = 6, |
661 | ATTR_KIND_NAKED = 7, |
662 | ATTR_KIND_NEST = 8, |
663 | ATTR_KIND_NO_ALIAS = 9, |
664 | ATTR_KIND_NO_BUILTIN = 10, |
665 | ATTR_KIND_NO_CAPTURE = 11, |
666 | ATTR_KIND_NO_DUPLICATE = 12, |
667 | ATTR_KIND_NO_IMPLICIT_FLOAT = 13, |
668 | ATTR_KIND_NO_INLINE = 14, |
669 | ATTR_KIND_NON_LAZY_BIND = 15, |
670 | ATTR_KIND_NO_RED_ZONE = 16, |
671 | ATTR_KIND_NO_RETURN = 17, |
672 | ATTR_KIND_NO_UNWIND = 18, |
673 | ATTR_KIND_OPTIMIZE_FOR_SIZE = 19, |
674 | ATTR_KIND_READ_NONE = 20, |
675 | ATTR_KIND_READ_ONLY = 21, |
676 | ATTR_KIND_RETURNED = 22, |
677 | ATTR_KIND_RETURNS_TWICE = 23, |
678 | ATTR_KIND_S_EXT = 24, |
679 | ATTR_KIND_STACK_ALIGNMENT = 25, |
680 | ATTR_KIND_STACK_PROTECT = 26, |
681 | ATTR_KIND_STACK_PROTECT_REQ = 27, |
682 | ATTR_KIND_STACK_PROTECT_STRONG = 28, |
683 | ATTR_KIND_STRUCT_RET = 29, |
684 | ATTR_KIND_SANITIZE_ADDRESS = 30, |
685 | ATTR_KIND_SANITIZE_THREAD = 31, |
686 | ATTR_KIND_SANITIZE_MEMORY = 32, |
687 | ATTR_KIND_UW_TABLE = 33, |
688 | ATTR_KIND_Z_EXT = 34, |
689 | ATTR_KIND_BUILTIN = 35, |
690 | ATTR_KIND_COLD = 36, |
691 | ATTR_KIND_OPTIMIZE_NONE = 37, |
692 | ATTR_KIND_IN_ALLOCA = 38, |
693 | ATTR_KIND_NON_NULL = 39, |
694 | ATTR_KIND_JUMP_TABLE = 40, |
695 | ATTR_KIND_DEREFERENCEABLE = 41, |
696 | ATTR_KIND_DEREFERENCEABLE_OR_NULL = 42, |
697 | ATTR_KIND_CONVERGENT = 43, |
698 | ATTR_KIND_SAFESTACK = 44, |
699 | ATTR_KIND_ARGMEMONLY = 45, |
700 | ATTR_KIND_SWIFT_SELF = 46, |
701 | ATTR_KIND_SWIFT_ERROR = 47, |
702 | ATTR_KIND_NO_RECURSE = 48, |
703 | ATTR_KIND_INACCESSIBLEMEM_ONLY = 49, |
704 | ATTR_KIND_INACCESSIBLEMEM_OR_ARGMEMONLY = 50, |
705 | ATTR_KIND_ALLOC_SIZE = 51, |
706 | ATTR_KIND_WRITEONLY = 52, |
707 | ATTR_KIND_SPECULATABLE = 53, |
708 | ATTR_KIND_STRICT_FP = 54, |
709 | ATTR_KIND_SANITIZE_HWADDRESS = 55, |
710 | ATTR_KIND_NOCF_CHECK = 56, |
711 | ATTR_KIND_OPT_FOR_FUZZING = 57, |
712 | ATTR_KIND_SHADOWCALLSTACK = 58, |
713 | ATTR_KIND_SPECULATIVE_LOAD_HARDENING = 59, |
714 | ATTR_KIND_IMMARG = 60, |
715 | ATTR_KIND_WILLRETURN = 61, |
716 | ATTR_KIND_NOFREE = 62, |
717 | ATTR_KIND_NOSYNC = 63, |
718 | ATTR_KIND_SANITIZE_MEMTAG = 64, |
719 | ATTR_KIND_PREALLOCATED = 65, |
720 | ATTR_KIND_NO_MERGE = 66, |
721 | ATTR_KIND_NULL_POINTER_IS_VALID = 67, |
722 | ATTR_KIND_NOUNDEF = 68, |
723 | ATTR_KIND_BYREF = 69, |
724 | ATTR_KIND_MUSTPROGRESS = 70, |
725 | ATTR_KIND_NO_CALLBACK = 71, |
726 | ATTR_KIND_HOT = 72, |
727 | ATTR_KIND_NO_PROFILE = 73, |
728 | ATTR_KIND_VSCALE_RANGE = 74, |
729 | ATTR_KIND_SWIFT_ASYNC = 75, |
730 | ATTR_KIND_NO_SANITIZE_COVERAGE = 76, |
731 | ATTR_KIND_ELEMENTTYPE = 77, |
732 | ATTR_KIND_DISABLE_SANITIZER_INSTRUMENTATION = 78, |
733 | ATTR_KIND_NO_SANITIZE_BOUNDS = 79, |
734 | ATTR_KIND_ALLOC_ALIGN = 80, |
735 | ATTR_KIND_ALLOCATED_POINTER = 81, |
736 | ATTR_KIND_ALLOC_KIND = 82, |
737 | ATTR_KIND_PRESPLIT_COROUTINE = 83, |
738 | ATTR_KIND_FNRETTHUNK_EXTERN = 84, |
739 | ATTR_KIND_SKIP_PROFILE = 85, |
740 | ATTR_KIND_MEMORY = 86, |
741 | ATTR_KIND_NOFPCLASS = 87, |
742 | ATTR_KIND_OPTIMIZE_FOR_DEBUGGING = 88, |
743 | ATTR_KIND_WRITABLE = 89, |
744 | ATTR_KIND_CORO_ONLY_DESTROY_WHEN_COMPLETE = 90, |
745 | ATTR_KIND_DEAD_ON_UNWIND = 91, |
746 | ATTR_KIND_RANGE = 92, |
747 | }; |
748 | |
749 | enum ComdatSelectionKindCodes { |
750 | COMDAT_SELECTION_KIND_ANY = 1, |
751 | COMDAT_SELECTION_KIND_EXACT_MATCH = 2, |
752 | COMDAT_SELECTION_KIND_LARGEST = 3, |
753 | COMDAT_SELECTION_KIND_NO_DUPLICATES = 4, |
754 | COMDAT_SELECTION_KIND_SAME_SIZE = 5, |
755 | }; |
756 | |
757 | enum StrtabCodes { |
758 | STRTAB_BLOB = 1, |
759 | }; |
760 | |
761 | enum SymtabCodes { |
762 | SYMTAB_BLOB = 1, |
763 | }; |
764 | |
765 | } // End bitc namespace |
766 | } // End llvm namespace |
767 | |
768 | #endif |
769 | |