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 sub mul sdiv udiv fdiv srem urem frem
26 syn keyword llvmStatement and or xor
27 syn keyword llvmStatement icmp fcmp
28 syn keyword llvmStatement eq ne ugt uge ult ule sgt sge slt sle
29 syn keyword llvmStatement oeq ogt oge olt ole one ord ueq ugt uge
30 syn keyword llvmStatement ult ule une uno
31 syn keyword llvmStatement phi call select shl lshr ashr va_arg
32 syn keyword llvmStatement trunc zext sext
33 syn keyword llvmStatement fptrunc fpext fptoui fptosi uitofp sitofp
34 syn keyword llvmStatement ptrtoint inttoptr bitcast
35 syn keyword llvmStatement ret br switch invoke unwind unreachable
36 syn keyword llvmStatement malloc alloca free load store getelementptr
37 syn keyword llvmStatement extractelement insertelement shufflevector
38 syn keyword llvmStatement extractvalue insertvalue
41 syn keyword llvmKeyword define declare global constant
42 syn keyword llvmKeyword internal external
43 syn keyword llvmKeyword linkonce linkonce_odr weak weak_odr appending
44 syn keyword llvmKeyword common extern_weak
45 syn keyword llvmKeyword thread_local dllimport dllexport
46 syn keyword llvmKeyword hidden protected default
47 syn keyword llvmKeyword except deplibs
48 syn keyword llvmKeyword volatile fastcc coldcc cc ccc
49 syn keyword llvmKeyword x86_stdcallcc x86_fastcallcc
50 syn keyword llvmKeyword signext zeroext inreg sret nounwind noreturn
51 syn keyword llvmKeyword nocapture byval nest readnone readonly
52 syn keyword llvmKeyword noinline alwaysinline optsize ssp sspreq
53 syn keyword llvmKeyword module asm align tail to
54 syn keyword llvmKeyword addrspace section alias sideeffect c gc
55 syn keyword llvmKeyword target datalayout triple
58 syn keyword llvmError uninitialized implementation
59 syn keyword llvmError getresult big little endian begin end
62 syn match llvmIgnore /[%@]\d\+\>/
63 syn match llvmNumber /-\?\<\d\+\>/
64 syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
65 syn match llvmFloat /\<0x\x\+\>/
66 syn keyword llvmBoolean true false
67 syn keyword llvmConstant zeroinitializer undef null
68 syn match llvmComment /;.*$/
69 syn region llvmString start=/"/ skip=/\\"/ end=/"/
70 syn match llvmLabel /[\-a-zA-Z\$._0-9]*:/
72 " Syntax-highlight dejagnu test commands.
73 syn match llvmSpecialComment /;\s*RUN:.*$/
74 syn match llvmSpecialComment /;\s*PR\d*\s*$/
75 syn match llvmSpecialComment /;\s*END\.\s*$/
76 syn match llvmSpecialComment /;\s*XFAIL:.*$/
77 syn match llvmSpecialComment /;\s*XTARGET:.*$/
79 if version >= 508 || !exists("did_c_syn_inits")
81 let did_c_syn_inits = 1
82 command -nargs=+ HiLink hi link <args>
84 command -nargs=+ HiLink hi def link <args>
88 HiLink llvmStatement Statement
89 HiLink llvmNumber Number
90 HiLink llvmComment Comment
91 HiLink llvmString String
92 HiLink llvmLabel Label
93 HiLink llvmKeyword Keyword
94 HiLink llvmBoolean Boolean
95 HiLink llvmFloat Float
96 HiLink llvmIgnore Ignore
97 HiLink llvmConstant Constant
98 HiLink llvmSpecialComment SpecialComment
99 HiLink llvmError Error
104 let b:current_syntax = "llvm"