3 " Maintainer: The LLVM team, http://llvm.org/
8 elseif exists("b:current_syntax")
15 " Types also include struct, array, vector, etc. but these don't
16 " benefit as much from having dedicated highlighting rules.
17 syn keyword llvmType void float double
18 syn keyword llvmType x86_fp80 fp128 ppc_fp128
19 syn keyword llvmType type label opaque
20 syn match llvmType /\<i\d\+\>/
23 " The true and false tokens can be used for comparison opcodes, but it's
24 " much more common for these tokens to be used for boolean constants.
25 syn keyword llvmStatement add fadd sub fsub mul fmul
26 syn keyword llvmStatement sdiv udiv fdiv srem urem frem
27 syn keyword llvmStatement and or xor
28 syn keyword llvmStatement icmp fcmp
29 syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle
30 syn keyword llvmStatement oeq ogt oge olt ole one ord ueq ugt uge
31 syn keyword llvmStatement ult ule une uno
32 syn keyword llvmStatement nuw nsw exact inbounds
33 syn keyword llvmStatement phi call select shl lshr ashr va_arg
34 syn keyword llvmStatement trunc zext sext
35 syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp
36 syn keyword llvmStatement ptrtoint inttoptr bitcast
37 syn keyword llvmStatement ret br switch invoke unwind unreachable
38 syn keyword llvmStatement malloc alloca free load store getelementptr
39 syn keyword llvmStatement extractelement insertelement shufflevector
40 syn keyword llvmStatement extractvalue insertvalue
43 syn keyword llvmKeyword define declare global constant
44 syn keyword llvmKeyword internal external private
45 syn keyword llvmKeyword linkonce linkonce_odr weak weak_odr appending
46 syn keyword llvmKeyword common extern_weak
47 syn keyword llvmKeyword thread_local dllimport dllexport
48 syn keyword llvmKeyword hidden protected default
49 syn keyword llvmKeyword except deplibs
50 syn keyword llvmKeyword volatile fastcc coldcc cc ccc
51 syn keyword llvmKeyword x86_stdcallcc x86_fastcallcc
52 syn keyword llvmKeyword signext zeroext inreg sret nounwind noreturn
53 syn keyword llvmKeyword nocapture byval nest readnone readonly noalias
54 syn keyword llvmKeyword inlinehint noinline alwaysinline optsize ssp sspreq
55 syn keyword llvmKeyword noredzone noimplicitfloat naked
56 syn keyword llvmKeyword module asm align tail to
57 syn keyword llvmKeyword addrspace section alias sideeffect c gc
58 syn keyword llvmKeyword target datalayout triple
61 syn keyword llvmError uninitialized implementation
62 syn keyword llvmError getresult big little endian begin end
65 syn match llvmIgnore /[%@]\d\+\>/
66 syn match llvmNumber /-\?\<\d\+\>/
67 syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
68 syn match llvmFloat /\<0x\x\+\>/
69 syn keyword llvmBoolean true false
70 syn keyword llvmConstant zeroinitializer undef null
71 syn match llvmComment /;.*$/
72 syn region llvmString start=/"/ skip=/\\"/ end=/"/
73 syn match llvmLabel /[\-a-zA-Z\$._0-9]*:/
75 " Syntax-highlight dejagnu test commands.
76 syn match llvmSpecialComment /;\s*RUN:.*$/
77 syn match llvmSpecialComment /;\s*PR\d*\s*$/
78 syn match llvmSpecialComment /;\s*END\.\s*$/
79 syn match llvmSpecialComment /;\s*XFAIL:.*$/
80 syn match llvmSpecialComment /;\s*XTARGET:.*$/
82 if version >= 508 || !exists("did_c_syn_inits")
84 let did_c_syn_inits = 1
85 command -nargs=+ HiLink hi link <args>
87 command -nargs=+ HiLink hi def link <args>
91 HiLink llvmStatement Statement
92 HiLink llvmNumber Number
93 HiLink llvmComment Comment
94 HiLink llvmString String
95 HiLink llvmLabel Label
96 HiLink llvmKeyword Keyword
97 HiLink llvmBoolean Boolean
98 HiLink llvmFloat Float
99 HiLink llvmIgnore Ignore
100 HiLink llvmConstant Constant
101 HiLink llvmSpecialComment SpecialComment
102 HiLink llvmError Error
107 let b:current_syntax = "llvm"