Home | History | Annotate | Download | only in AsmParser
      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 LIBS_ASMPARSER_LLTOKEN_H
     15 #define LIBS_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     backslash,         // \    (not /)
     32     exclaim,           // !
     33     hash,              // #
     34 
     35     kw_x,
     36     kw_true,    kw_false,
     37     kw_declare, kw_define,
     38     kw_global,  kw_constant,
     39 
     40     kw_private, kw_linker_private, kw_linker_private_weak,
     41     kw_linker_private_weak_def_auto, // FIXME: For backwards compatibility.
     42     kw_internal,
     43     kw_linkonce, kw_linkonce_odr, kw_linkonce_odr_auto_hide,
     44     kw_weak, kw_weak_odr, kw_appending,
     45     kw_dllimport, kw_dllexport, kw_common, kw_available_externally,
     46     kw_default, kw_hidden, kw_protected,
     47     kw_unnamed_addr,
     48     kw_externally_initialized,
     49     kw_extern_weak,
     50     kw_external, kw_thread_local,
     51     kw_localdynamic, kw_initialexec, kw_localexec,
     52     kw_zeroinitializer,
     53     kw_undef, kw_null,
     54     kw_to,
     55     kw_tail,
     56     kw_target,
     57     kw_triple,
     58     kw_unwind,
     59     kw_deplibs,                 // FIXME: Remove in 4.0
     60     kw_datalayout,
     61     kw_volatile,
     62     kw_atomic,
     63     kw_unordered, kw_monotonic, kw_acquire, kw_release, kw_acq_rel, kw_seq_cst,
     64     kw_singlethread,
     65     kw_nnan,
     66     kw_ninf,
     67     kw_nsz,
     68     kw_arcp,
     69     kw_fast,
     70     kw_nuw,
     71     kw_nsw,
     72     kw_exact,
     73     kw_inbounds,
     74     kw_align,
     75     kw_addrspace,
     76     kw_section,
     77     kw_alias,
     78     kw_module,
     79     kw_asm,
     80     kw_sideeffect,
     81     kw_alignstack,
     82     kw_inteldialect,
     83     kw_gc,
     84     kw_c,
     85 
     86     kw_cc, kw_ccc, kw_fastcc, kw_coldcc,
     87     kw_intel_ocl_bicc,
     88     kw_x86_stdcallcc, kw_x86_fastcallcc, kw_x86_thiscallcc,
     89     kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc,
     90     kw_msp430_intrcc,
     91     kw_ptx_kernel, kw_ptx_device,
     92     kw_spir_kernel, kw_spir_func,
     93     kw_x86_64_sysvcc, kw_x86_64_win64cc,
     94 
     95     // Attributes:
     96     kw_attributes,
     97     kw_alwaysinline,
     98     kw_sanitize_address,
     99     kw_builtin,
    100     kw_byval,
    101     kw_cold,
    102     kw_inlinehint,
    103     kw_inreg,
    104     kw_minsize,
    105     kw_naked,
    106     kw_nest,
    107     kw_noalias,
    108     kw_nobuiltin,
    109     kw_nocapture,
    110     kw_noduplicate,
    111     kw_noimplicitfloat,
    112     kw_noinline,
    113     kw_nonlazybind,
    114     kw_noredzone,
    115     kw_noreturn,
    116     kw_nounwind,
    117     kw_optsize,
    118     kw_readnone,
    119     kw_readonly,
    120     kw_returned,
    121     kw_returns_twice,
    122     kw_signext,
    123     kw_ssp,
    124     kw_sspreq,
    125     kw_sspstrong,
    126     kw_sret,
    127     kw_sanitize_thread,
    128     kw_sanitize_memory,
    129     kw_uwtable,
    130     kw_zeroext,
    131 
    132     kw_type,
    133     kw_opaque,
    134 
    135     kw_eq, kw_ne, kw_slt, kw_sgt, kw_sle, kw_sge, kw_ult, kw_ugt, kw_ule,
    136     kw_uge, kw_oeq, kw_one, kw_olt, kw_ogt, kw_ole, kw_oge, kw_ord, kw_uno,
    137     kw_ueq, kw_une,
    138 
    139     // atomicrmw operations that aren't also instruction keywords.
    140     kw_xchg, kw_nand, kw_max, kw_min, kw_umax, kw_umin,
    141 
    142     // Instruction Opcodes (Opcode in UIntVal).
    143     kw_add,  kw_fadd, kw_sub,  kw_fsub, kw_mul,  kw_fmul,
    144     kw_udiv, kw_sdiv, kw_fdiv,
    145     kw_urem, kw_srem, kw_frem, kw_shl,  kw_lshr, kw_ashr,
    146     kw_and,  kw_or,   kw_xor,  kw_icmp, kw_fcmp,
    147 
    148     kw_phi, kw_call,
    149     kw_trunc, kw_zext, kw_sext, kw_fptrunc, kw_fpext, kw_uitofp, kw_sitofp,
    150     kw_fptoui, kw_fptosi, kw_inttoptr, kw_ptrtoint, kw_bitcast,
    151     kw_select, kw_va_arg,
    152 
    153     kw_landingpad, kw_personality, kw_cleanup, kw_catch, kw_filter,
    154 
    155     kw_ret, kw_br, kw_switch, kw_indirectbr, kw_invoke, kw_resume,
    156     kw_unreachable,
    157 
    158     kw_alloca, kw_load, kw_store, kw_fence, kw_cmpxchg, kw_atomicrmw,
    159     kw_getelementptr,
    160 
    161     kw_extractelement, kw_insertelement, kw_shufflevector,
    162     kw_extractvalue, kw_insertvalue, kw_blockaddress,
    163 
    164     // Unsigned Valued tokens (UIntVal).
    165     GlobalID,          // @42
    166     LocalVarID,        // %42
    167     AttrGrpID,         // #42
    168 
    169     // String valued tokens (StrVal).
    170     LabelStr,          // foo:
    171     GlobalVar,         // @foo @"foo"
    172     LocalVar,          // %foo %"foo"
    173     MetadataVar,       // !foo
    174     StringConstant,    // "foo"
    175 
    176     // Type valued tokens (TyVal).
    177     Type,
    178 
    179     APFloat,  // APFloatVal
    180     APSInt // APSInt
    181   };
    182 } // end namespace lltok
    183 } // end namespace llvm
    184 
    185 #endif
    186