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
177 syn keyword llvmError getresult begin end
180 syn match llvmNoName /[%@!]\d\+\>/
181 syn match llvmNumber /-\?\<\d\+\>/
182 syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
183 syn match llvmFloat /\<0x\x\+\>/
184 syn keyword llvmBoolean true false
185 syn keyword llvmConstant zeroinitializer undef null none
186 syn match llvmComment /;.*$/
187 syn region llvmString start=/"/ skip=/\\"/ end=/"/
188 syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
189 syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/
191 " Named metadata and specialized metadata keywords.
192 syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*$/
193 syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*[=!]/
194 syn match llvmType /!\zs\a\+\ze\s*(/
195 syn match llvmConstant /\<DW_TAG_[a-z_]\+\>/
196 syn match llvmConstant /\<DW_ATE_[a-zA-Z_]\+\>/
197 syn match llvmConstant /\<DW_OP_[a-zA-Z0-9_]\+\>/
198 syn match llvmConstant /\<DW_LANG_[a-zA-Z0-9_]\+\>/
199 syn match llvmConstant /\<DW_VIRTUALITY_[a-z_]\+\>/
200 syn match llvmConstant /\<DIFlag[A-Za-z]\+\>/
202 " Syntax-highlight lit test commands and bug numbers.
203 syn match llvmSpecialComment /;\s*PR\d*\s*$/
204 syn match llvmSpecialComment /;\s*REQUIRES:.*$/
205 syn match llvmSpecialComment /;\s*RUN:.*$/
206 syn match llvmSpecialComment /;\s*CHECK:.*$/
207 syn match llvmSpecialComment "\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL):.*$"
208 syn match llvmSpecialComment /;\s*XFAIL:.*$/
210 if version >= 508 || !exists("did_c_syn_inits")
212 let did_c_syn_inits = 1
213 command -nargs=+ HiLink hi link <args>
215 command -nargs=+ HiLink hi def link <args>
219 HiLink llvmStatement Statement
220 HiLink llvmNumber Number
221 HiLink llvmComment Comment
222 HiLink llvmString String
223 HiLink llvmLabel Label
224 HiLink llvmKeyword Keyword
225 HiLink llvmBoolean Boolean
226 HiLink llvmFloat Float
227 HiLink llvmNoName Identifier
228 HiLink llvmConstant Constant
229 HiLink llvmSpecialComment SpecialComment
230 HiLink llvmError Error
231 HiLink llvmIdentifier Identifier
236 let b:current_syntax = "llvm"