LLToken.h 8.0 KB

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