2002-10-08 06:54:48 +08:00
|
|
|
" Vim syntax file
|
2003-06-03 08:56:09 +08:00
|
|
|
" Language: llvm
|
2006-03-14 13:54:52 +08:00
|
|
|
" Maintainer: The LLVM team, http://llvm.org/
|
2010-02-27 05:38:04 +08:00
|
|
|
" Version: $Revision$
|
2002-10-08 06:54:48 +08:00
|
|
|
|
|
|
|
if version < 600
|
|
|
|
syntax clear
|
|
|
|
elseif exists("b:current_syntax")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
syn case match
|
|
|
|
|
2009-01-05 07:09:38 +08:00
|
|
|
" Types.
|
|
|
|
" Types also include struct, array, vector, etc. but these don't
|
|
|
|
" benefit as much from having dedicated highlighting rules.
|
2012-12-03 00:40:38 +08:00
|
|
|
syn keyword llvmType void half float double x86_fp80 fp128 ppc_fp128
|
|
|
|
syn keyword llvmType label metadata x86_mmx
|
2002-10-08 06:54:48 +08:00
|
|
|
syn keyword llvmType type label opaque
|
2008-01-29 20:35:50 +08:00
|
|
|
syn match llvmType /\<i\d\+\>/
|
2002-10-08 06:54:48 +08:00
|
|
|
|
2009-01-05 07:09:38 +08:00
|
|
|
" Instructions.
|
|
|
|
" The true and false tokens can be used for comparison opcodes, but it's
|
|
|
|
" much more common for these tokens to be used for boolean constants.
|
2013-11-15 09:34:59 +08:00
|
|
|
syn keyword llvmStatement add addrspacecast alloca and arcp ashr atomicrmw
|
|
|
|
syn keyword llvmStatement bitcast br call cmpxchg eq exact extractelement
|
|
|
|
syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fpext
|
|
|
|
syn keyword llvmStatement fptosi fptoui fptrunc free frem fsub getelementptr
|
|
|
|
syn keyword llvmStatement icmp inbounds indirectbr insertelement insertvalue
|
|
|
|
syn keyword llvmStatement inttoptr invoke landingpad load lshr malloc max min
|
|
|
|
syn keyword llvmStatement mul nand ne ninf nnan nsw nsz nuw oeq oge ogt ole
|
|
|
|
syn keyword llvmStatement olt one or ord phi ptrtoint resume ret sdiv select
|
|
|
|
syn keyword llvmStatement sext sge sgt shl shufflevector sitofp sle slt srem
|
|
|
|
syn keyword llvmStatement store sub switch trunc udiv ueq uge ugt uitofp ule ult
|
|
|
|
syn keyword llvmStatement umax umin une uno unreachable unwind urem va_arg
|
|
|
|
syn keyword llvmStatement xchg xor zext
|
2009-01-05 07:09:38 +08:00
|
|
|
|
|
|
|
" Keywords.
|
2013-02-26 14:58:09 +08:00
|
|
|
syn keyword llvmKeyword acq_rel acquire sanitize_address addrspace alias align
|
2012-12-03 00:40:38 +08:00
|
|
|
syn keyword llvmKeyword alignstack alwaysinline appending arm_aapcs_vfpcc
|
|
|
|
syn keyword llvmKeyword arm_aapcscc arm_apcscc asm atomic available_externally
|
|
|
|
syn keyword llvmKeyword blockaddress byval c catch cc ccc cleanup coldcc common
|
|
|
|
syn keyword llvmKeyword constant datalayout declare default define deplibs
|
|
|
|
syn keyword llvmKeyword dllexport dllimport except extern_weak external fastcc
|
|
|
|
syn keyword llvmKeyword filter gc global hidden initialexec inlinehint inreg
|
|
|
|
syn keyword llvmKeyword intel_ocl_bicc inteldialect internal linker_private
|
2013-11-02 01:09:14 +08:00
|
|
|
syn keyword llvmKeyword linker_private_weak
|
|
|
|
syn keyword llvmKeyword linkonce linkonce_odr
|
2012-12-03 00:40:38 +08:00
|
|
|
syn keyword llvmKeyword localdynamic localexec minsize module monotonic
|
|
|
|
syn keyword llvmKeyword msp430_intrcc naked nest noalias nocapture
|
|
|
|
syn keyword llvmKeyword noimplicitfloat noinline nonlazybind noredzone noreturn
|
2013-08-23 19:53:55 +08:00
|
|
|
syn keyword llvmKeyword nounwind optnone optsize personality private protected
|
2012-12-03 00:40:38 +08:00
|
|
|
syn keyword llvmKeyword ptx_device ptx_kernel readnone readonly release
|
2013-07-12 14:02:35 +08:00
|
|
|
syn keyword llvmKeyword returns_twice sanitize_thread sanitize_memory
|
|
|
|
syn keyword llvmKeyword section seq_cst sideeffect signext singlethread
|
|
|
|
syn keyword llvmKeyword spir_func spir_kernel sret ssp sspreq sspstrong
|
|
|
|
syn keyword llvmKeyword tail target thread_local to triple unnamed_addr
|
|
|
|
syn keyword llvmKeyword unordered uwtable volatile weak weak_odr
|
|
|
|
syn keyword llvmKeyword x86_fastcallcc x86_stdcallcc x86_thiscallcc x86_64_sysvcc
|
|
|
|
syn keyword llvmKeyword x86_64_win64cc zeroext
|
2002-10-08 06:54:48 +08:00
|
|
|
|
2009-01-05 07:09:38 +08:00
|
|
|
" Obsolete keywords.
|
2010-08-29 04:14:05 +08:00
|
|
|
syn keyword llvmError getresult begin end
|
2002-10-08 06:54:48 +08:00
|
|
|
|
2009-01-05 07:09:38 +08:00
|
|
|
" Misc syntax.
|
2010-07-30 01:57:57 +08:00
|
|
|
syn match llvmNoName /[%@]\d\+\>/
|
2009-01-05 07:09:38 +08:00
|
|
|
syn match llvmNumber /-\?\<\d\+\>/
|
|
|
|
syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
|
|
|
|
syn match llvmFloat /\<0x\x\+\>/
|
|
|
|
syn keyword llvmBoolean true false
|
|
|
|
syn keyword llvmConstant zeroinitializer undef null
|
|
|
|
syn match llvmComment /;.*$/
|
|
|
|
syn region llvmString start=/"/ skip=/\\"/ end=/"/
|
2010-01-10 01:22:48 +08:00
|
|
|
syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
|
|
|
|
syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/
|
2002-10-08 06:54:48 +08:00
|
|
|
|
2009-01-05 07:09:38 +08:00
|
|
|
" Syntax-highlight dejagnu test commands.
|
|
|
|
syn match llvmSpecialComment /;\s*RUN:.*$/
|
|
|
|
syn match llvmSpecialComment /;\s*PR\d*\s*$/
|
|
|
|
syn match llvmSpecialComment /;\s*END\.\s*$/
|
|
|
|
syn match llvmSpecialComment /;\s*XFAIL:.*$/
|
2002-10-08 06:54:48 +08:00
|
|
|
|
|
|
|
if version >= 508 || !exists("did_c_syn_inits")
|
|
|
|
if version < 508
|
|
|
|
let did_c_syn_inits = 1
|
|
|
|
command -nargs=+ HiLink hi link <args>
|
|
|
|
else
|
|
|
|
command -nargs=+ HiLink hi def link <args>
|
|
|
|
endif
|
|
|
|
|
|
|
|
HiLink llvmType Type
|
|
|
|
HiLink llvmStatement Statement
|
|
|
|
HiLink llvmNumber Number
|
|
|
|
HiLink llvmComment Comment
|
|
|
|
HiLink llvmString String
|
|
|
|
HiLink llvmLabel Label
|
2009-01-05 07:09:38 +08:00
|
|
|
HiLink llvmKeyword Keyword
|
|
|
|
HiLink llvmBoolean Boolean
|
|
|
|
HiLink llvmFloat Float
|
2010-07-30 01:57:57 +08:00
|
|
|
HiLink llvmNoName Identifier
|
2009-01-05 07:09:38 +08:00
|
|
|
HiLink llvmConstant Constant
|
|
|
|
HiLink llvmSpecialComment SpecialComment
|
|
|
|
HiLink llvmError Error
|
2010-01-10 01:22:48 +08:00
|
|
|
HiLink llvmIdentifier Identifier
|
2002-10-08 06:54:48 +08:00
|
|
|
|
|
|
|
delcommand HiLink
|
|
|
|
endif
|
2009-01-03 00:26:14 +08:00
|
|
|
|
2002-10-08 06:54:48 +08:00
|
|
|
let b:current_syntax = "llvm"
|