[llvm] 8431170 - [emacs] More consistently highlight value keywords that appear in vectors (#97594)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 22:29:59 PDT 2024


Author: goldsteinn
Date: 2024-07-04T13:29:56+08:00
New Revision: 843117050d63db6de983d4840ab3786f91c118b3

URL: https://github.com/llvm/llvm-project/commit/843117050d63db6de983d4840ab3786f91c118b3
DIFF: https://github.com/llvm/llvm-project/commit/843117050d63db6de983d4840ab3786f91c118b3.diff

LOG: [emacs] More consistently highlight value keywords that appear in vectors (#97594)

Previously something like `<i8 123, i8 poison>` would not properly
highlight the `poison` keyword at the end.

Added: 
    

Modified: 
    llvm/utils/emacs/llvm-mode.el

Removed: 
    


################################################################################
diff  --git a/llvm/utils/emacs/llvm-mode.el b/llvm/utils/emacs/llvm-mode.el
index 4d7c425780eb8..dab37833ff63a 100644
--- a/llvm/utils/emacs/llvm-mode.el
+++ b/llvm/utils/emacs/llvm-mode.el
@@ -61,6 +61,8 @@
    `(,(concat "\\<" llvm-mode-primitive-type-regexp "\\>") . font-lock-type-face)
    ;; Integer literals
    '("\\b[-]?[0-9]+\\b" . font-lock-preprocessor-face)
+   ;; Values that can appear in a vec
+   '("\\b\\(true\\|false\\|null\\|undef\\|poison\\|none\\)\\b" . font-lock-keyword-face)
    ;; Floating point constants
    '("\\b[-+]?[0-9]+.[0-9]*\\([eE][-+]?[0-9]+\\)?\\b" . font-lock-preprocessor-face)
    ;; Hex constants
@@ -74,7 +76,7 @@
          "private" "internal" "weak" "weak_odr" "linkonce" "linkonce_odr" "available_externally" "appending" "common" "extern_weak" "external"
          "uninitialized" "implementation" "..."
          ;; Values
-         "true" "false" "null" "undef" "zeroinitializer" "none" "c" "asm" "blockaddress" "poison"
+         "zeroinitializer" "c" "asm" "blockaddress"
 
          ;; Calling conventions
          "ccc" "fastcc" "coldcc" "anyregcc" "preserve_mostcc" "preserve_allcc"


        


More information about the llvm-commits mailing list