LLVM API Documentation

LLToken.h
Go to the documentation of this file.
00001 //===- LLToken.h - Token Codes for LLVM Assembly Files ----------*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines the enums for the .ll lexer.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LIBS_ASMPARSER_LLTOKEN_H
00015 #define LIBS_ASMPARSER_LLTOKEN_H
00016 
00017 namespace llvm {
00018 namespace lltok {
00019   enum Kind {
00020     // Markers
00021     Eof, Error,
00022 
00023     // Tokens with no info.
00024     dotdotdot,         // ...
00025     equal, comma,      // =  ,
00026     star,              // *
00027     lsquare, rsquare,  // [  ]
00028     lbrace, rbrace,    // {  }
00029     less, greater,     // <  >
00030     lparen, rparen,    // (  )
00031     backslash,         // \    (not /)
00032     exclaim,           // !
00033     hash,              // #
00034 
00035     kw_x,
00036     kw_true,    kw_false,
00037     kw_declare, kw_define,
00038     kw_global,  kw_constant,
00039 
00040     kw_private, kw_linker_private, kw_linker_private_weak,
00041     kw_linker_private_weak_def_auto, // FIXME: For backwards compatibility.
00042     kw_internal,
00043     kw_linkonce, kw_linkonce_odr, kw_linkonce_odr_auto_hide,
00044     kw_weak, kw_weak_odr, kw_appending,
00045     kw_dllimport, kw_dllexport, kw_common, kw_available_externally,
00046     kw_default, kw_hidden, kw_protected,
00047     kw_unnamed_addr,
00048     kw_externally_initialized,
00049     kw_extern_weak,
00050     kw_external, kw_thread_local,
00051     kw_localdynamic, kw_initialexec, kw_localexec,
00052     kw_zeroinitializer,
00053     kw_undef, kw_null,
00054     kw_to,
00055     kw_tail,
00056     kw_target,
00057     kw_triple,
00058     kw_unwind,
00059     kw_deplibs,                 // FIXME: Remove in 4.0
00060     kw_datalayout,
00061     kw_volatile,
00062     kw_atomic,
00063     kw_unordered, kw_monotonic, kw_acquire, kw_release, kw_acq_rel, kw_seq_cst,
00064     kw_singlethread,
00065     kw_nnan,
00066     kw_ninf,
00067     kw_nsz,
00068     kw_arcp,
00069     kw_fast,
00070     kw_nuw,
00071     kw_nsw,
00072     kw_exact,
00073     kw_inbounds,
00074     kw_align,
00075     kw_addrspace,
00076     kw_section,
00077     kw_alias,
00078     kw_module,
00079     kw_asm,
00080     kw_sideeffect,
00081     kw_alignstack,
00082     kw_inteldialect,
00083     kw_gc,
00084     kw_c,
00085 
00086     kw_cc, kw_ccc, kw_fastcc, kw_coldcc,
00087     kw_intel_ocl_bicc,
00088     kw_x86_stdcallcc, kw_x86_fastcallcc, kw_x86_thiscallcc,
00089     kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc,
00090     kw_msp430_intrcc,
00091     kw_ptx_kernel, kw_ptx_device,
00092     kw_spir_kernel, kw_spir_func,
00093 
00094     // Attributes:
00095     kw_attributes,
00096     kw_alwaysinline,
00097     kw_sanitize_address,
00098     kw_byval,
00099     kw_inlinehint,
00100     kw_inreg,
00101     kw_minsize,
00102     kw_naked,
00103     kw_nest,
00104     kw_noalias,
00105     kw_nobuiltin,
00106     kw_nocapture,
00107     kw_noduplicate,
00108     kw_noimplicitfloat,
00109     kw_noinline,
00110     kw_nonlazybind,
00111     kw_noredzone,
00112     kw_noreturn,
00113     kw_nounwind,
00114     kw_optsize,
00115     kw_readnone,
00116     kw_readonly,
00117     kw_returned,
00118     kw_returns_twice,
00119     kw_signext,
00120     kw_ssp,
00121     kw_sspreq,
00122     kw_sspstrong,
00123     kw_sret,
00124     kw_sanitize_thread,
00125     kw_sanitize_memory,
00126     kw_uwtable,
00127     kw_zeroext,
00128 
00129     kw_type,
00130     kw_opaque,
00131 
00132     kw_eq, kw_ne, kw_slt, kw_sgt, kw_sle, kw_sge, kw_ult, kw_ugt, kw_ule,
00133     kw_uge, kw_oeq, kw_one, kw_olt, kw_ogt, kw_ole, kw_oge, kw_ord, kw_uno,
00134     kw_ueq, kw_une,
00135 
00136     // atomicrmw operations that aren't also instruction keywords.
00137     kw_xchg, kw_nand, kw_max, kw_min, kw_umax, kw_umin,
00138 
00139     // Instruction Opcodes (Opcode in UIntVal).
00140     kw_add,  kw_fadd, kw_sub,  kw_fsub, kw_mul,  kw_fmul,
00141     kw_udiv, kw_sdiv, kw_fdiv,
00142     kw_urem, kw_srem, kw_frem, kw_shl,  kw_lshr, kw_ashr,
00143     kw_and,  kw_or,   kw_xor,  kw_icmp, kw_fcmp,
00144 
00145     kw_phi, kw_call,
00146     kw_trunc, kw_zext, kw_sext, kw_fptrunc, kw_fpext, kw_uitofp, kw_sitofp,
00147     kw_fptoui, kw_fptosi, kw_inttoptr, kw_ptrtoint, kw_bitcast,
00148     kw_select, kw_va_arg,
00149 
00150     kw_landingpad, kw_personality, kw_cleanup, kw_catch, kw_filter,
00151 
00152     kw_ret, kw_br, kw_switch, kw_indirectbr, kw_invoke, kw_resume,
00153     kw_unreachable,
00154 
00155     kw_alloca, kw_load, kw_store, kw_fence, kw_cmpxchg, kw_atomicrmw,
00156     kw_getelementptr,
00157 
00158     kw_extractelement, kw_insertelement, kw_shufflevector,
00159     kw_extractvalue, kw_insertvalue, kw_blockaddress,
00160 
00161     // Unsigned Valued tokens (UIntVal).
00162     GlobalID,          // @42
00163     LocalVarID,        // %42
00164     AttrGrpID,         // #42
00165 
00166     // String valued tokens (StrVal).
00167     LabelStr,          // foo:
00168     GlobalVar,         // @foo @"foo"
00169     LocalVar,          // %foo %"foo"
00170     MetadataVar,       // !foo
00171     StringConstant,    // "foo"
00172 
00173     // Type valued tokens (TyVal).
00174     Type,
00175 
00176     APFloat,  // APFloatVal
00177     APSInt // APSInt
00178   };
00179 } // end namespace lltok
00180 } // end namespace llvm
00181 
00182 #endif