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
143 \ nosanitize_coverage
144 \ null_pointer_is_valid
173 \ speculative_load_hardening
211 syn keyword llvmError getresult begin end
214 syn match llvmNoName /[%@!]\d\+\>/
215 syn match llvmNumber /-\?\<\d\+\>/
216 syn match llvmFloat /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
217 syn match llvmFloat /\<0x\x\+\>/
218 syn keyword llvmBoolean true false
219 syn keyword llvmConstant zeroinitializer undef null none poison vscale
220 syn match llvmComment /;.*$/
221 syn region llvmString start=/"/ skip=/\\"/ end=/"/
222 syn match llvmLabel /[-a-zA-Z$._][-a-zA-Z$._0-9]*:/
223 syn match llvmIdentifier /[%@][-a-zA-Z$._][-a-zA-Z$._0-9]*/
225 " Named metadata and specialized metadata keywords.
226 syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*$/
227 syn match llvmIdentifier /![-a-zA-Z$._][-a-zA-Z$._0-9]*\ze\s*[=!]/
228 syn match llvmType /!\zs\a\+\ze\s*(/
229 syn match llvmConstant /\<DW_TAG_[a-z_]\+\>/
230 syn match llvmConstant /\<DW_ATE_[a-zA-Z_]\+\>/
231 syn match llvmConstant /\<DW_OP_[a-zA-Z0-9_]\+\>/
232 syn match llvmConstant /\<DW_LANG_[a-zA-Z0-9_]\+\>/
233 syn match llvmConstant /\<DW_VIRTUALITY_[a-z_]\+\>/
234 syn match llvmConstant /\<DIFlag[A-Za-z]\+\>/
236 " Syntax-highlight lit test commands and bug numbers.
237 syn match llvmSpecialComment /;\s*PR\d*\s*$/
238 syn match llvmSpecialComment /;\s*REQUIRES:.*$/
239 syn match llvmSpecialComment /;\s*RUN:.*$/
240 syn match llvmSpecialComment /;\s*ALLOW_RETRIES:.*$/
241 syn match llvmSpecialComment /;\s*CHECK:.*$/
242 syn match llvmSpecialComment /;\s*CHECK-EMPTY:\s*$/
243 syn match llvmSpecialComment /\v;\s*CHECK-(NEXT|NOT|DAG|SAME|LABEL|COUNT-\d+):.*$/
244 syn match llvmSpecialComment /;\s*XFAIL:.*$/
246 if version >= 508 || !exists("did_c_syn_inits")
248 let did_c_syn_inits = 1
249 command -nargs=+ HiLink hi link <args>
251 command -nargs=+ HiLink hi def link <args>
255 HiLink llvmStatement Statement
256 HiLink llvmNumber Number
257 HiLink llvmComment Comment
258 HiLink llvmString String
259 HiLink llvmLabel Label
260 HiLink llvmKeyword Keyword
261 HiLink llvmBoolean Boolean
262 HiLink llvmFloat Float
263 HiLink llvmNoName Identifier
264 HiLink llvmConstant Constant
265 HiLink llvmSpecialComment SpecialComment
266 HiLink llvmError Error
267 HiLink llvmIdentifier Identifier
272 let b:current_syntax = "llvm"