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