mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-01 17:28:21 +00:00
Correcting keyword highlighting in llvm-mode.el.
llvm-mode was previously confused when variable names contained keywords. This changes ensures that keywords are only highlighted when they're standalone. Patch by Wilfred Hughes! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228396 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f6943689d2
commit
3fb6dcc570
@ -23,7 +23,7 @@
|
|||||||
;; Unnamed variable slots
|
;; Unnamed variable slots
|
||||||
'("%[-]?[0-9]+" . font-lock-variable-name-face)
|
'("%[-]?[0-9]+" . font-lock-variable-name-face)
|
||||||
;; Types
|
;; Types
|
||||||
`(,(regexp-opt '("void" "i1" "i8" "i16" "i32" "i64" "i128" "float" "double" "type" "label" "opaque") 'words) . font-lock-type-face)
|
`(,(regexp-opt '("void" "i1" "i8" "i16" "i32" "i64" "i128" "float" "double" "type" "label" "opaque") 'symbol) . font-lock-type-face)
|
||||||
;; Integer literals
|
;; Integer literals
|
||||||
'("\\b[-]?[0-9]+\\b" . font-lock-preprocessor-face)
|
'("\\b[-]?[0-9]+\\b" . font-lock-preprocessor-face)
|
||||||
;; Floating point constants
|
;; Floating point constants
|
||||||
@ -35,28 +35,28 @@
|
|||||||
"define" "global" "constant" "const" "internal" "linkonce" "linkonce_odr"
|
"define" "global" "constant" "const" "internal" "linkonce" "linkonce_odr"
|
||||||
"weak" "weak_odr" "appending" "uninitialized" "implementation" "..."
|
"weak" "weak_odr" "appending" "uninitialized" "implementation" "..."
|
||||||
"null" "undef" "to" "except" "not" "target" "endian" "little" "big"
|
"null" "undef" "to" "except" "not" "target" "endian" "little" "big"
|
||||||
"pointersize" "volatile" "fastcc" "coldcc" "cc") 'words) . font-lock-keyword-face)
|
"pointersize" "volatile" "fastcc" "coldcc" "cc") 'symbols) . font-lock-keyword-face)
|
||||||
;; Arithmetic and Logical Operators
|
;; Arithmetic and Logical Operators
|
||||||
`(,(regexp-opt '("add" "sub" "mul" "sdiv" "udiv" "urem" "srem" "and" "or" "xor"
|
`(,(regexp-opt '("add" "sub" "mul" "sdiv" "udiv" "urem" "srem" "and" "or" "xor"
|
||||||
"setne" "seteq" "setlt" "setgt" "setle" "setge") 'words) . font-lock-keyword-face)
|
"setne" "seteq" "setlt" "setgt" "setle" "setge") 'symbols) . font-lock-keyword-face)
|
||||||
;; Floating-point operators
|
;; Floating-point operators
|
||||||
`(,(regexp-opt '("fadd" "fsub" "fmul" "fdiv" "frem") 'words) . font-lock-keyword-face)
|
`(,(regexp-opt '("fadd" "fsub" "fmul" "fdiv" "frem") 'symbols) . font-lock-keyword-face)
|
||||||
;; Special instructions
|
;; Special instructions
|
||||||
`(,(regexp-opt '("phi" "tail" "call" "select" "to" "shl" "lshr" "ashr" "fcmp" "icmp" "va_arg" "landingpad") 'words) . font-lock-keyword-face)
|
`(,(regexp-opt '("phi" "tail" "call" "select" "to" "shl" "lshr" "ashr" "fcmp" "icmp" "va_arg" "landingpad") 'symbols) . font-lock-keyword-face)
|
||||||
;; Control instructions
|
;; Control instructions
|
||||||
`(,(regexp-opt '("ret" "br" "switch" "invoke" "resume" "unwind" "unreachable" "indirectbr") 'words) . font-lock-keyword-face)
|
`(,(regexp-opt '("ret" "br" "switch" "invoke" "resume" "unwind" "unreachable" "indirectbr") 'symbols) . font-lock-keyword-face)
|
||||||
;; Memory operators
|
;; Memory operators
|
||||||
`(,(regexp-opt '("malloc" "alloca" "free" "load" "store" "getelementptr" "fence" "cmpxchg" "atomicrmw") 'words) . font-lock-keyword-face)
|
`(,(regexp-opt '("malloc" "alloca" "free" "load" "store" "getelementptr" "fence" "cmpxchg" "atomicrmw") 'symbols) . font-lock-keyword-face)
|
||||||
;; Casts
|
;; Casts
|
||||||
`(,(regexp-opt '("bitcast" "inttoptr" "ptrtoint" "trunc" "zext" "sext" "fptrunc" "fpext" "fptoui" "fptosi" "uitofp" "sitofp" "addrspacecast") 'words) . font-lock-keyword-face)
|
`(,(regexp-opt '("bitcast" "inttoptr" "ptrtoint" "trunc" "zext" "sext" "fptrunc" "fpext" "fptoui" "fptosi" "uitofp" "sitofp" "addrspacecast") 'symbols) . font-lock-keyword-face)
|
||||||
;; Vector ops
|
;; Vector ops
|
||||||
`(,(regexp-opt '("extractelement" "insertelement" "shufflevector") 'words) . font-lock-keyword-face)
|
`(,(regexp-opt '("extractelement" "insertelement" "shufflevector") 'symbols) . font-lock-keyword-face)
|
||||||
;; Aggregate ops
|
;; Aggregate ops
|
||||||
`(,(regexp-opt '("extractvalue" "insertvalue") 'words) . font-lock-keyword-face)
|
`(,(regexp-opt '("extractvalue" "insertvalue") 'symbols) . font-lock-keyword-face)
|
||||||
;; Metadata types
|
;; Metadata types
|
||||||
`(,(regexp-opt '("distinct") 'words) . font-lock-keyword-face)
|
`(,(regexp-opt '("distinct") 'symbols) . font-lock-keyword-face)
|
||||||
;; Use-list order directives
|
;; Use-list order directives
|
||||||
`(,(regexp-opt '("uselistorder" "uselistorder_bb") 'words) . font-lock-keyword-face)
|
`(,(regexp-opt '("uselistorder" "uselistorder_bb") 'symbols) . font-lock-keyword-face)
|
||||||
|
|
||||||
)
|
)
|
||||||
"Syntax highlighting for LLVM."
|
"Syntax highlighting for LLVM."
|
||||||
|
Loading…
Reference in New Issue
Block a user