[llvm] [Utils][vim] Match hexadecimal constants with u or s prefixes (PR #162613)

Jim Lin via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 9 01:36:36 PDT 2025


https://github.com/tclin914 created https://github.com/llvm/llvm-project/pull/162613

We can add 's' or 'u' before the hexadecimal constants to denote its signedness.

See https://llvm.org/docs/LangRef.html#simple-constants for reference.

>From d969eceba777641c806408e95230dc8a50121060 Mon Sep 17 00:00:00 2001
From: Jim Lin <jim at andestech.com>
Date: Thu, 9 Oct 2025 16:20:58 +0800
Subject: [PATCH] [Utils][vim] Match hexadecimal constants with u or s prefixes

We can add 's' or 'u' before the hexadecimal constants to denote its
signedness.

See https://llvm.org/docs/LangRef.html#simple-constants for reference.
---
 llvm/utils/vim/syntax/llvm.vim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/utils/vim/syntax/llvm.vim b/llvm/utils/vim/syntax/llvm.vim
index e048caa20406a..cbff478d4bf09 100644
--- a/llvm/utils/vim/syntax/llvm.vim
+++ b/llvm/utils/vim/syntax/llvm.vim
@@ -220,7 +220,7 @@ syn keyword llvmError  getresult begin end
 syn match   llvmNoName /[%@!]\d\+\>/
 syn match   llvmNumber /-\?\<\d\+\>/
 syn match   llvmFloat  /-\?\<\d\+\.\d*\(e[+-]\d\+\)\?\>/
-syn match   llvmFloat  /\<0x[KLMHR]\?\x\+\>/
+syn match   llvmFloat  /\<\(u\|s\)\?0x[KLMHR]\?\x\+\>/
 syn keyword llvmBoolean true false
 syn keyword llvmConstant zeroinitializer undef null none poison vscale
 syn match   llvmComment /;.*$/



More information about the llvm-commits mailing list