2009-01-02 07:01:27 +00:00
|
|
|
//===- LLToken.h - Token Codes for LLVM Assembly Files ----------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines the enums for the .ll lexer.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef LIBS_ASMPARSER_LLTOKEN_H
|
|
|
|
#define LIBS_ASMPARSER_LLTOKEN_H
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
namespace lltok {
|
|
|
|
enum Kind {
|
|
|
|
// Markers
|
|
|
|
Eof, Error,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2009-01-02 07:01:27 +00:00
|
|
|
// Tokens with no info.
|
|
|
|
dotdotdot, // ...
|
|
|
|
equal, comma, // = ,
|
|
|
|
star, // *
|
|
|
|
lsquare, rsquare, // [ ]
|
|
|
|
lbrace, rbrace, // { }
|
|
|
|
less, greater, // < >
|
|
|
|
lparen, rparen, // ( )
|
2009-01-08 23:51:48 +00:00
|
|
|
backslash, // \ (not /)
|
2009-12-30 04:56:59 +00:00
|
|
|
exclaim, // !
|
2013-02-06 06:52:58 +00:00
|
|
|
hash, // #
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_x,
|
|
|
|
kw_true, kw_false,
|
|
|
|
kw_declare, kw_define,
|
|
|
|
kw_global, kw_constant,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2010-08-20 22:05:50 +00:00
|
|
|
kw_private, kw_linker_private, kw_linker_private_weak,
|
2012-08-17 18:33:14 +00:00
|
|
|
kw_linker_private_weak_def_auto, // FIXME: For backwards compatibility.
|
|
|
|
kw_internal,
|
|
|
|
kw_linkonce, kw_linkonce_odr, kw_linkonce_odr_auto_hide,
|
|
|
|
kw_weak, kw_weak_odr, kw_appending,
|
2010-07-01 21:55:59 +00:00
|
|
|
kw_dllimport, kw_dllexport, kw_common, kw_available_externally,
|
Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr. These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global. In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time. This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function. If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body. The
code generators on the other hand map weak and weak_odr linkage
to the same thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66339 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 15:45:40 +00:00
|
|
|
kw_default, kw_hidden, kw_protected,
|
2011-01-08 16:42:36 +00:00
|
|
|
kw_unnamed_addr,
|
2013-02-05 05:57:38 +00:00
|
|
|
kw_externally_initialized,
|
2009-03-11 08:08:06 +00:00
|
|
|
kw_extern_weak,
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_external, kw_thread_local,
|
2012-06-23 11:37:03 +00:00
|
|
|
kw_localdynamic, kw_initialexec, kw_localexec,
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_zeroinitializer,
|
|
|
|
kw_undef, kw_null,
|
|
|
|
kw_to,
|
|
|
|
kw_tail,
|
|
|
|
kw_target,
|
|
|
|
kw_triple,
|
2012-06-23 11:37:03 +00:00
|
|
|
kw_unwind,
|
2012-11-28 08:41:48 +00:00
|
|
|
kw_deplibs, // FIXME: Remove in 4.0
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_datalayout,
|
|
|
|
kw_volatile,
|
2011-07-25 23:16:38 +00:00
|
|
|
kw_atomic,
|
|
|
|
kw_unordered, kw_monotonic, kw_acquire, kw_release, kw_acq_rel, kw_seq_cst,
|
|
|
|
kw_singlethread,
|
2012-11-27 00:42:44 +00:00
|
|
|
kw_nnan,
|
|
|
|
kw_ninf,
|
|
|
|
kw_nsz,
|
|
|
|
kw_arcp,
|
|
|
|
kw_fast,
|
2009-07-22 22:44:56 +00:00
|
|
|
kw_nuw,
|
|
|
|
kw_nsw,
|
2009-07-20 21:19:07 +00:00
|
|
|
kw_exact,
|
2009-07-27 21:53:46 +00:00
|
|
|
kw_inbounds,
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_align,
|
|
|
|
kw_addrspace,
|
|
|
|
kw_section,
|
|
|
|
kw_alias,
|
|
|
|
kw_module,
|
|
|
|
kw_asm,
|
|
|
|
kw_sideeffect,
|
2009-10-21 23:28:00 +00:00
|
|
|
kw_alignstack,
|
2012-09-05 19:00:49 +00:00
|
|
|
kw_inteldialect,
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_gc,
|
|
|
|
kw_c,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2009-06-16 18:50:49 +00:00
|
|
|
kw_cc, kw_ccc, kw_fastcc, kw_coldcc,
|
2012-10-24 14:46:16 +00:00
|
|
|
kw_intel_ocl_bicc,
|
2010-05-16 09:08:45 +00:00
|
|
|
kw_x86_stdcallcc, kw_x86_fastcallcc, kw_x86_thiscallcc,
|
2009-06-16 18:50:49 +00:00
|
|
|
kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc,
|
2009-12-07 02:27:35 +00:00
|
|
|
kw_msp430_intrcc,
|
2010-09-25 07:46:17 +00:00
|
|
|
kw_ptx_kernel, kw_ptx_device,
|
2012-10-01 17:01:31 +00:00
|
|
|
kw_spir_kernel, kw_spir_func,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2013-02-06 06:52:58 +00:00
|
|
|
// Attributes:
|
|
|
|
kw_attributes,
|
|
|
|
kw_alwaysinline,
|
2013-02-26 06:58:09 +00:00
|
|
|
kw_sanitize_address,
|
2013-02-06 06:52:58 +00:00
|
|
|
kw_byval,
|
2013-05-24 12:26:52 +00:00
|
|
|
kw_cold,
|
2013-02-06 06:52:58 +00:00
|
|
|
kw_inlinehint,
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_inreg,
|
2013-02-06 06:52:58 +00:00
|
|
|
kw_minsize,
|
|
|
|
kw_naked,
|
|
|
|
kw_nest,
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_noalias,
|
2013-02-22 00:12:35 +00:00
|
|
|
kw_nobuiltin,
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_nocapture,
|
2013-02-06 06:52:58 +00:00
|
|
|
kw_noduplicate,
|
|
|
|
kw_noimplicitfloat,
|
|
|
|
kw_noinline,
|
|
|
|
kw_nonlazybind,
|
|
|
|
kw_noredzone,
|
|
|
|
kw_noreturn,
|
|
|
|
kw_nounwind,
|
|
|
|
kw_optsize,
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_readnone,
|
|
|
|
kw_readonly,
|
2013-04-20 05:14:40 +00:00
|
|
|
kw_returned,
|
2011-10-03 14:45:37 +00:00
|
|
|
kw_returns_twice,
|
2013-02-06 06:52:58 +00:00
|
|
|
kw_signext,
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_ssp,
|
|
|
|
kw_sspreq,
|
2013-01-23 06:41:41 +00:00
|
|
|
kw_sspstrong,
|
2013-02-06 06:52:58 +00:00
|
|
|
kw_sret,
|
2013-02-26 06:58:09 +00:00
|
|
|
kw_sanitize_thread,
|
|
|
|
kw_sanitize_memory,
|
2013-02-06 06:52:58 +00:00
|
|
|
kw_uwtable,
|
|
|
|
kw_zeroext,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_type,
|
|
|
|
kw_opaque,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_eq, kw_ne, kw_slt, kw_sgt, kw_sle, kw_sge, kw_ult, kw_ugt, kw_ule,
|
|
|
|
kw_uge, kw_oeq, kw_one, kw_olt, kw_ogt, kw_ole, kw_oge, kw_ord, kw_uno,
|
|
|
|
kw_ueq, kw_une,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2011-07-28 21:48:00 +00:00
|
|
|
// atomicrmw operations that aren't also instruction keywords.
|
|
|
|
kw_xchg, kw_nand, kw_max, kw_min, kw_umax, kw_umin,
|
|
|
|
|
2009-01-02 07:01:27 +00:00
|
|
|
// Instruction Opcodes (Opcode in UIntVal).
|
2009-06-04 22:49:04 +00:00
|
|
|
kw_add, kw_fadd, kw_sub, kw_fsub, kw_mul, kw_fmul,
|
|
|
|
kw_udiv, kw_sdiv, kw_fdiv,
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_urem, kw_srem, kw_frem, kw_shl, kw_lshr, kw_ashr,
|
2009-07-08 03:04:38 +00:00
|
|
|
kw_and, kw_or, kw_xor, kw_icmp, kw_fcmp,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2009-01-02 07:01:27 +00:00
|
|
|
kw_phi, kw_call,
|
|
|
|
kw_trunc, kw_zext, kw_sext, kw_fptrunc, kw_fpext, kw_uitofp, kw_sitofp,
|
|
|
|
kw_fptoui, kw_fptosi, kw_inttoptr, kw_ptrtoint, kw_bitcast,
|
|
|
|
kw_select, kw_va_arg,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2011-08-12 20:24:12 +00:00
|
|
|
kw_landingpad, kw_personality, kw_cleanup, kw_catch, kw_filter,
|
|
|
|
|
2012-02-06 21:02:43 +00:00
|
|
|
kw_ret, kw_br, kw_switch, kw_indirectbr, kw_invoke, kw_resume,
|
2009-10-28 00:19:10 +00:00
|
|
|
kw_unreachable,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2011-07-28 21:48:00 +00:00
|
|
|
kw_alloca, kw_load, kw_store, kw_fence, kw_cmpxchg, kw_atomicrmw,
|
|
|
|
kw_getelementptr,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2011-06-17 06:57:15 +00:00
|
|
|
kw_extractelement, kw_insertelement, kw_shufflevector,
|
2009-10-28 03:39:23 +00:00
|
|
|
kw_extractvalue, kw_insertvalue, kw_blockaddress,
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2009-01-02 07:01:27 +00:00
|
|
|
// Unsigned Valued tokens (UIntVal).
|
|
|
|
GlobalID, // @42
|
|
|
|
LocalVarID, // %42
|
2013-02-06 06:52:58 +00:00
|
|
|
AttrGrpID, // #42
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2009-01-02 07:01:27 +00:00
|
|
|
// String valued tokens (StrVal).
|
|
|
|
LabelStr, // foo:
|
|
|
|
GlobalVar, // @foo @"foo"
|
|
|
|
LocalVar, // %foo %"foo"
|
2009-12-30 05:02:06 +00:00
|
|
|
MetadataVar, // !foo
|
2009-01-02 07:01:27 +00:00
|
|
|
StringConstant, // "foo"
|
2009-01-02 22:46:48 +00:00
|
|
|
|
2009-01-02 07:01:27 +00:00
|
|
|
// Type valued tokens (TyVal).
|
2009-01-02 22:46:48 +00:00
|
|
|
Type,
|
|
|
|
|
Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,
r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444,
r136445, r136446, r136253 pending review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136556 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 05:42:50 +00:00
|
|
|
APFloat, // APFloatVal
|
|
|
|
APSInt // APSInt
|
2009-01-02 07:01:27 +00:00
|
|
|
};
|
|
|
|
} // end namespace lltok
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|