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 LLVM_LIB_ASMPARSER_LLTOKEN_H
00015 #define LLVM_LIB_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,
00041     kw_internal,
00042     kw_linkonce, kw_linkonce_odr,
00043     kw_weak, // Used as a linkage, and a modifier for "cmpxchg".
00044     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_musttail,
00057     kw_target,
00058     kw_triple,
00059     kw_unwind,
00060     kw_deplibs,                 // FIXME: Remove in 4.0
00061     kw_datalayout,
00062     kw_volatile,
00063     kw_atomic,
00064     kw_unordered, kw_monotonic, kw_acquire, kw_release, kw_acq_rel, kw_seq_cst,
00065     kw_singlethread,
00066     kw_nnan,
00067     kw_ninf,
00068     kw_nsz,
00069     kw_arcp,
00070     kw_fast,
00071     kw_nuw,
00072     kw_nsw,
00073     kw_exact,
00074     kw_inbounds,
00075     kw_align,
00076     kw_addrspace,
00077     kw_section,
00078     kw_alias,
00079     kw_module,
00080     kw_asm,
00081     kw_sideeffect,
00082     kw_alignstack,
00083     kw_inteldialect,
00084     kw_gc,
00085     kw_prefix,
00086     kw_c,
00087 
00088     kw_cc, kw_ccc, kw_fastcc, kw_coldcc,
00089     kw_intel_ocl_bicc,
00090     kw_x86_stdcallcc, kw_x86_fastcallcc, kw_x86_thiscallcc,
00091     kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc,
00092     kw_msp430_intrcc,
00093     kw_ptx_kernel, kw_ptx_device,
00094     kw_spir_kernel, kw_spir_func,
00095     kw_x86_64_sysvcc, kw_x86_64_win64cc,
00096     kw_webkit_jscc, kw_anyregcc,
00097     kw_preserve_mostcc, kw_preserve_allcc,
00098 
00099     // Attributes:
00100     kw_attributes,
00101     kw_alwaysinline,
00102     kw_sanitize_address,
00103     kw_builtin,
00104     kw_byval,
00105     kw_inalloca,
00106     kw_cold,
00107     kw_dereferenceable,
00108     kw_inlinehint,
00109     kw_inreg,
00110     kw_jumptable,
00111     kw_minsize,
00112     kw_naked,
00113     kw_nest,
00114     kw_noalias,
00115     kw_nobuiltin,
00116     kw_nocapture,
00117     kw_noduplicate,
00118     kw_noimplicitfloat,
00119     kw_noinline,
00120     kw_nonlazybind,
00121     kw_nonnull,
00122     kw_noredzone,
00123     kw_noreturn,
00124     kw_nounwind,
00125     kw_optnone,
00126     kw_optsize,
00127     kw_readnone,
00128     kw_readonly,
00129     kw_returned,
00130     kw_returns_twice,
00131     kw_signext,
00132     kw_ssp,
00133     kw_sspreq,
00134     kw_sspstrong,
00135     kw_sret,
00136     kw_sanitize_thread,
00137     kw_sanitize_memory,
00138     kw_uwtable,
00139     kw_zeroext,
00140 
00141     kw_type,
00142     kw_opaque,
00143 
00144     kw_comdat,
00145 
00146     // Comdat types
00147     kw_any,
00148     kw_exactmatch,
00149     kw_largest,
00150     kw_noduplicates,
00151     kw_samesize,
00152 
00153     kw_eq, kw_ne, kw_slt, kw_sgt, kw_sle, kw_sge, kw_ult, kw_ugt, kw_ule,
00154     kw_uge, kw_oeq, kw_one, kw_olt, kw_ogt, kw_ole, kw_oge, kw_ord, kw_uno,
00155     kw_ueq, kw_une,
00156 
00157     // atomicrmw operations that aren't also instruction keywords.
00158     kw_xchg, kw_nand, kw_max, kw_min, kw_umax, kw_umin,
00159 
00160     // Instruction Opcodes (Opcode in UIntVal).
00161     kw_add,  kw_fadd, kw_sub,  kw_fsub, kw_mul,  kw_fmul,
00162     kw_udiv, kw_sdiv, kw_fdiv,
00163     kw_urem, kw_srem, kw_frem, kw_shl,  kw_lshr, kw_ashr,
00164     kw_and,  kw_or,   kw_xor,  kw_icmp, kw_fcmp,
00165 
00166     kw_phi, kw_call,
00167     kw_trunc, kw_zext, kw_sext, kw_fptrunc, kw_fpext, kw_uitofp, kw_sitofp,
00168     kw_fptoui, kw_fptosi, kw_inttoptr, kw_ptrtoint, kw_bitcast,
00169     kw_addrspacecast,
00170     kw_select, kw_va_arg,
00171 
00172     kw_landingpad, kw_personality, kw_cleanup, kw_catch, kw_filter,
00173 
00174     kw_ret, kw_br, kw_switch, kw_indirectbr, kw_invoke, kw_resume,
00175     kw_unreachable,
00176 
00177     kw_alloca, kw_load, kw_store, kw_fence, kw_cmpxchg, kw_atomicrmw,
00178     kw_getelementptr,
00179 
00180     kw_extractelement, kw_insertelement, kw_shufflevector,
00181     kw_extractvalue, kw_insertvalue, kw_blockaddress,
00182 
00183     // Use-list order directives.
00184     kw_uselistorder, kw_uselistorder_bb,
00185 
00186     // Unsigned Valued tokens (UIntVal).
00187     GlobalID,          // @42
00188     LocalVarID,        // %42
00189     AttrGrpID,         // #42
00190 
00191     // String valued tokens (StrVal).
00192     LabelStr,          // foo:
00193     GlobalVar,         // @foo @"foo"
00194     ComdatVar,         // $foo
00195     LocalVar,          // %foo %"foo"
00196     MetadataVar,       // !foo
00197     StringConstant,    // "foo"
00198 
00199     // Type valued tokens (TyVal).
00200     Type,
00201 
00202     APFloat,  // APFloatVal
00203     APSInt // APSInt
00204   };
00205 } // end namespace lltok
00206 } // end namespace llvm
00207 
00208 #endif