2009-01-02 08:01:27 +01: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 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
// Tokens with no info.
|
|
|
|
dotdotdot, // ...
|
|
|
|
equal, comma, // = ,
|
|
|
|
star, // *
|
|
|
|
lsquare, rsquare, // [ ]
|
|
|
|
lbrace, rbrace, // { }
|
|
|
|
less, greater, // < >
|
|
|
|
lparen, rparen, // ( )
|
2009-01-09 00:51:48 +01:00
|
|
|
backslash, // \ (not /)
|
2009-12-30 05:56:59 +01:00
|
|
|
exclaim, // !
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
kw_x,
|
|
|
|
kw_begin, kw_end,
|
|
|
|
kw_true, kw_false,
|
|
|
|
kw_declare, kw_define,
|
|
|
|
kw_global, kw_constant,
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-07-20 03:03:30 +02:00
|
|
|
kw_private, kw_linker_private, kw_internal, kw_linkonce, kw_linkonce_odr,
|
|
|
|
kw_weak, kw_weak_odr, kw_appending, 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.
llvm-svn: 66339
2009-03-07 16:45:40 +01:00
|
|
|
kw_default, kw_hidden, kw_protected,
|
2009-03-11 09:08:06 +01:00
|
|
|
kw_extern_weak,
|
2009-01-02 08:01:27 +01:00
|
|
|
kw_external, kw_thread_local,
|
|
|
|
kw_zeroinitializer,
|
|
|
|
kw_undef, kw_null,
|
|
|
|
kw_to,
|
|
|
|
kw_tail,
|
|
|
|
kw_target,
|
|
|
|
kw_triple,
|
|
|
|
kw_deplibs,
|
|
|
|
kw_datalayout,
|
|
|
|
kw_volatile,
|
2009-07-23 00:44:56 +02:00
|
|
|
kw_nuw,
|
|
|
|
kw_nsw,
|
2009-07-20 23:19:07 +02:00
|
|
|
kw_exact,
|
2009-07-27 23:53:46 +02:00
|
|
|
kw_inbounds,
|
2009-01-02 08:01:27 +01:00
|
|
|
kw_align,
|
|
|
|
kw_addrspace,
|
|
|
|
kw_section,
|
|
|
|
kw_alias,
|
|
|
|
kw_module,
|
|
|
|
kw_asm,
|
|
|
|
kw_sideeffect,
|
2009-10-22 01:28:00 +02:00
|
|
|
kw_alignstack,
|
2009-01-02 08:01:27 +01:00
|
|
|
kw_gc,
|
|
|
|
kw_c,
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-06-16 20:50:49 +02:00
|
|
|
kw_cc, kw_ccc, kw_fastcc, kw_coldcc,
|
|
|
|
kw_x86_stdcallcc, kw_x86_fastcallcc,
|
|
|
|
kw_arm_apcscc, kw_arm_aapcscc, kw_arm_aapcs_vfpcc,
|
2009-12-07 03:27:35 +01:00
|
|
|
kw_msp430_intrcc,
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
kw_signext,
|
|
|
|
kw_zeroext,
|
|
|
|
kw_inreg,
|
|
|
|
kw_sret,
|
|
|
|
kw_nounwind,
|
|
|
|
kw_noreturn,
|
|
|
|
kw_noalias,
|
|
|
|
kw_nocapture,
|
|
|
|
kw_byval,
|
|
|
|
kw_nest,
|
|
|
|
kw_readnone,
|
|
|
|
kw_readonly,
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
kw_noinline,
|
|
|
|
kw_alwaysinline,
|
|
|
|
kw_optsize,
|
|
|
|
kw_ssp,
|
|
|
|
kw_sspreq,
|
2009-06-05 00:05:33 +02:00
|
|
|
kw_noredzone,
|
2009-06-05 23:57:13 +02:00
|
|
|
kw_noimplicitfloat,
|
2009-07-17 20:07:26 +02:00
|
|
|
kw_naked,
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
kw_type,
|
|
|
|
kw_opaque,
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01: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 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
// Instruction Opcodes (Opcode in UIntVal).
|
2009-06-05 00:49:04 +02:00
|
|
|
kw_add, kw_fadd, kw_sub, kw_fsub, kw_mul, kw_fmul,
|
|
|
|
kw_udiv, kw_sdiv, kw_fdiv,
|
2009-01-02 08:01:27 +01:00
|
|
|
kw_urem, kw_srem, kw_frem, kw_shl, kw_lshr, kw_ashr,
|
2009-07-08 05:04:38 +02:00
|
|
|
kw_and, kw_or, kw_xor, kw_icmp, kw_fcmp,
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01: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 23:46:48 +01:00
|
|
|
|
2009-10-28 01:19:10 +01:00
|
|
|
kw_ret, kw_br, kw_switch, kw_indirectbr, kw_invoke, kw_unwind,
|
|
|
|
kw_unreachable,
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
kw_malloc, kw_alloca, kw_free, kw_load, kw_store, kw_getelementptr,
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
kw_extractelement, kw_insertelement, kw_shufflevector, kw_getresult,
|
2009-10-28 04:39:23 +01:00
|
|
|
kw_extractvalue, kw_insertvalue, kw_blockaddress,
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
// Unsigned Valued tokens (UIntVal).
|
|
|
|
GlobalID, // @42
|
|
|
|
LocalVarID, // %42
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
// String valued tokens (StrVal).
|
|
|
|
LabelStr, // foo:
|
|
|
|
GlobalVar, // @foo @"foo"
|
|
|
|
LocalVar, // %foo %"foo"
|
2009-12-30 06:02:06 +01:00
|
|
|
MetadataVar, // !foo
|
2009-01-02 08:01:27 +01:00
|
|
|
StringConstant, // "foo"
|
2009-01-02 23:46:48 +01:00
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
// Type valued tokens (TyVal).
|
2009-01-02 23:46:48 +01:00
|
|
|
Type,
|
|
|
|
|
2009-01-02 08:01:27 +01:00
|
|
|
APFloat, // APFloatVal
|
2009-01-02 17:32:55 +01:00
|
|
|
APSInt // APSInt
|
2009-01-02 08:01:27 +01:00
|
|
|
};
|
|
|
|
} // end namespace lltok
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|