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 match llvmStatement /\v#dbg_(assign|declare|label|value)/
43 syn keyword llvmKeyword
59 \ available_externally
82 \ dereferenceable_or_null
91 \ externally_initialized
102 \ inaccessiblemem_or_argmemonly
103 \ inaccessiblememonly
146 \ nosanitize_coverage
147 \ null_pointer_is_valid
177 \ speculative_load_hardening
216 syn keyword llvmError getresult begin end
219 syn match llvmNoName /[%@!]\d\+\>/
220 syn match llvmNumber /-\?\<\d\+\>/
221 syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
222 syn match llvmFloat /\<0x[KLMHR]\?\x\+\>/
223 syn keyword llvmBoolean true false
224 syn keyword llvmConstant zeroinitializer undef null none poison vscale
225 syn match llvmComment /;.*$/
226 syn region llvmString start=/"/ skip=/\\"/ end=/"/
227 syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
228 syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/
230 " Named metadata and specialized metadata keywords.
231 syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*$/
232 syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*[=!]/
233 syn match llvmType /!\zs\a\+\ze\s*(/
234 syn match llvmConstant /\<DW_TAG_[a-z_]\+\>/
235 syn match llvmConstant /\<DW_ATE_[a-zA-Z_]\+\>/
236 syn match llvmConstant /\<DW_OP_[a-zA-Z0-9_]\+\>/
237 syn match llvmConstant /\<DW_LANG_[a-zA-Z0-9_]\+\>/
238 syn match llvmConstant /\<DW_VIRTUALITY_[a-z_]\+\>/
239 syn match llvmConstant /\<DIFlag[A-Za-z]\+\>/
241 " Syntax-highlight lit test commands and bug numbers.
242 syn match llvmSpecialComment /;\s*PR\d*\s*$/
243 syn match llvmSpecialComment /;\s*REQUIRES:.*$/
244 syn match llvmSpecialComment /;\s*RUN:.*$/
245 syn match llvmSpecialComment /;\s*ALLOW_RETRIES:.*$/
246 syn match llvmSpecialComment /;\s*CHECK:.*$/
247 syn match llvmSpecialComment /;\s*CHECK-EMPTY:\s*$/
248 syn match llvmSpecialComment /\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL|COUNT-\d+):.*$/
249 syn match llvmSpecialComment /;\s*XFAIL:.*$/
251 if version >= 508 || !exists("did_c_syn_inits")
253 let did_c_syn_inits = 1
254 command -nargs=+ HiLink hi link <args>
256 command -nargs=+ HiLink hi def link <args>
260 HiLink llvmStatement Statement
261 HiLink llvmNumber Number
262 HiLink llvmComment Comment
263 HiLink llvmString String
264 HiLink llvmLabel Label
265 HiLink llvmKeyword Keyword
266 HiLink llvmBoolean Boolean
267 HiLink llvmFloat Float
268 HiLink llvmNoName Identifier
269 HiLink llvmConstant Constant
270 HiLink llvmSpecialComment SpecialComment
271 HiLink llvmError Error
272 HiLink llvmIdentifier Identifier
277 let b:current_syntax = "llvm"