1//===- LLToken.h - Token Codes for LLVM Assembly Files ----------*- 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 file defines the enums for the .ll lexer.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_ASMPARSER_LLTOKEN_H
14#define LLVM_ASMPARSER_LLTOKEN_H
15
16namespace llvm {
17namespace lltok {
18enum Kind {
19 // Markers
20 Eof,
21 Error,
22
23 // Tokens with no info.
24 dotdotdot, // ...
25 equal,
26 comma, // = ,
27 star, // *
28 lsquare,
29 rsquare, // [ ]
30 lbrace,
31 rbrace, // { }
32 less,
33 greater, // < >
34 lparen,
35 rparen, // ( )
36 exclaim, // !
37 bar, // |
38 colon, // :
39
40 kw_vscale,
41 kw_x,
42 kw_true,
43 kw_false,
44 kw_declare,
45 kw_define,
46 kw_global,
47 kw_constant,
48
49 kw_dso_local,
50 kw_dso_preemptable,
51
52 kw_private,
53 kw_internal,
54 kw_linkonce,
55 kw_linkonce_odr,
56 kw_weak, // Used as a linkage, and a modifier for "cmpxchg".
57 kw_weak_odr,
58 kw_appending,
59 kw_dllimport,
60 kw_dllexport,
61 kw_common,
62 kw_available_externally,
63 kw_default,
64 kw_hidden,
65 kw_protected,
66 kw_unnamed_addr,
67 kw_local_unnamed_addr,
68 kw_externally_initialized,
69 kw_extern_weak,
70 kw_external,
71 kw_thread_local,
72 kw_localdynamic,
73 kw_initialexec,
74 kw_localexec,
75 kw_zeroinitializer,
76 kw_undef,
77 kw_poison,
78 kw_null,
79 kw_none,
80 kw_to,
81 kw_caller,
82 kw_within,
83 kw_from,
84 kw_tail,
85 kw_musttail,
86 kw_notail,
87 kw_target,
88 kw_triple,
89 kw_source_filename,
90 kw_unwind,
91 kw_datalayout,
92 kw_volatile,
93 kw_atomic,
94 kw_unordered,
95 kw_monotonic,
96 kw_acquire,
97 kw_release,
98 kw_acq_rel,
99 kw_seq_cst,
100 kw_syncscope,
101 kw_nnan,
102 kw_ninf,
103 kw_nsz,
104 kw_arcp,
105 kw_contract,
106 kw_reassoc,
107 kw_afn,
108 kw_fast,
109 kw_nuw,
110 kw_nsw,
111 kw_exact,
112 kw_disjoint,
113 kw_inbounds,
114 kw_nneg,
115 kw_inrange,
116 kw_addrspace,
117 kw_section,
118 kw_partition,
119 kw_code_model,
120 kw_alias,
121 kw_ifunc,
122 kw_module,
123 kw_asm,
124 kw_sideeffect,
125 kw_inteldialect,
126 kw_gc,
127 kw_prefix,
128 kw_prologue,
129 kw_c,
130
131 kw_cc,
132 kw_ccc,
133 kw_fastcc,
134 kw_coldcc,
135 kw_intel_ocl_bicc,
136 kw_cfguard_checkcc,
137 kw_x86_stdcallcc,
138 kw_x86_fastcallcc,
139 kw_x86_thiscallcc,
140 kw_x86_vectorcallcc,
141 kw_x86_regcallcc,
142 kw_arm_apcscc,
143 kw_arm_aapcscc,
144 kw_arm_aapcs_vfpcc,
145 kw_aarch64_vector_pcs,
146 kw_aarch64_sve_vector_pcs,
147 kw_aarch64_sme_preservemost_from_x0,
148 kw_aarch64_sme_preservemost_from_x2,
149 kw_msp430_intrcc,
150 kw_avr_intrcc,
151 kw_avr_signalcc,
152 kw_ptx_kernel,
153 kw_ptx_device,
154 kw_spir_kernel,
155 kw_spir_func,
156 kw_x86_64_sysvcc,
157 kw_win64cc,
158 kw_anyregcc,
159 kw_swiftcc,
160 kw_swifttailcc,
161 kw_preserve_mostcc,
162 kw_preserve_allcc,
163 kw_preserve_nonecc,
164 kw_ghccc,
165 kw_x86_intrcc,
166 kw_hhvmcc,
167 kw_hhvm_ccc,
168 kw_cxx_fast_tlscc,
169 kw_amdgpu_vs,
170 kw_amdgpu_ls,
171 kw_amdgpu_hs,
172 kw_amdgpu_es,
173 kw_amdgpu_gs,
174 kw_amdgpu_ps,
175 kw_amdgpu_cs,
176 kw_amdgpu_cs_chain,
177 kw_amdgpu_cs_chain_preserve,
178 kw_amdgpu_kernel,
179 kw_amdgpu_gfx,
180 kw_tailcc,
181 kw_m68k_rtdcc,
182 kw_graalcc,
183
184 // Attributes:
185 kw_attributes,
186 kw_sync,
187 kw_async,
188#define GET_ATTR_NAMES
189#define ATTRIBUTE_ENUM(ENUM_NAME, DISPLAY_NAME) \
190 kw_##DISPLAY_NAME,
191#include "llvm/IR/Attributes.inc"
192
193 // Memory attribute:
194 kw_read,
195 kw_write,
196 kw_readwrite,
197 kw_argmem,
198 kw_inaccessiblemem,
199
200 // Legacy memory attributes:
201 kw_argmemonly,
202 kw_inaccessiblememonly,
203 kw_inaccessiblemem_or_argmemonly,
204
205 // nofpclass attribute:
206 kw_all,
207 kw_nan,
208 kw_snan,
209 kw_qnan,
210 kw_inf,
211 // kw_ninf, - already an fmf
212 kw_pinf,
213 kw_norm,
214 kw_nnorm,
215 kw_pnorm,
216 // kw_sub, - already an instruction
217 kw_nsub,
218 kw_psub,
219 kw_zero,
220 kw_nzero,
221 kw_pzero,
222
223 kw_type,
224 kw_opaque,
225
226 kw_comdat,
227
228 // Comdat types
229 kw_any,
230 kw_exactmatch,
231 kw_largest,
232 kw_nodeduplicate,
233 kw_samesize,
234
235 kw_eq,
236 kw_ne,
237 kw_slt,
238 kw_sgt,
239 kw_sle,
240 kw_sge,
241 kw_ult,
242 kw_ugt,
243 kw_ule,
244 kw_uge,
245 kw_oeq,
246 kw_one,
247 kw_olt,
248 kw_ogt,
249 kw_ole,
250 kw_oge,
251 kw_ord,
252 kw_uno,
253 kw_ueq,
254 kw_une,
255
256 // atomicrmw operations that aren't also instruction keywords.
257 kw_xchg,
258 kw_nand,
259 kw_max,
260 kw_min,
261 kw_umax,
262 kw_umin,
263 kw_fmax,
264 kw_fmin,
265 kw_uinc_wrap,
266 kw_udec_wrap,
267
268 // Instruction Opcodes (Opcode in UIntVal).
269 kw_fneg,
270 kw_add,
271 kw_fadd,
272 kw_sub,
273 kw_fsub,
274 kw_mul,
275 kw_fmul,
276 kw_udiv,
277 kw_sdiv,
278 kw_fdiv,
279 kw_urem,
280 kw_srem,
281 kw_frem,
282 kw_shl,
283 kw_lshr,
284 kw_ashr,
285 kw_and,
286 kw_or,
287 kw_xor,
288 kw_icmp,
289 kw_fcmp,
290
291 kw_phi,
292 kw_call,
293 kw_trunc,
294 kw_zext,
295 kw_sext,
296 kw_fptrunc,
297 kw_fpext,
298 kw_uitofp,
299 kw_sitofp,
300 kw_fptoui,
301 kw_fptosi,
302 kw_inttoptr,
303 kw_ptrtoint,
304 kw_bitcast,
305 kw_addrspacecast,
306 kw_select,
307 kw_va_arg,
308
309 kw_landingpad,
310 kw_personality,
311 kw_cleanup,
312 kw_catch,
313 kw_filter,
314
315 kw_ret,
316 kw_br,
317 kw_switch,
318 kw_indirectbr,
319 kw_invoke,
320 kw_resume,
321 kw_unreachable,
322 kw_cleanupret,
323 kw_catchswitch,
324 kw_catchret,
325 kw_catchpad,
326 kw_cleanuppad,
327 kw_callbr,
328
329 kw_alloca,
330 kw_load,
331 kw_store,
332 kw_fence,
333 kw_cmpxchg,
334 kw_atomicrmw,
335 kw_getelementptr,
336
337 kw_extractelement,
338 kw_insertelement,
339 kw_shufflevector,
340 kw_splat,
341 kw_extractvalue,
342 kw_insertvalue,
343 kw_blockaddress,
344 kw_dso_local_equivalent,
345 kw_no_cfi,
346
347 kw_freeze,
348
349 // Metadata types.
350 kw_distinct,
351
352 // Use-list order directives.
353 kw_uselistorder,
354 kw_uselistorder_bb,
355
356 // Summary index keywords
357 kw_path,
358 kw_hash,
359 kw_gv,
360 kw_guid,
361 kw_name,
362 kw_summaries,
363 kw_flags,
364 kw_blockcount,
365 kw_linkage,
366 kw_visibility,
367 kw_notEligibleToImport,
368 kw_live,
369 kw_dsoLocal,
370 kw_canAutoHide,
371 kw_function,
372 kw_insts,
373 kw_funcFlags,
374 kw_readNone,
375 kw_readOnly,
376 kw_noRecurse,
377 kw_returnDoesNotAlias,
378 kw_noInline,
379 kw_alwaysInline,
380 kw_noUnwind,
381 kw_mayThrow,
382 kw_hasUnknownCall,
383 kw_mustBeUnreachable,
384 kw_calls,
385 kw_callee,
386 kw_params,
387 kw_param,
388 kw_hotness,
389 kw_unknown,
390 kw_critical,
391 kw_relbf,
392 kw_variable,
393 kw_vTableFuncs,
394 kw_virtFunc,
395 kw_aliasee,
396 kw_refs,
397 kw_typeIdInfo,
398 kw_typeTests,
399 kw_typeTestAssumeVCalls,
400 kw_typeCheckedLoadVCalls,
401 kw_typeTestAssumeConstVCalls,
402 kw_typeCheckedLoadConstVCalls,
403 kw_vFuncId,
404 kw_offset,
405 kw_args,
406 kw_typeid,
407 kw_typeidCompatibleVTable,
408 kw_summary,
409 kw_typeTestRes,
410 kw_kind,
411 kw_unsat,
412 kw_byteArray,
413 kw_inline,
414 kw_single,
415 kw_allOnes,
416 kw_sizeM1BitWidth,
417 kw_alignLog2,
418 kw_sizeM1,
419 kw_bitMask,
420 kw_inlineBits,
421 kw_vcall_visibility,
422 kw_wpdResolutions,
423 kw_wpdRes,
424 kw_indir,
425 kw_singleImpl,
426 kw_branchFunnel,
427 kw_singleImplName,
428 kw_resByArg,
429 kw_byArg,
430 kw_uniformRetVal,
431 kw_uniqueRetVal,
432 kw_virtualConstProp,
433 kw_info,
434 kw_byte,
435 kw_bit,
436 kw_varFlags,
437 // The following are used by MemProf summary info.
438 kw_callsites,
439 kw_clones,
440 kw_stackIds,
441 kw_allocs,
442 kw_versions,
443 kw_memProf,
444 kw_notcold,
445
446 // GV's with __attribute__((no_sanitize("address"))), or things in
447 // -fsanitize-ignorelist when built with ASan.
448 kw_no_sanitize_address,
449 // GV's with __attribute__((no_sanitize("hwaddress"))), or things in
450 // -fsanitize-ignorelist when built with HWASan.
451 kw_no_sanitize_hwaddress,
452 // GV's where the clang++ frontend (when ASan is used) notes that this is
453 // dynamically initialized, and thus needs ODR detection.
454 kw_sanitize_address_dyninit,
455
456 // Unsigned Valued tokens (UIntVal).
457 LabelID, // 42:
458 GlobalID, // @42
459 LocalVarID, // %42
460 AttrGrpID, // #42
461 SummaryID, // ^42
462
463 // String valued tokens (StrVal).
464 LabelStr, // foo:
465 GlobalVar, // @foo @"foo"
466 ComdatVar, // $foo
467 LocalVar, // %foo %"foo"
468 MetadataVar, // !foo
469 StringConstant, // "foo"
470 DwarfTag, // DW_TAG_foo
471 DwarfAttEncoding, // DW_ATE_foo
472 DwarfVirtuality, // DW_VIRTUALITY_foo
473 DwarfLang, // DW_LANG_foo
474 DwarfCC, // DW_CC_foo
475 EmissionKind, // lineTablesOnly
476 NameTableKind, // GNU
477 DwarfOp, // DW_OP_foo
478 DIFlag, // DIFlagFoo
479 DISPFlag, // DISPFlagFoo
480 DwarfMacinfo, // DW_MACINFO_foo
481 ChecksumKind, // CSK_foo
482
483 // Type valued tokens (TyVal).
484 Type,
485
486 APFloat, // APFloatVal
487 APSInt // APSInt
488};
489} // end namespace lltok
490} // end namespace llvm
491
492#endif
493

source code of llvm/include/llvm/AsmParser/LLToken.h