LLToken.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491
  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. #ifndef LLVM_LIB_ASMPARSER_LLTOKEN_H
  13. #define LLVM_LIB_ASMPARSER_LLTOKEN_H
  14. namespace llvm {
  15. namespace lltok {
  16. enum Kind {
  17. // Markers
  18. Eof,
  19. Error,
  20. // Tokens with no info.
  21. dotdotdot, // ...
  22. equal,
  23. comma, // = ,
  24. star, // *
  25. lsquare,
  26. rsquare, // [ ]
  27. lbrace,
  28. rbrace, // { }
  29. less,
  30. greater, // < >
  31. lparen,
  32. rparen, // ( )
  33. exclaim, // !
  34. bar, // |
  35. colon, // :
  36. kw_vscale,
  37. kw_x,
  38. kw_true,
  39. kw_false,
  40. kw_declare,
  41. kw_define,
  42. kw_global,
  43. kw_constant,
  44. kw_dso_local,
  45. kw_dso_preemptable,
  46. kw_private,
  47. kw_internal,
  48. kw_linkonce,
  49. kw_linkonce_odr,
  50. kw_weak, // Used as a linkage, and a modifier for "cmpxchg".
  51. kw_weak_odr,
  52. kw_appending,
  53. kw_dllimport,
  54. kw_dllexport,
  55. kw_common,
  56. kw_available_externally,
  57. kw_default,
  58. kw_hidden,
  59. kw_protected,
  60. kw_unnamed_addr,
  61. kw_local_unnamed_addr,
  62. kw_externally_initialized,
  63. kw_extern_weak,
  64. kw_external,
  65. kw_thread_local,
  66. kw_localdynamic,
  67. kw_initialexec,
  68. kw_localexec,
  69. kw_zeroinitializer,
  70. kw_undef,
  71. kw_poison,
  72. kw_null,
  73. kw_none,
  74. kw_to,
  75. kw_caller,
  76. kw_within,
  77. kw_from,
  78. kw_tail,
  79. kw_musttail,
  80. kw_notail,
  81. kw_target,
  82. kw_triple,
  83. kw_source_filename,
  84. kw_unwind,
  85. kw_deplibs, // FIXME: Remove in 4.0
  86. kw_datalayout,
  87. kw_volatile,
  88. kw_atomic,
  89. kw_unordered,
  90. kw_monotonic,
  91. kw_acquire,
  92. kw_release,
  93. kw_acq_rel,
  94. kw_seq_cst,
  95. kw_syncscope,
  96. kw_nnan,
  97. kw_ninf,
  98. kw_nsz,
  99. kw_arcp,
  100. kw_contract,
  101. kw_reassoc,
  102. kw_afn,
  103. kw_fast,
  104. kw_nuw,
  105. kw_nsw,
  106. kw_exact,
  107. kw_inbounds,
  108. kw_inrange,
  109. kw_align,
  110. kw_addrspace,
  111. kw_section,
  112. kw_partition,
  113. kw_alias,
  114. kw_ifunc,
  115. kw_module,
  116. kw_asm,
  117. kw_sideeffect,
  118. kw_alignstack,
  119. kw_inteldialect,
  120. kw_gc,
  121. kw_prefix,
  122. kw_prologue,
  123. kw_c,
  124. kw_cc,
  125. kw_ccc,
  126. kw_fastcc,
  127. kw_coldcc,
  128. kw_intel_ocl_bicc,
  129. kw_cfguard_checkcc,
  130. kw_x86_stdcallcc,
  131. kw_x86_fastcallcc,
  132. kw_x86_thiscallcc,
  133. kw_x86_vectorcallcc,
  134. kw_x86_regcallcc,
  135. kw_arm_apcscc,
  136. kw_arm_aapcscc,
  137. kw_arm_aapcs_vfpcc,
  138. kw_aarch64_vector_pcs,
  139. kw_aarch64_sve_vector_pcs,
  140. kw_msp430_intrcc,
  141. kw_avr_intrcc,
  142. kw_avr_signalcc,
  143. kw_ptx_kernel,
  144. kw_ptx_device,
  145. kw_spir_kernel,
  146. kw_spir_func,
  147. kw_x86_64_sysvcc,
  148. kw_win64cc,
  149. kw_webkit_jscc,
  150. kw_anyregcc,
  151. kw_swiftcc,
  152. kw_preserve_mostcc,
  153. kw_preserve_allcc,
  154. kw_ghccc,
  155. kw_x86_intrcc,
  156. kw_hhvmcc,
  157. kw_hhvm_ccc,
  158. kw_cxx_fast_tlscc,
  159. kw_amdgpu_vs,
  160. kw_amdgpu_ls,
  161. kw_amdgpu_hs,
  162. kw_amdgpu_es,
  163. kw_amdgpu_gs,
  164. kw_amdgpu_ps,
  165. kw_amdgpu_cs,
  166. kw_amdgpu_kernel,
  167. kw_amdgpu_gfx,
  168. kw_tailcc,
  169. // Attributes:
  170. kw_attributes,
  171. kw_allocsize,
  172. kw_alwaysinline,
  173. kw_argmemonly,
  174. kw_sanitize_address,
  175. kw_sanitize_hwaddress,
  176. kw_sanitize_memtag,
  177. kw_builtin,
  178. kw_byval,
  179. kw_inalloca,
  180. kw_cold,
  181. kw_convergent,
  182. kw_dereferenceable,
  183. kw_dereferenceable_or_null,
  184. kw_inaccessiblememonly,
  185. kw_inaccessiblemem_or_argmemonly,
  186. kw_inlinehint,
  187. kw_inreg,
  188. kw_jumptable,
  189. kw_minsize,
  190. kw_naked,
  191. kw_nest,
  192. kw_noalias,
  193. kw_noundef,
  194. kw_nobuiltin,
  195. kw_nocallback,
  196. kw_nocapture,
  197. kw_noduplicate,
  198. kw_nofree,
  199. kw_noimplicitfloat,
  200. kw_noinline,
  201. kw_norecurse,
  202. kw_nonlazybind,
  203. kw_nomerge,
  204. kw_nonnull,
  205. kw_noprofile,
  206. kw_noredzone,
  207. kw_noreturn,
  208. kw_nosync,
  209. kw_nocf_check,
  210. kw_nounwind,
  211. kw_null_pointer_is_valid,
  212. kw_optforfuzzing,
  213. kw_optnone,
  214. kw_optsize,
  215. kw_preallocated,
  216. kw_readnone,
  217. kw_readonly,
  218. kw_returned,
  219. kw_returns_twice,
  220. kw_signext,
  221. kw_speculatable,
  222. kw_ssp,
  223. kw_sspreq,
  224. kw_sspstrong,
  225. kw_safestack,
  226. kw_shadowcallstack,
  227. kw_sret,
  228. kw_sanitize_thread,
  229. kw_sanitize_memory,
  230. kw_speculative_load_hardening,
  231. kw_strictfp,
  232. kw_swifterror,
  233. kw_swiftself,
  234. kw_uwtable,
  235. kw_willreturn,
  236. kw_writeonly,
  237. kw_zeroext,
  238. kw_immarg,
  239. kw_byref,
  240. kw_mustprogress,
  241. kw_type,
  242. kw_opaque,
  243. kw_comdat,
  244. // Comdat types
  245. kw_any,
  246. kw_exactmatch,
  247. kw_largest,
  248. kw_noduplicates,
  249. kw_samesize,
  250. kw_eq,
  251. kw_ne,
  252. kw_slt,
  253. kw_sgt,
  254. kw_sle,
  255. kw_sge,
  256. kw_ult,
  257. kw_ugt,
  258. kw_ule,
  259. kw_uge,
  260. kw_oeq,
  261. kw_one,
  262. kw_olt,
  263. kw_ogt,
  264. kw_ole,
  265. kw_oge,
  266. kw_ord,
  267. kw_uno,
  268. kw_ueq,
  269. kw_une,
  270. // atomicrmw operations that aren't also instruction keywords.
  271. kw_xchg,
  272. kw_nand,
  273. kw_max,
  274. kw_min,
  275. kw_umax,
  276. kw_umin,
  277. // Instruction Opcodes (Opcode in UIntVal).
  278. kw_fneg,
  279. kw_add,
  280. kw_fadd,
  281. kw_sub,
  282. kw_fsub,
  283. kw_mul,
  284. kw_fmul,
  285. kw_udiv,
  286. kw_sdiv,
  287. kw_fdiv,
  288. kw_urem,
  289. kw_srem,
  290. kw_frem,
  291. kw_shl,
  292. kw_lshr,
  293. kw_ashr,
  294. kw_and,
  295. kw_or,
  296. kw_xor,
  297. kw_icmp,
  298. kw_fcmp,
  299. kw_phi,
  300. kw_call,
  301. kw_trunc,
  302. kw_zext,
  303. kw_sext,
  304. kw_fptrunc,
  305. kw_fpext,
  306. kw_uitofp,
  307. kw_sitofp,
  308. kw_fptoui,
  309. kw_fptosi,
  310. kw_inttoptr,
  311. kw_ptrtoint,
  312. kw_bitcast,
  313. kw_addrspacecast,
  314. kw_select,
  315. kw_va_arg,
  316. kw_landingpad,
  317. kw_personality,
  318. kw_cleanup,
  319. kw_catch,
  320. kw_filter,
  321. kw_ret,
  322. kw_br,
  323. kw_switch,
  324. kw_indirectbr,
  325. kw_invoke,
  326. kw_resume,
  327. kw_unreachable,
  328. kw_cleanupret,
  329. kw_catchswitch,
  330. kw_catchret,
  331. kw_catchpad,
  332. kw_cleanuppad,
  333. kw_callbr,
  334. kw_alloca,
  335. kw_load,
  336. kw_store,
  337. kw_fence,
  338. kw_cmpxchg,
  339. kw_atomicrmw,
  340. kw_getelementptr,
  341. kw_extractelement,
  342. kw_insertelement,
  343. kw_shufflevector,
  344. kw_extractvalue,
  345. kw_insertvalue,
  346. kw_blockaddress,
  347. kw_dso_local_equivalent,
  348. kw_freeze,
  349. // Metadata types.
  350. kw_distinct,
  351. // Use-list order directives.
  352. kw_uselistorder,
  353. kw_uselistorder_bb,
  354. // Summary index keywords
  355. kw_path,
  356. kw_hash,
  357. kw_gv,
  358. kw_guid,
  359. kw_name,
  360. kw_summaries,
  361. kw_flags,
  362. kw_blockcount,
  363. kw_linkage,
  364. kw_notEligibleToImport,
  365. kw_live,
  366. kw_dsoLocal,
  367. kw_canAutoHide,
  368. kw_function,
  369. kw_insts,
  370. kw_funcFlags,
  371. kw_readNone,
  372. kw_readOnly,
  373. kw_noRecurse,
  374. kw_returnDoesNotAlias,
  375. kw_noInline,
  376. kw_alwaysInline,
  377. kw_calls,
  378. kw_callee,
  379. kw_params,
  380. kw_param,
  381. kw_hotness,
  382. kw_unknown,
  383. kw_hot,
  384. kw_critical,
  385. kw_relbf,
  386. kw_variable,
  387. kw_vTableFuncs,
  388. kw_virtFunc,
  389. kw_aliasee,
  390. kw_refs,
  391. kw_typeIdInfo,
  392. kw_typeTests,
  393. kw_typeTestAssumeVCalls,
  394. kw_typeCheckedLoadVCalls,
  395. kw_typeTestAssumeConstVCalls,
  396. kw_typeCheckedLoadConstVCalls,
  397. kw_vFuncId,
  398. kw_offset,
  399. kw_args,
  400. kw_typeid,
  401. kw_typeidCompatibleVTable,
  402. kw_summary,
  403. kw_typeTestRes,
  404. kw_kind,
  405. kw_unsat,
  406. kw_byteArray,
  407. kw_inline,
  408. kw_single,
  409. kw_allOnes,
  410. kw_sizeM1BitWidth,
  411. kw_alignLog2,
  412. kw_sizeM1,
  413. kw_bitMask,
  414. kw_inlineBits,
  415. kw_vcall_visibility,
  416. kw_wpdResolutions,
  417. kw_wpdRes,
  418. kw_indir,
  419. kw_singleImpl,
  420. kw_branchFunnel,
  421. kw_singleImplName,
  422. kw_resByArg,
  423. kw_byArg,
  424. kw_uniformRetVal,
  425. kw_uniqueRetVal,
  426. kw_virtualConstProp,
  427. kw_info,
  428. kw_byte,
  429. kw_bit,
  430. kw_varFlags,
  431. // Unsigned Valued tokens (UIntVal).
  432. LabelID, // 42:
  433. GlobalID, // @42
  434. LocalVarID, // %42
  435. AttrGrpID, // #42
  436. SummaryID, // ^42
  437. // String valued tokens (StrVal).
  438. LabelStr, // foo:
  439. GlobalVar, // @foo @"foo"
  440. ComdatVar, // $foo
  441. LocalVar, // %foo %"foo"
  442. MetadataVar, // !foo
  443. StringConstant, // "foo"
  444. DwarfTag, // DW_TAG_foo
  445. DwarfAttEncoding, // DW_ATE_foo
  446. DwarfVirtuality, // DW_VIRTUALITY_foo
  447. DwarfLang, // DW_LANG_foo
  448. DwarfCC, // DW_CC_foo
  449. EmissionKind, // lineTablesOnly
  450. NameTableKind, // GNU
  451. DwarfOp, // DW_OP_foo
  452. DIFlag, // DIFlagFoo
  453. DISPFlag, // DISPFlagFoo
  454. DwarfMacinfo, // DW_MACINFO_foo
  455. ChecksumKind, // CSK_foo
  456. // Type valued tokens (TyVal).
  457. Type,
  458. APFloat, // APFloatVal
  459. APSInt // APSInt
  460. };
  461. } // end namespace lltok
  462. } // end namespace llvm
  463. #endif