[llvm] [RemoveDIs] Update syntax highlighting to include debug records (PR #93660)
Stephen Tozer via llvm-commits
llvm-commits at lists.llvm.org
Wed May 29 02:55:57 PDT 2024
https://github.com/SLTozer created https://github.com/llvm/llvm-project/pull/93660
This patch updates the vim and vscode syntax highlighters to recognize debug records. I wasn't able to build the vscode extensions locally, so I've only tested this pattern by checking that the pattern works in vscode search.
>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] [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|\
More information about the llvm-commits
mailing list