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 bfloat float double x86_fp80 fp128 ppc_fp128
18 syn keyword llvmType label metadata x86_mmx x86_amx
19 syn keyword llvmType type label opaque token ptr
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 fneg fpext
29 syn keyword llvmStatement fptosi fptoui fptrunc free freeze frem fsub
30 syn keyword llvmStatement getelementptr icmp inbounds indirectbr insertelement
31 syn keyword llvmStatement insertvalue inttoptr invoke landingpad load lshr
32 syn keyword llvmStatement malloc max min mul nand ne ninf nnan nsw nsz nuw oeq
33 syn keyword llvmStatement oge ogt ole olt one or ord phi ptrtoint resume ret
34 syn keyword llvmStatement sdiv select sext sge sgt shl shufflevector sitofp
35 syn keyword llvmStatement sle slt srem store sub switch trunc udiv ueq uge ugt
36 syn keyword llvmStatement uitofp ule ult umax umin une uno unreachable unwind
37 syn keyword llvmStatement urem va_arg xchg xor zext
40 syn keyword llvmKeyword
56 \ available_externally
79 \ dereferenceable_or_null
88 \ externally_initialized
99 \ inaccessiblemem_or_argmemonly
100 \ inaccessiblememonly
141 \ nosanitize_coverage
142 \ null_pointer_is_valid
170 \ speculative_load_hardening
208 syn keyword llvmError getresult begin end
211 syn match llvmNoName /[%@!]\d\+\>/
212 syn match llvmNumber /-\?\<\d\+\>/
213 syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
214 syn match llvmFloat /\<0x\x\+\>/
215 syn keyword llvmBoolean true false
216 syn keyword llvmConstant zeroinitializer undef null none poison vscale
217 syn match llvmComment /;.*$/
218 syn region llvmString start=/"/ skip=/\\"/ end=/"/
219 syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
220 syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/
222 " Named metadata and specialized metadata keywords.
223 syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*$/
224 syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*[=!]/
225 syn match llvmType /!\zs\a\+\ze\s*(/
226 syn match llvmConstant /\<DW_TAG_[a-z_]\+\>/
227 syn match llvmConstant /\<DW_ATE_[a-zA-Z_]\+\>/
228 syn match llvmConstant /\<DW_OP_[a-zA-Z0-9_]\+\>/
229 syn match llvmConstant /\<DW_LANG_[a-zA-Z0-9_]\+\>/
230 syn match llvmConstant /\<DW_VIRTUALITY_[a-z_]\+\>/
231 syn match llvmConstant /\<DIFlag[A-Za-z]\+\>/
233 " Syntax-highlight lit test commands and bug numbers.
234 syn match llvmSpecialComment /;\s*PR\d*\s*$/
235 syn match llvmSpecialComment /;\s*REQUIRES:.*$/
236 syn match llvmSpecialComment /;\s*RUN:.*$/
237 syn match llvmSpecialComment /;\s*ALLOW_RETRIES:.*$/
238 syn match llvmSpecialComment /;\s*CHECK:.*$/
239 syn match llvmSpecialComment /;\s*CHECK-EMPTY:\s*$/
240 syn match llvmSpecialComment /\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL|COUNT-\d+):.*$/
241 syn match llvmSpecialComment /;\s*XFAIL:.*$/
243 if version >= 508 || !exists("did_c_syn_inits")
245 let did_c_syn_inits = 1
246 command -nargs=+ HiLink hi link <args>
248 command -nargs=+ HiLink hi def link <args>
252 HiLink llvmStatement Statement
253 HiLink llvmNumber Number
254 HiLink llvmComment Comment
255 HiLink llvmString String
256 HiLink llvmLabel Label
257 HiLink llvmKeyword Keyword
258 HiLink llvmBoolean Boolean
259 HiLink llvmFloat Float
260 HiLink llvmNoName Identifier
261 HiLink llvmConstant Constant
262 HiLink llvmSpecialComment SpecialComment
263 HiLink llvmError Error
264 HiLink llvmIdentifier Identifier
269 let b:current_syntax = "llvm"