xref: /llvm-project/llvm/utils/vim/syntax/machine-ir.vim (revision ed7638a34d32ee427f75c6ca1ef0a9e8661b847d)
1" Vim syntax file
2" Language:   mir
3" Maintainer: The LLVM team, http://llvm.org/
4" Version:      $Revision$
5
6syn case match
7
8" FIXME: MIR doesn't actually match LLVM IR. Stop including it all as a
9" fallback once enough is implemented.
10" See the MIR LangRef: https://llvm.org/docs/MIRLangRef.html
11unlet b:current_syntax  " Unlet so that the LLVM syntax will load
12runtime! syntax/llvm.vim
13unlet b:current_syntax
14
15syn match   mirType /\<[sp]\d\+\>/
16
17" Opcodes. Matching instead of listing them because individual targets can add
18" these. FIXME: Maybe use some more context to make this more accurate?
19syn match   mirStatement /\<[A-Z][A-Za-z0-9_]*\>/
20
21syn match   mirPReg /$[-a-zA-Z$._][-a-zA-Z$._0-9]*/
22
23if version >= 508 || !exists("did_c_syn_inits")
24  if version < 508
25    let did_c_syn_inits = 1
26    command -nargs=+ HiLink hi link <args>
27  else
28    command -nargs=+ HiLink hi def link <args>
29  endif
30
31  HiLink mirType Type
32  HiLink mirStatement Statement
33  HiLink mirPReg Identifier
34
35  delcommand HiLink
36endif
37
38let b:current_syntax = "mir"
39