Skip to content

Commit 2705c60

Browse files
authored
[RemoveDIs] Update syntax highlighting to include debug records (#93660)
This patch updates the emacs, vim, and vscode syntax highlighters to recognize debug records.
1 parent 22c572e commit 2705c60

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

llvm/utils/emacs/llvm-mode.el

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
`(,(regexp-opt '("extractvalue" "insertvalue") 'symbols) . font-lock-keyword-face)
8888
;; Metadata types
8989
`(,(regexp-opt '("distinct") 'symbols) . font-lock-keyword-face)
90+
;; Debug records
91+
`(,(concat "#" (regexp-opt '("dbg_assign" "dbg_declare" "dbg_label" "dbg_value") 'symbols)) . font-lock-keyword-face)
9092
;; Atomic memory ordering constraints
9193
`(,(regexp-opt '("unordered" "monotonic" "acquire" "release" "acq_rel" "seq_cst") 'symbols) . font-lock-keyword-face)
9294
;; Fast-math flags

llvm/utils/vim/syntax/llvm.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ syn keyword llvmStatement sle slt srem store sub switch trunc udiv ueq uge ugt
3636
syn keyword llvmStatement uitofp ule ult umax umin une uno unreachable unwind
3737
syn keyword llvmStatement urem va_arg xchg xor zext
3838

39+
" Debug records.
40+
syn match llvmStatement /\v#dbg_(assign|declare|label|value)/
41+
3942
" Keywords.
4043
syn keyword llvmKeyword
4144
\ acq_rel

llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ patterns:
3434
captures:
3535
1:
3636
name: storage.type.llvm
37-
- match: "\\badd\\b|\
37+
- match: "(?<=\\s|^)#dbg_(assign|declare|label|value)\\b|\
38+
\\badd\\b|\
3839
\\baddrspacecast\\b|\
3940
\\balloca\\b|\
4041
\\band\\b|\

0 commit comments

Comments
 (0)