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 half float double x86_fp80 fp128 ppc_fp128
18 syn keyword llvmType label metadata x86_mmx
19 syn keyword llvmType type label opaque token
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 addrspacecast alloca and arcp ashr atomicrmw
26 syn keyword llvmStatement bitcast br catchpad catchswitch catchret call callbr
27 syn keyword llvmStatement cleanuppad cleanupret cmpxchg eq exact extractelement
28 syn keyword llvmStatement extractvalue fadd fast fcmp fdiv fence fmul fpext
29 syn keyword llvmStatement fptosi fptoui fptrunc free frem fsub fneg getelementptr
30 syn keyword llvmStatement icmp inbounds indirectbr insertelement insertvalue
31 syn keyword llvmStatement inttoptr invoke landingpad load lshr malloc max min
32 syn keyword llvmStatement mul nand ne ninf nnan nsw nsz nuw oeq oge ogt ole
33 syn keyword llvmStatement olt one or ord phi ptrtoint resume ret sdiv select
34 syn keyword llvmStatement sext sge sgt shl shufflevector sitofp sle slt srem
35 syn keyword llvmStatement store sub switch trunc udiv ueq uge ugt uitofp ule ult
36 syn keyword llvmStatement umax umin une uno unreachable unwind urem va_arg
37 syn keyword llvmStatement xchg xor zext
40 syn keyword llvmKeyword
55 \ available_externally
82 \ externally_initialized
176 syn keyword llvmError getresult begin end
179 syn match llvmNoName /[%@!]\d\+\>/
180 syn match llvmNumber /-\?\<\d\+\>/
181 syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
182 syn match llvmFloat /\<0x\x\+\>/
183 syn keyword llvmBoolean true false
184 syn keyword llvmConstant zeroinitializer undef null none
185 syn match llvmComment /;.*$/
186 syn region llvmString start=/"/ skip=/\\"/ end=/"/
187 syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
188 syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/
190 " Named metadata and specialized metadata keywords.
191 syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*$/
192 syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*[=!]/
193 syn match llvmType /!\zs\a\+\ze\s*(/
194 syn match llvmConstant /\<DW_TAG_[a-z_]\+\>/
195 syn match llvmConstant /\<DW_ATE_[a-zA-Z_]\+\>/
196 syn match llvmConstant /\<DW_OP_[a-zA-Z0-9_]\+\>/
197 syn match llvmConstant /\<DW_LANG_[a-zA-Z0-9_]\+\>/
198 syn match llvmConstant /\<DW_VIRTUALITY_[a-z_]\+\>/
199 syn match llvmConstant /\<DIFlag[A-Za-z]\+\>/
201 " Syntax-highlight lit test commands and bug numbers.
202 syn match llvmSpecialComment /;\s*PR\d*\s*$/
203 syn match llvmSpecialComment /;\s*REQUIRES:.*$/
204 syn match llvmSpecialComment /;\s*RUN:.*$/
205 syn match llvmSpecialComment /;\s*CHECK:.*$/
206 syn match llvmSpecialComment "\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL):.*$"
207 syn match llvmSpecialComment /;\s*XFAIL:.*$/
209 if version >= 508 || !exists("did_c_syn_inits")
211 let did_c_syn_inits = 1
212 command -nargs=+ HiLink hi link <args>
214 command -nargs=+ HiLink hi def link <args>
218 HiLink llvmStatement Statement
219 HiLink llvmNumber Number
220 HiLink llvmComment Comment
221 HiLink llvmString String
222 HiLink llvmLabel Label
223 HiLink llvmKeyword Keyword
224 HiLink llvmBoolean Boolean
225 HiLink llvmFloat Float
226 HiLink llvmNoName Identifier
227 HiLink llvmConstant Constant
228 HiLink llvmSpecialComment SpecialComment
229 HiLink llvmError Error
230 HiLink llvmIdentifier Identifier
235 let b:current_syntax = "llvm"