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 40 kw_x, 41 kw_true, 42 kw_false, 43 kw_declare, 44 kw_define, 45 kw_global, 46 kw_constant, 47 48 kw_private, 49 kw_internal, 50 kw_linkonce, 51 kw_linkonce_odr, 52 kw_weak, // Used as a linkage, and a modifier for "cmpxchg". 53 kw_weak_odr, 54 kw_appending, 55 kw_dllimport, 56 kw_dllexport, 57 kw_common, 58 kw_available_externally, 59 kw_default, 60 kw_hidden, 61 kw_protected, 62 kw_unnamed_addr, 63 kw_local_unnamed_addr, 64 kw_externally_initialized, 65 kw_extern_weak, 66 kw_external, 67 kw_thread_local, 68 kw_localdynamic, 69 kw_initialexec, 70 kw_localexec, 71 kw_zeroinitializer, 72 kw_undef, 73 kw_null, 74 kw_none, 75 kw_to, 76 kw_caller, 77 kw_within, 78 kw_from, 79 kw_tail, 80 kw_musttail, 81 kw_notail, 82 kw_target, 83 kw_triple, 84 kw_source_filename, 85 kw_unwind, 86 kw_deplibs, // FIXME: Remove in 4.0 87 kw_datalayout, 88 kw_volatile, 89 kw_atomic, 90 kw_unordered, 91 kw_monotonic, 92 kw_acquire, 93 kw_release, 94 kw_acq_rel, 95 kw_seq_cst, 96 kw_singlethread, 97 kw_nnan, 98 kw_ninf, 99 kw_nsz, 100 kw_arcp, 101 kw_fast, 102 kw_nuw, 103 kw_nsw, 104 kw_exact, 105 kw_inbounds, 106 kw_align, 107 kw_addrspace, 108 kw_section, 109 kw_alias, 110 kw_ifunc, 111 kw_module, 112 kw_asm, 113 kw_sideeffect, 114 kw_alignstack, 115 kw_inteldialect, 116 kw_gc, 117 kw_prefix, 118 kw_prologue, 119 kw_c, 120 121 kw_cc, 122 kw_ccc, 123 kw_fastcc, 124 kw_coldcc, 125 kw_intel_ocl_bicc, 126 kw_x86_stdcallcc, 127 kw_x86_fastcallcc, 128 kw_x86_thiscallcc, 129 kw_x86_vectorcallcc, 130 kw_arm_apcscc, 131 kw_arm_aapcscc, 132 kw_arm_aapcs_vfpcc, 133 kw_msp430_intrcc, 134 kw_avr_intrcc, 135 kw_avr_signalcc, 136 kw_ptx_kernel, 137 kw_ptx_device, 138 kw_spir_kernel, 139 kw_spir_func, 140 kw_x86_64_sysvcc, 141 kw_x86_64_win64cc, 142 kw_webkit_jscc, 143 kw_anyregcc, 144 kw_swiftcc, 145 kw_preserve_mostcc, 146 kw_preserve_allcc, 147 kw_ghccc, 148 kw_x86_intrcc, 149 kw_hhvmcc, 150 kw_hhvm_ccc, 151 kw_cxx_fast_tlscc, 152 kw_amdgpu_vs, 153 kw_amdgpu_gs, 154 kw_amdgpu_ps, 155 kw_amdgpu_cs, 156 kw_amdgpu_kernel, 157 158 // Attributes: 159 kw_attributes, 160 kw_allocsize, 161 kw_alwaysinline, 162 kw_argmemonly, 163 kw_sanitize_address, 164 kw_builtin, 165 kw_byval, 166 kw_inalloca, 167 kw_cold, 168 kw_convergent, 169 kw_dereferenceable, 170 kw_dereferenceable_or_null, 171 kw_inaccessiblememonly, 172 kw_inaccessiblemem_or_argmemonly, 173 kw_inlinehint, 174 kw_inreg, 175 kw_jumptable, 176 kw_minsize, 177 kw_naked, 178 kw_nest, 179 kw_noalias, 180 kw_nobuiltin, 181 kw_nocapture, 182 kw_noduplicate, 183 kw_noimplicitfloat, 184 kw_noinline, 185 kw_norecurse, 186 kw_nonlazybind, 187 kw_nonnull, 188 kw_noredzone, 189 kw_noreturn, 190 kw_nounwind, 191 kw_optnone, 192 kw_optsize, 193 kw_readnone, 194 kw_readonly, 195 kw_returned, 196 kw_returns_twice, 197 kw_signext, 198 kw_ssp, 199 kw_sspreq, 200 kw_sspstrong, 201 kw_safestack, 202 kw_sret, 203 kw_sanitize_thread, 204 kw_sanitize_memory, 205 kw_swifterror, 206 kw_swiftself, 207 kw_uwtable, 208 kw_writeonly, 209 kw_zeroext, 210 211 kw_type, 212 kw_opaque, 213 214 kw_comdat, 215 216 // Comdat types 217 kw_any, 218 kw_exactmatch, 219 kw_largest, 220 kw_noduplicates, 221 kw_samesize, 222 223 kw_eq, 224 kw_ne, 225 kw_slt, 226 kw_sgt, 227 kw_sle, 228 kw_sge, 229 kw_ult, 230 kw_ugt, 231 kw_ule, 232 kw_uge, 233 kw_oeq, 234 kw_one, 235 kw_olt, 236 kw_ogt, 237 kw_ole, 238 kw_oge, 239 kw_ord, 240 kw_uno, 241 kw_ueq, 242 kw_une, 243 244 // atomicrmw operations that aren't also instruction keywords. 245 kw_xchg, 246 kw_nand, 247 kw_max, 248 kw_min, 249 kw_umax, 250 kw_umin, 251 252 // Instruction Opcodes (Opcode in UIntVal). 253 kw_add, 254 kw_fadd, 255 kw_sub, 256 kw_fsub, 257 kw_mul, 258 kw_fmul, 259 kw_udiv, 260 kw_sdiv, 261 kw_fdiv, 262 kw_urem, 263 kw_srem, 264 kw_frem, 265 kw_shl, 266 kw_lshr, 267 kw_ashr, 268 kw_and, 269 kw_or, 270 kw_xor, 271 kw_icmp, 272 kw_fcmp, 273 274 kw_phi, 275 kw_call, 276 kw_trunc, 277 kw_zext, 278 kw_sext, 279 kw_fptrunc, 280 kw_fpext, 281 kw_uitofp, 282 kw_sitofp, 283 kw_fptoui, 284 kw_fptosi, 285 kw_inttoptr, 286 kw_ptrtoint, 287 kw_bitcast, 288 kw_addrspacecast, 289 kw_select, 290 kw_va_arg, 291 292 kw_landingpad, 293 kw_personality, 294 kw_cleanup, 295 kw_catch, 296 kw_filter, 297 298 kw_ret, 299 kw_br, 300 kw_switch, 301 kw_indirectbr, 302 kw_invoke, 303 kw_resume, 304 kw_unreachable, 305 kw_cleanupret, 306 kw_catchswitch, 307 kw_catchret, 308 kw_catchpad, 309 kw_cleanuppad, 310 311 kw_alloca, 312 kw_load, 313 kw_store, 314 kw_fence, 315 kw_cmpxchg, 316 kw_atomicrmw, 317 kw_getelementptr, 318 319 kw_extractelement, 320 kw_insertelement, 321 kw_shufflevector, 322 kw_extractvalue, 323 kw_insertvalue, 324 kw_blockaddress, 325 326 // Metadata types. 327 kw_distinct, 328 329 // Use-list order directives. 330 kw_uselistorder, 331 kw_uselistorder_bb, 332 333 // Unsigned Valued tokens (UIntVal). 334 GlobalID, // @42 335 LocalVarID, // %42 336 AttrGrpID, // #42 337 338 // String valued tokens (StrVal). 339 LabelStr, // foo: 340 GlobalVar, // @foo @"foo" 341 ComdatVar, // $foo 342 LocalVar, // %foo %"foo" 343 MetadataVar, // !foo 344 StringConstant, // "foo" 345 DwarfTag, // DW_TAG_foo 346 DwarfAttEncoding, // DW_ATE_foo 347 DwarfVirtuality, // DW_VIRTUALITY_foo 348 DwarfLang, // DW_LANG_foo 349 DwarfCC, // DW_CC_foo 350 EmissionKind, // lineTablesOnly 351 DwarfOp, // DW_OP_foo 352 DIFlag, // DIFlagFoo 353 DwarfMacinfo, // DW_MACINFO_foo 354 355 // Type valued tokens (TyVal). 356 Type, 357 358 APFloat, // APFloatVal 359 APSInt // APSInt 360 }; 361 } // end namespace lltok 362 } // end namespace llvm 363 364 #endif 365