[RISCV] Regenerate autogen test to remove spurious diff
[llvm-project.git] / llvm / utils / emacs / llvm-mir-mode.el
blob6f1de4252445fcdc442a8675b7ba23810e1a4370
1 ;;; llvm-mir-mode.el --- Major mode for LLVM Machine IR
3 ;; Maintainer: The LLVM team, http://llvm.org/
4 ;; Version: 1.0
6 ;;; Commentary:
8 ;; Major mode for editing LLVM MIR files.
10 ;;; Code:
12 (require 'llvm-mode)
14 (defvar llvm-mir-mode-map
15 (let ((map (make-sparse-keymap)))
16 map)
17 "Keymap for `llvm-mir-mode'.")
19 (defvar llvm-mir-mode-syntax-table
20 (let ((st (make-syntax-table)))
21 (modify-syntax-entry ?% "_" st)
22 (modify-syntax-entry ?$ "_" st)
23 (modify-syntax-entry ?. "_" st)
24 (modify-syntax-entry ?# "< " st)
25 (modify-syntax-entry ?\; "< " st)
26 (modify-syntax-entry ?\n "> " st)
27 st)
28 "Syntax table for `llvm-mir-mode'.")
30 (defvar llvm-mir-font-lock-keywords
31 (append
32 (list
33 ; YAML Attributes
34 '("^name: +\\([a-zA-Z._][-a-zA-Z._0-9]*\\)"
35 1 font-lock-function-name-face)
36 '("^body: +|" . font-lock-keyword-face)
37 '("^[a-zA-Z_.][-a-zA-Z._0-9]*:" . font-lock-keyword-face)
38 `(,(regexp-opt '("true" "false")) . font-lock-constant-face)
39 ; YAML separators
40 '("^\\(---\\( |\\)?\\|\\.\\.\\.\\)$" . font-lock-comment-face)
41 ; Registers
42 '("%[a-zA-Z_.][-a-zA-Z._0-9]*" . font-lock-variable-name-face)
43 '("%[0-9]+\\(\\.[a-zA-Z._0-9]+\\)?" . font-lock-variable-name-face)
44 '("$[a-zA-Z_.][-a-zA-Z._0-9]*" . font-lock-constant-face)
45 ; Register classes
46 `(,(concat
47 "%\\([a-zA-Z_.][-a-zA-Z._0-9]*\\|[0-9]+\\(\\.[a-zA-Z._0-9]+\\)?\\)"
48 "\\(:[a-zA-Z_.][-a-zA-Z._0-9]*\\)")
49 3 font-lock-type-face)
50 '("class: \\([a-zA-Z_.][-a-zA-Z._0-9]*\\)" 1 font-lock-type-face)
51 ; MO Register flags
52 `(,(regexp-opt '("dead" "debug-use" "def" "early-clobber" "implicit"
53 "implicit-def" "internal" "killed" "renamable" "undef")
54 'symbols)
55 . font-lock-keyword-face))
56 llvm-font-lock-keywords)
57 "Keyword highlighting specification for `llvm-mir-mode'.")
59 ;;;###autoload
60 (define-derived-mode llvm-mir-mode prog-mode "LLVM MIR"
61 "A major mode for editing LLVM MIR files."
62 (setq-local comment-start "; ")
63 (setq-local font-lock-defaults `(llvm-mir-font-lock-keywords)))
65 ;;;###autoload
66 (add-to-list 'auto-mode-alist (cons "\\.mir\\'" 'llvm-mir-mode))
68 (provide 'llvm-mir-mode)
70 ;;; llvm-mir-mode.el ends here