1 //===- LLToken.h - Token Codes for LLVM Assembly Files ----------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file defines the enums for the .ll lexer. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_LIB_ASMPARSER_LLTOKEN_H 15 #define LLVM_LIB_ASMPARSER_LLTOKEN_H 16 17 namespace llvm { 18 namespace lltok { 19 enum Kind { 20 // Markers 21 Eof, 22 Error, 23 24 // Tokens with no info. 25 dotdotdot, // ... 26 equal, 27 comma, // = , 28 star, // * 29 lsquare, 30 rsquare, // [ ] 31 lbrace, 32 rbrace, // { } 33 less, 34 greater, // < > 35 lparen, 36 rparen, // ( ) 37 exclaim, // ! 38 bar, // | 39 colon, // : 40 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_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_deplibs, // FIXME: Remove in 4.0 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_inbounds, 113 kw_inrange, 114 kw_align, 115 kw_addrspace, 116 kw_section, 117 kw_alias, 118 kw_ifunc, 119 kw_module, 120 kw_asm, 121 kw_sideeffect, 122 kw_alignstack, 123 kw_inteldialect, 124 kw_gc, 125 kw_prefix, 126 kw_prologue, 127 kw_c, 128 129 kw_cc, 130 kw_ccc, 131 kw_fastcc, 132 kw_coldcc, 133 kw_intel_ocl_bicc, 134 kw_x86_stdcallcc, 135 kw_x86_fastcallcc, 136 kw_x86_thiscallcc, 137 kw_x86_vectorcallcc, 138 kw_x86_regcallcc, 139 kw_arm_apcscc, 140 kw_arm_aapcscc, 141 kw_arm_aapcs_vfpcc, 142 kw_msp430_intrcc, 143 kw_avr_intrcc, 144 kw_avr_signalcc, 145 kw_ptx_kernel, 146 kw_ptx_device, 147 kw_spir_kernel, 148 kw_spir_func, 149 kw_x86_64_sysvcc, 150 kw_win64cc, 151 kw_webkit_jscc, 152 kw_anyregcc, 153 kw_swiftcc, 154 kw_preserve_mostcc, 155 kw_preserve_allcc, 156 kw_ghccc, 157 kw_x86_intrcc, 158 kw_hhvmcc, 159 kw_hhvm_ccc, 160 kw_cxx_fast_tlscc, 161 kw_amdgpu_vs, 162 kw_amdgpu_ls, 163 kw_amdgpu_hs, 164 kw_amdgpu_es, 165 kw_amdgpu_gs, 166 kw_amdgpu_ps, 167 kw_amdgpu_cs, 168 kw_amdgpu_kernel, 169 170 // Attributes: 171 kw_attributes, 172 kw_allocsize, 173 kw_alwaysinline, 174 kw_argmemonly, 175 kw_sanitize_address, 176 kw_sanitize_hwaddress, 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_nobuiltin, 194 kw_nocapture, 195 kw_noduplicate, 196 kw_noimplicitfloat, 197 kw_noinline, 198 kw_norecurse, 199 kw_nonlazybind, 200 kw_nonnull, 201 kw_noredzone, 202 kw_noreturn, 203 kw_nocf_check, 204 kw_nounwind, 205 kw_optforfuzzing, 206 kw_optnone, 207 kw_optsize, 208 kw_readnone, 209 kw_readonly, 210 kw_returned, 211 kw_returns_twice, 212 kw_signext, 213 kw_speculatable, 214 kw_ssp, 215 kw_sspreq, 216 kw_sspstrong, 217 kw_safestack, 218 kw_shadowcallstack, 219 kw_sret, 220 kw_sanitize_thread, 221 kw_sanitize_memory, 222 kw_strictfp, 223 kw_swifterror, 224 kw_swiftself, 225 kw_uwtable, 226 kw_writeonly, 227 kw_zeroext, 228 229 kw_type, 230 kw_opaque, 231 232 kw_comdat, 233 234 // Comdat types 235 kw_any, 236 kw_exactmatch, 237 kw_largest, 238 kw_noduplicates, 239 kw_samesize, 240 241 kw_eq, 242 kw_ne, 243 kw_slt, 244 kw_sgt, 245 kw_sle, 246 kw_sge, 247 kw_ult, 248 kw_ugt, 249 kw_ule, 250 kw_uge, 251 kw_oeq, 252 kw_one, 253 kw_olt, 254 kw_ogt, 255 kw_ole, 256 kw_oge, 257 kw_ord, 258 kw_uno, 259 kw_ueq, 260 kw_une, 261 262 // atomicrmw operations that aren't also instruction keywords. 263 kw_xchg, 264 kw_nand, 265 kw_max, 266 kw_min, 267 kw_umax, 268 kw_umin, 269 270 // Instruction Opcodes (Opcode in UIntVal). 271 kw_add, 272 kw_fadd, 273 kw_sub, 274 kw_fsub, 275 kw_mul, 276 kw_fmul, 277 kw_udiv, 278 kw_sdiv, 279 kw_fdiv, 280 kw_urem, 281 kw_srem, 282 kw_frem, 283 kw_shl, 284 kw_lshr, 285 kw_ashr, 286 kw_and, 287 kw_or, 288 kw_xor, 289 kw_icmp, 290 kw_fcmp, 291 292 kw_phi, 293 kw_call, 294 kw_trunc, 295 kw_zext, 296 kw_sext, 297 kw_fptrunc, 298 kw_fpext, 299 kw_uitofp, 300 kw_sitofp, 301 kw_fptoui, 302 kw_fptosi, 303 kw_inttoptr, 304 kw_ptrtoint, 305 kw_bitcast, 306 kw_addrspacecast, 307 kw_select, 308 kw_va_arg, 309 310 kw_landingpad, 311 kw_personality, 312 kw_cleanup, 313 kw_catch, 314 kw_filter, 315 316 kw_ret, 317 kw_br, 318 kw_switch, 319 kw_indirectbr, 320 kw_invoke, 321 kw_resume, 322 kw_unreachable, 323 kw_cleanupret, 324 kw_catchswitch, 325 kw_catchret, 326 kw_catchpad, 327 kw_cleanuppad, 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_extractvalue, 341 kw_insertvalue, 342 kw_blockaddress, 343 344 // Metadata types. 345 kw_distinct, 346 347 // Use-list order directives. 348 kw_uselistorder, 349 kw_uselistorder_bb, 350 351 // Summary index keywords 352 kw_path, 353 kw_hash, 354 kw_gv, 355 kw_guid, 356 kw_name, 357 kw_summaries, 358 kw_flags, 359 kw_linkage, 360 kw_notEligibleToImport, 361 kw_live, 362 kw_dsoLocal, 363 kw_function, 364 kw_insts, 365 kw_funcFlags, 366 kw_readNone, 367 kw_readOnly, 368 kw_noRecurse, 369 kw_returnDoesNotAlias, 370 kw_calls, 371 kw_callee, 372 kw_hotness, 373 kw_unknown, 374 kw_hot, 375 kw_critical, 376 kw_relbf, 377 kw_variable, 378 kw_aliasee, 379 kw_refs, 380 kw_typeIdInfo, 381 kw_typeTests, 382 kw_typeTestAssumeVCalls, 383 kw_typeCheckedLoadVCalls, 384 kw_typeTestAssumeConstVCalls, 385 kw_typeCheckedLoadConstVCalls, 386 kw_vFuncId, 387 kw_offset, 388 kw_args, 389 kw_typeid, 390 kw_summary, 391 kw_typeTestRes, 392 kw_kind, 393 kw_unsat, 394 kw_byteArray, 395 kw_inline, 396 kw_single, 397 kw_allOnes, 398 kw_sizeM1BitWidth, 399 kw_alignLog2, 400 kw_sizeM1, 401 kw_bitMask, 402 kw_inlineBits, 403 kw_wpdResolutions, 404 kw_wpdRes, 405 kw_indir, 406 kw_singleImpl, 407 kw_branchFunnel, 408 kw_singleImplName, 409 kw_resByArg, 410 kw_byArg, 411 kw_uniformRetVal, 412 kw_uniqueRetVal, 413 kw_virtualConstProp, 414 kw_info, 415 kw_byte, 416 kw_bit, 417 418 // Unsigned Valued tokens (UIntVal). 419 GlobalID, // @42 420 LocalVarID, // %42 421 AttrGrpID, // #42 422 SummaryID, // ^42 423 424 // String valued tokens (StrVal). 425 LabelStr, // foo: 426 GlobalVar, // @foo @"foo" 427 ComdatVar, // $foo 428 LocalVar, // %foo %"foo" 429 MetadataVar, // !foo 430 StringConstant, // "foo" 431 DwarfTag, // DW_TAG_foo 432 DwarfAttEncoding, // DW_ATE_foo 433 DwarfVirtuality, // DW_VIRTUALITY_foo 434 DwarfLang, // DW_LANG_foo 435 DwarfCC, // DW_CC_foo 436 EmissionKind, // lineTablesOnly 437 DwarfOp, // DW_OP_foo 438 DIFlag, // DIFlagFoo 439 DwarfMacinfo, // DW_MACINFO_foo 440 ChecksumKind, // CSK_foo 441 442 // Type valued tokens (TyVal). 443 Type, 444 445 APFloat, // APFloatVal 446 APSInt // APSInt 447 }; 448 } // end namespace lltok 449 } // end namespace llvm 450 451 #endif 452