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

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 3 09:04:40 PDT 2024


https://github.com/goldsteinn updated https://github.com/llvm/llvm-project/pull/97594

>From 95b04ffc8817a2d9a9d162b7d66c82d0ccf30a84 Mon Sep 17 00:00:00 2001
From: Noah Goldstein <goldstein.w.n at gmail.com>
Date: Wed, 3 Jul 2024 23:19:37 +0800
Subject: [PATCH] [emacs] More consistently highlight value keywords that
 appear in vectors

Previously something like `<i8 123, i8 poison>` would not properly
highlight the `poison` keyword at the end.
---
 llvm/utils/emacs/llvm-mode.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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