llvm.org GIT mirror llvm / 3fb6dcc
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 Rafael Espindola 5 years ago
1 changed file(s) with 12 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
2222 ;; Unnamed variable slots
2323 '("%[-]?[0-9]+" . font-lock-variable-name-face)
2424 ;; Types
25 `(,(regexp-opt '("void" "i1" "i8" "i16" "i32" "i64" "i128" "float" "double" "type" "label" "opaque") 'words) . font-lock-type-face)
25 `(,(regexp-opt '("void" "i1" "i8" "i16" "i32" "i64" "i128" "float" "double" "type" "label" "opaque") 'symbol) . font-lock-type-face)
2626 ;; Integer literals
2727 '("\\b[-]?[0-9]+\\b" . font-lock-preprocessor-face)
2828 ;; Floating point constants
3434 "define" "global" "constant" "const" "internal" "linkonce" "linkonce_odr"
3535 "weak" "weak_odr" "appending" "uninitialized" "implementation" "..."
3636 "null" "undef" "to" "except" "not" "target" "endian" "little" "big"
37 "pointersize" "volatile" "fastcc" "coldcc" "cc") 'words) . font-lock-keyword-face)
37 "pointersize" "volatile" "fastcc" "coldcc" "cc") 'symbols) . font-lock-keyword-face)
3838 ;; Arithmetic and Logical Operators
3939 `(,(regexp-opt '("add" "sub" "mul" "sdiv" "udiv" "urem" "srem" "and" "or" "xor"
40 "setne" "seteq" "setlt" "setgt" "setle" "setge") 'words) . font-lock-keyword-face)
40 "setne" "seteq" "setlt" "setgt" "setle" "setge") 'symbols) . font-lock-keyword-face)
4141 ;; Floating-point operators
42 `(,(regexp-opt '("fadd" "fsub" "fmul" "fdiv" "frem") 'words) . font-lock-keyword-face)
42 `(,(regexp-opt '("fadd" "fsub" "fmul" "fdiv" "frem") 'symbols) . font-lock-keyword-face)
4343 ;; Special instructions
44 `(,(regexp-opt '("phi" "tail" "call" "select" "to" "shl" "lshr" "ashr" "fcmp" "icmp" "va_arg" "landingpad") 'words) . font-lock-keyword-face)
44 `(,(regexp-opt '("phi" "tail" "call" "select" "to" "shl" "lshr" "ashr" "fcmp" "icmp" "va_arg" "landingpad") 'symbols) . font-lock-keyword-face)
4545 ;; Control instructions
46 `(,(regexp-opt '("ret" "br" "switch" "invoke" "resume" "unwind" "unreachable" "indirectbr") 'words) . font-lock-keyword-face)
46 `(,(regexp-opt '("ret" "br" "switch" "invoke" "resume" "unwind" "unreachable" "indirectbr") 'symbols) . font-lock-keyword-face)
4747 ;; Memory operators
48 `(,(regexp-opt '("malloc" "alloca" "free" "load" "store" "getelementptr" "fence" "cmpxchg" "atomicrmw") 'words) . font-lock-keyword-face)
48 `(,(regexp-opt '("malloc" "alloca" "free" "load" "store" "getelementptr" "fence" "cmpxchg" "atomicrmw") 'symbols) . font-lock-keyword-face)
4949 ;; Casts
50 `(,(regexp-opt '("bitcast" "inttoptr" "ptrtoint" "trunc" "zext" "sext" "fptrunc" "fpext" "fptoui" "fptosi" "uitofp" "sitofp" "addrspacecast") 'words) . font-lock-keyword-face)
50 `(,(regexp-opt '("bitcast" "inttoptr" "ptrtoint" "trunc" "zext" "sext" "fptrunc" "fpext" "fptoui" "fptosi" "uitofp" "sitofp" "addrspacecast") 'symbols) . font-lock-keyword-face)
5151 ;; Vector ops
52 `(,(regexp-opt '("extractelement" "insertelement" "shufflevector") 'words) . font-lock-keyword-face)
52 `(,(regexp-opt '("extractelement" "insertelement" "shufflevector") 'symbols) . font-lock-keyword-face)
5353 ;; Aggregate ops
54 `(,(regexp-opt '("extractvalue" "insertvalue") 'words) . font-lock-keyword-face)
54 `(,(regexp-opt '("extractvalue" "insertvalue") 'symbols) . font-lock-keyword-face)
5555 ;; Metadata types
56 `(,(regexp-opt '("distinct") 'words) . font-lock-keyword-face)
56 `(,(regexp-opt '("distinct") 'symbols) . font-lock-keyword-face)
5757 ;; Use-list order directives
58 `(,(regexp-opt '("uselistorder" "uselistorder_bb") 'words) . font-lock-keyword-face)
58 `(,(regexp-opt '("uselistorder" "uselistorder_bb") 'symbols) . font-lock-keyword-face)
5959
6060 )
6161 "Syntax highlighting for LLVM."