[llvm] [RemoveDIs] Update syntax highlighting to include debug records (PR #93660)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Thu May 30 02:24:32 PDT 2024
https://github.com/SLTozer updated https://github.com/llvm/llvm-project/pull/93660
>From a76140fb8bd0129f983b272db14fe71d5483bc0b Mon Sep 17 00:00:00 2001
From: Stephen Tozer <stephen.tozer at sony.com>
Date: Wed, 29 May 2024 10:51:07 +0100
Subject: [PATCH 1/3] [RemoveDIs] Update syntax highlighting to include
#dbg_value
---
llvm/utils/vim/syntax/llvm.vim | 3 +++
llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/llvm/utils/vim/syntax/llvm.vim b/llvm/utils/vim/syntax/llvm.vim
index d86e3d1ddbc27..c45391477f2c2 100644
--- a/llvm/utils/vim/syntax/llvm.vim
+++ b/llvm/utils/vim/syntax/llvm.vim
@@ -36,6 +36,9 @@ syn keyword llvmStatement sle slt srem store sub switch trunc udiv ueq uge ugt
syn keyword llvmStatement uitofp ule ult umax umin une uno unreachable unwind
syn keyword llvmStatement urem va_arg xchg xor zext
+" Debug records.
+syn match llvmStatement /\v#dbg_(assign|declare|label|value)/
+
" Keywords.
syn keyword llvmKeyword
\ acq_rel
diff --git a/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml b/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml
index d80c3778bbe78..da07491c9d88d 100644
--- a/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml
+++ b/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml
@@ -34,7 +34,8 @@ patterns:
captures:
1:
name: storage.type.llvm
- - match: "\\badd\\b|\
+ - match: "(?<=\\s|^)#dbg_(assign|declare|label|value)\\b\
+ \\badd\\b|\
\\baddrspacecast\\b|\
\\balloca\\b|\
\\band\\b|\
>From 1153bb5932ea71a52437919245cf3c23f954945d Mon Sep 17 00:00:00 2001
From: Stephen Tozer <stephen.tozer at sony.com>
Date: Thu, 30 May 2024 10:23:16 +0100
Subject: [PATCH 2/3] Add emacs syntax highlighting
---
llvm/utils/emacs/llvm-mode.el | 2 ++
1 file changed, 2 insertions(+)
diff --git a/llvm/utils/emacs/llvm-mode.el b/llvm/utils/emacs/llvm-mode.el
index 5264ea260f57c..e7e3091678df3 100644
--- a/llvm/utils/emacs/llvm-mode.el
+++ b/llvm/utils/emacs/llvm-mode.el
@@ -87,6 +87,8 @@
`(,(regexp-opt '("extractvalue" "insertvalue") 'symbols) . font-lock-keyword-face)
;; Metadata types
`(,(regexp-opt '("distinct") 'symbols) . font-lock-keyword-face)
+ ;; Debug records
+ `(,(concat "#" (regexp-opt '("dbg_assign" "dbg_declare" "dbg_label" "dbg_value") 'symbols)) . font-lock-keyword-face)
;; Atomic memory ordering constraints
`(,(regexp-opt '("unordered" "monotonic" "acquire" "release" "acq_rel" "seq_cst") 'symbols) . font-lock-keyword-face)
;; Fast-math flags
>From ed542e1948e33757347d58eed11a8470c36c172e Mon Sep 17 00:00:00 2001
From: Stephen Tozer <stephen.tozer at sony.com>
Date: Thu, 30 May 2024 10:24:18 +0100
Subject: [PATCH 3/3] Fix VSCode highlighting
---
llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml b/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml
index da07491c9d88d..b64482336f404 100644
--- a/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml
+++ b/llvm/utils/vscode/llvm/syntaxes/ll.tmLanguage.yaml
@@ -34,7 +34,7 @@ patterns:
captures:
1:
name: storage.type.llvm
- - match: "(?<=\\s|^)#dbg_(assign|declare|label|value)\\b\
+ - match: "(?<=\\s|^)#dbg_(assign|declare|label|value)\\b|\
\\badd\\b|\
\\baddrspacecast\\b|\
\\balloca\\b|\
More information about the llvm-commits
mailing list