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, Error, 22 23 // Tokens with no info. 24 dotdotdot, // ... 25 equal, comma, // = , 26 star, // * 27 lsquare, rsquare, // [ ] 28 lbrace, rbrace, // { } 29 less, greater, // < > 30 lparen, rparen, // ( ) 31 exclaim, // ! 32 bar, // | 33 34 kw_x, 35 kw_true, kw_false, 36 kw_declare, kw_define, 37 kw_global, kw_constant, 38 39 kw_private, 40 kw_internal, 41 kw_linkonce, kw_linkonce_odr, 42 kw_weak, // Used as a linkage, and a modifier for "cmpxchg". 43 kw_weak_odr, kw_appending, 44 kw_dllimport, kw_dllexport, kw_common, kw_available_externally, 45 kw_default, kw_hidden, kw_protected, 46 kw_unnamed_addr, 47 kw_externally_initialized, 48 kw_extern_weak, 49 kw_external, kw_thread_local, 50 kw_localdynamic, kw_initialexec, kw_localexec, 51 kw_zeroinitializer, 52 kw_undef, kw_null, kw_none, 53 kw_to, 54 kw_caller, 55 kw_within, 56 kw_from, 57 kw_tail, 58 kw_musttail, 59 kw_notail, 60 kw_target, 61 kw_triple, 62 kw_unwind, 63 kw_deplibs, // FIXME: Remove in 4.0 64 kw_datalayout, 65 kw_volatile, 66 kw_atomic, 67 kw_unordered, kw_monotonic, kw_acquire, kw_release, kw_acq_rel, kw_seq_cst, 68 kw_singlethread, 69 kw_nnan, 70 kw_ninf, 71 kw_nsz, 72 kw_arcp, 73 kw_fast, 74 kw_nuw, 75 kw_nsw, 76 kw_exact, 77 kw_inbounds, 78 kw_align, 79 kw_addrspace, 80 kw_section, 81 kw_alias, 82 kw_module, 83 kw_asm, 84 kw_sideeffect, 85 kw_alignstack, 86 kw_inteldialect, 87 kw_gc, 88 kw_prefix, 89 kw_prologue, 90 kw_c, 91 92 kw_cc, kw_ccc, kw_fastcc, kw_coldcc, 93 kw_intel_ocl_bicc, 94 kw_x86_stdcallcc, kw_x86_fastcallcc, kw_x86_thiscallcc, kw_x86_vectorcallcc, 95 kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc, 96 kw_msp430_intrcc, 97 kw_ptx_kernel, kw_ptx_device, 98 kw_spir_kernel, kw_spir_func, 99 kw_x86_64_sysvcc, kw_x86_64_win64cc, 100 kw_webkit_jscc, kw_anyregcc, 101 kw_preserve_mostcc, kw_preserve_allcc, 102 kw_ghccc, 103 kw_x86_intrcc, 104 kw_hhvmcc, kw_hhvm_ccc, 105 kw_cxx_fast_tlscc, 106 107 // Attributes: 108 kw_attributes, 109 kw_alwaysinline, 110 kw_argmemonly, 111 kw_sanitize_address, 112 kw_builtin, 113 kw_byval, 114 kw_inalloca, 115 kw_cold, 116 kw_convergent, 117 kw_dereferenceable, 118 kw_dereferenceable_or_null, 119 kw_inaccessiblememonly, 120 kw_inaccessiblemem_or_argmemonly, 121 kw_inlinehint, 122 kw_inreg, 123 kw_jumptable, 124 kw_minsize, 125 kw_naked, 126 kw_nest, 127 kw_noalias, 128 kw_nobuiltin, 129 kw_nocapture, 130 kw_noduplicate, 131 kw_noimplicitfloat, 132 kw_noinline, 133 kw_norecurse, 134 kw_nonlazybind, 135 kw_nonnull, 136 kw_noredzone, 137 kw_noreturn, 138 kw_nounwind, 139 kw_optnone, 140 kw_optsize, 141 kw_readnone, 142 kw_readonly, 143 kw_returned, 144 kw_returns_twice, 145 kw_signext, 146 kw_ssp, 147 kw_sspreq, 148 kw_sspstrong, 149 kw_safestack, 150 kw_sret, 151 kw_sanitize_thread, 152 kw_sanitize_memory, 153 kw_uwtable, 154 kw_zeroext, 155 156 kw_type, 157 kw_opaque, 158 159 kw_comdat, 160 161 // Comdat types 162 kw_any, 163 kw_exactmatch, 164 kw_largest, 165 kw_noduplicates, 166 kw_samesize, 167 168 kw_eq, kw_ne, kw_slt, kw_sgt, kw_sle, kw_sge, kw_ult, kw_ugt, kw_ule, 169 kw_uge, kw_oeq, kw_one, kw_olt, kw_ogt, kw_ole, kw_oge, kw_ord, kw_uno, 170 kw_ueq, kw_une, 171 172 // atomicrmw operations that aren't also instruction keywords. 173 kw_xchg, kw_nand, kw_max, kw_min, kw_umax, kw_umin, 174 175 // Instruction Opcodes (Opcode in UIntVal). 176 kw_add, kw_fadd, kw_sub, kw_fsub, kw_mul, kw_fmul, 177 kw_udiv, kw_sdiv, kw_fdiv, 178 kw_urem, kw_srem, kw_frem, kw_shl, kw_lshr, kw_ashr, 179 kw_and, kw_or, kw_xor, kw_icmp, kw_fcmp, 180 181 kw_phi, kw_call, 182 kw_trunc, kw_zext, kw_sext, kw_fptrunc, kw_fpext, kw_uitofp, kw_sitofp, 183 kw_fptoui, kw_fptosi, kw_inttoptr, kw_ptrtoint, kw_bitcast, 184 kw_addrspacecast, 185 kw_select, kw_va_arg, 186 187 kw_landingpad, kw_personality, kw_cleanup, kw_catch, kw_filter, 188 189 kw_ret, kw_br, kw_switch, kw_indirectbr, kw_invoke, kw_resume, 190 kw_unreachable, kw_cleanupret, kw_catchswitch, kw_catchret, kw_catchpad, 191 kw_cleanuppad, 192 193 kw_alloca, kw_load, kw_store, kw_fence, kw_cmpxchg, kw_atomicrmw, 194 kw_getelementptr, 195 196 kw_extractelement, kw_insertelement, kw_shufflevector, 197 kw_extractvalue, kw_insertvalue, kw_blockaddress, 198 199 // Metadata types. 200 kw_distinct, 201 202 // Use-list order directives. 203 kw_uselistorder, kw_uselistorder_bb, 204 205 // Unsigned Valued tokens (UIntVal). 206 GlobalID, // @42 207 LocalVarID, // %42 208 AttrGrpID, // #42 209 210 // String valued tokens (StrVal). 211 LabelStr, // foo: 212 GlobalVar, // @foo @"foo" 213 ComdatVar, // $foo 214 LocalVar, // %foo %"foo" 215 MetadataVar, // !foo 216 StringConstant, // "foo" 217 DwarfTag, // DW_TAG_foo 218 DwarfAttEncoding, // DW_ATE_foo 219 DwarfVirtuality, // DW_VIRTUALITY_foo 220 DwarfLang, // DW_LANG_foo 221 DwarfOp, // DW_OP_foo 222 DIFlag, // DIFlagFoo 223 DwarfMacinfo, // DW_MACINFO_foo 224 225 // Type valued tokens (TyVal). 226 Type, 227 228 APFloat, // APFloatVal 229 APSInt // APSInt 230 }; 231 } // end namespace lltok 232 } // end namespace llvm 233 234 #endif 235