LLToken.h revision 263508
1257399Sjilles//===- LLToken.h - Token Codes for LLVM Assembly Files ----------*- C++ -*-===//
2257399Sjilles//
3257399Sjilles//                     The LLVM Compiler Infrastructure
4257399Sjilles//
5257399Sjilles// This file is distributed under the University of Illinois Open Source
6257399Sjilles// License. See LICENSE.TXT for details.
7257399Sjilles//
8257399Sjilles//===----------------------------------------------------------------------===//
9257399Sjilles//
10257399Sjilles// 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
17namespace llvm {
18namespace 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_internal,
42    kw_linkonce, kw_linkonce_odr,
43    kw_weak, 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,
53    kw_to,
54    kw_tail,
55    kw_target,
56    kw_triple,
57    kw_unwind,
58    kw_deplibs,                 // FIXME: Remove in 4.0
59    kw_datalayout,
60    kw_volatile,
61    kw_atomic,
62    kw_unordered, kw_monotonic, kw_acquire, kw_release, kw_acq_rel, kw_seq_cst,
63    kw_singlethread,
64    kw_nnan,
65    kw_ninf,
66    kw_nsz,
67    kw_arcp,
68    kw_fast,
69    kw_nuw,
70    kw_nsw,
71    kw_exact,
72    kw_inbounds,
73    kw_align,
74    kw_addrspace,
75    kw_section,
76    kw_alias,
77    kw_module,
78    kw_asm,
79    kw_sideeffect,
80    kw_alignstack,
81    kw_inteldialect,
82    kw_gc,
83    kw_prefix,
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    kw_webkit_jscc, kw_anyregcc,
95
96    // Attributes:
97    kw_attributes,
98    kw_alwaysinline,
99    kw_sanitize_address,
100    kw_builtin,
101    kw_byval,
102    kw_cold,
103    kw_inlinehint,
104    kw_inreg,
105    kw_minsize,
106    kw_naked,
107    kw_nest,
108    kw_noalias,
109    kw_nobuiltin,
110    kw_nocapture,
111    kw_noduplicate,
112    kw_noimplicitfloat,
113    kw_noinline,
114    kw_nonlazybind,
115    kw_noredzone,
116    kw_noreturn,
117    kw_nounwind,
118    kw_optnone,
119    kw_optsize,
120    kw_readnone,
121    kw_readonly,
122    kw_returned,
123    kw_returns_twice,
124    kw_signext,
125    kw_ssp,
126    kw_sspreq,
127    kw_sspstrong,
128    kw_sret,
129    kw_sanitize_thread,
130    kw_sanitize_memory,
131    kw_uwtable,
132    kw_zeroext,
133
134    kw_type,
135    kw_opaque,
136
137    kw_eq, kw_ne, kw_slt, kw_sgt, kw_sle, kw_sge, kw_ult, kw_ugt, kw_ule,
138    kw_uge, kw_oeq, kw_one, kw_olt, kw_ogt, kw_ole, kw_oge, kw_ord, kw_uno,
139    kw_ueq, kw_une,
140
141    // atomicrmw operations that aren't also instruction keywords.
142    kw_xchg, kw_nand, kw_max, kw_min, kw_umax, kw_umin,
143
144    // Instruction Opcodes (Opcode in UIntVal).
145    kw_add,  kw_fadd, kw_sub,  kw_fsub, kw_mul,  kw_fmul,
146    kw_udiv, kw_sdiv, kw_fdiv,
147    kw_urem, kw_srem, kw_frem, kw_shl,  kw_lshr, kw_ashr,
148    kw_and,  kw_or,   kw_xor,  kw_icmp, kw_fcmp,
149
150    kw_phi, kw_call,
151    kw_trunc, kw_zext, kw_sext, kw_fptrunc, kw_fpext, kw_uitofp, kw_sitofp,
152    kw_fptoui, kw_fptosi, kw_inttoptr, kw_ptrtoint, kw_bitcast,
153    kw_addrspacecast,
154    kw_select, kw_va_arg,
155
156    kw_landingpad, kw_personality, kw_cleanup, kw_catch, kw_filter,
157
158    kw_ret, kw_br, kw_switch, kw_indirectbr, kw_invoke, kw_resume,
159    kw_unreachable,
160
161    kw_alloca, kw_load, kw_store, kw_fence, kw_cmpxchg, kw_atomicrmw,
162    kw_getelementptr,
163
164    kw_extractelement, kw_insertelement, kw_shufflevector,
165    kw_extractvalue, kw_insertvalue, kw_blockaddress,
166
167    // Unsigned Valued tokens (UIntVal).
168    GlobalID,          // @42
169    LocalVarID,        // %42
170    AttrGrpID,         // #42
171
172    // String valued tokens (StrVal).
173    LabelStr,          // foo:
174    GlobalVar,         // @foo @"foo"
175    LocalVar,          // %foo %"foo"
176    MetadataVar,       // !foo
177    StringConstant,    // "foo"
178
179    // Type valued tokens (TyVal).
180    Type,
181
182    APFloat,  // APFloatVal
183    APSInt // APSInt
184  };
185} // end namespace lltok
186} // end namespace llvm
187
188#endif
189