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