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

via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 12 18:40:13 PDT 2025


Author: Jim Lin
Date: 2025-10-13T09:40:08+08:00
New Revision: 5a76e14b04577232eef0fb4856c505fc6f571551

URL: https://github.com/llvm/llvm-project/commit/5a76e14b04577232eef0fb4856c505fc6f571551
DIFF: https://github.com/llvm/llvm-project/commit/5a76e14b04577232eef0fb4856c505fc6f571551.diff

LOG: [Utils][vim] Match hexadecimal constants with u or s prefixes (#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.

Added: 
    

Modified: 
    llvm/utils/vim/syntax/llvm.vim

Removed: 
    


################################################################################
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