2002-10-07 22:54:48 +00:00
|
|
|
" Vim syntax file
|
2003-06-03 00:56:09 +00:00
|
|
|
" Language: llvm
|
2006-03-14 05:54:52 +00:00
|
|
|
" Maintainer: The LLVM team, http://llvm.org/
|
2003-06-03 00:56:09 +00:00
|
|
|
" Updated: 2003-06-02
|
2002-10-07 22:54:48 +00:00
|
|
|
|
|
|
|
if version < 600
|
|
|
|
syntax clear
|
|
|
|
elseif exists("b:current_syntax")
|
|
|
|
finish
|
|
|
|
endif
|
|
|
|
|
|
|
|
syn case match
|
|
|
|
|
2009-01-04 23:09:38 +00:00
|
|
|
" Types.
|
|
|
|
" Types also include struct, array, vector, etc. but these don't
|
|
|
|
" benefit as much from having dedicated highlighting rules.
|
2008-01-29 12:35:50 +00:00
|
|
|
syn keyword llvmType void float double
|
|
|
|
syn keyword llvmType x86_fp80 fp128 ppc_fp128
|
2002-10-07 22:54:48 +00:00
|
|
|
syn keyword llvmType type label opaque
|
2008-01-29 12:35:50 +00:00
|
|
|
syn match llvmType /\<i\d\+\>/
|
2002-10-07 22:54:48 +00:00
|
|
|
|
2009-01-04 23:09:38 +00: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.
|
2008-01-29 12:35:50 +00:00
|
|
|
syn keyword llvmStatement add sub mul sdiv udiv fdiv srem urem frem
|
2002-10-07 22:54:48 +00:00
|
|
|
syn keyword llvmStatement and or xor
|
2008-01-29 12:35:50 +00:00
|
|
|
syn keyword llvmStatement icmp fcmp
|
|
|
|
syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle
|
2009-01-04 23:09:38 +00:00
|
|
|
syn keyword llvmStatement oeq ogt oge olt ole one ord ueq ugt uge
|
|
|
|
syn keyword llvmStatement ult ule une uno
|
|
|
|
syn keyword llvmStatement phi call select shl lshr ashr va_arg
|
2008-01-29 12:35:50 +00:00
|
|
|
syn keyword llvmStatement trunc zext sext
|
|
|
|
syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp
|
|
|
|
syn keyword llvmStatement ptrtoint inttoptr bitcast
|
2004-10-16 18:24:35 +00:00
|
|
|
syn keyword llvmStatement ret br switch invoke unwind unreachable
|
2002-10-07 22:54:48 +00:00
|
|
|
syn keyword llvmStatement malloc alloca free load store getelementptr
|
2008-01-29 12:35:50 +00:00
|
|
|
syn keyword llvmStatement extractelement insertelement shufflevector
|
2009-01-04 23:09:38 +00:00
|
|
|
syn keyword llvmStatement extractvalue insertvalue
|
|
|
|
|
|
|
|
" Keywords.
|
|
|
|
syn keyword llvmKeyword define declare global constant
|
|
|
|
syn keyword llvmKeyword internal external
|
|
|
|
syn keyword llvmKeyword linkonce weak appending common extern_weak
|
|
|
|
syn keyword llvmKeyword thread_local dllimport dllexport
|
|
|
|
syn keyword llvmKeyword hidden protected
|
|
|
|
syn keyword llvmKeyword except deplibs
|
|
|
|
syn keyword llvmKeyword volatile fastcc coldcc cc ccc
|
|
|
|
syn keyword llvmKeyword x86_stdcallcc x86_fastcallcc
|
|
|
|
syn keyword llvmKeyword signext zeroext inreg sret nounwind noreturn
|
|
|
|
syn keyword llvmKeyword nocapture byval nest readnone readonly
|
|
|
|
syn keyword llvmKeyword noinline alwaysinline optsize ssp sspreq
|
|
|
|
syn keyword llvmKeyword module asm align tail to
|
2009-01-05 03:22:02 +00:00
|
|
|
syn keyword llvmKeyword addrspace section alias sideeffect c gc
|
2009-01-04 23:09:38 +00:00
|
|
|
syn keyword llvmKeyword target datalayout triple
|
2002-10-07 22:54:48 +00:00
|
|
|
|
2009-01-04 23:09:38 +00:00
|
|
|
" Obsolete keywords.
|
|
|
|
syn keyword llvmError uninitialized implementation
|
2009-01-05 03:22:02 +00:00
|
|
|
syn keyword llvmError getresult big little endian begin end
|
2002-10-07 22:54:48 +00:00
|
|
|
|
2009-01-04 23:09:38 +00:00
|
|
|
" Misc syntax.
|
|
|
|
syn match llvmIgnore /[%@]\d\+\>/
|
|
|
|
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=/"/
|
|
|
|
syn match llvmLabel /[\-a-zA-Z\$._0-9]*:/
|
2002-10-07 22:54:48 +00:00
|
|
|
|
2009-01-04 23:09:38 +00: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:.*$/
|
|
|
|
syn match llvmSpecialComment /;\s*XTARGET:.*$/
|
2002-10-07 22:54:48 +00: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-04 23:09:38 +00:00
|
|
|
HiLink llvmKeyword Keyword
|
|
|
|
HiLink llvmBoolean Boolean
|
|
|
|
HiLink llvmFloat Float
|
|
|
|
HiLink llvmIgnore Ignore
|
|
|
|
HiLink llvmConstant Constant
|
|
|
|
HiLink llvmSpecialComment SpecialComment
|
|
|
|
HiLink llvmError Error
|
2002-10-07 22:54:48 +00:00
|
|
|
|
|
|
|
delcommand HiLink
|
|
|
|
endif
|
2009-01-02 16:26:14 +00:00
|
|
|
|
2002-10-07 22:54:48 +00:00
|
|
|
let b:current_syntax = "llvm"
|