Move some sub-register index calculations to CodeGenRegisters.cpp
[oota-llvm.git] / utils / emacs / llvm-mode.el
index 959cf268a061f618fead1ced6406f2b5e4c9a910..3780624b5a43d7893f6fd3c50ada3e915a123033 100644 (file)
@@ -1,6 +1,6 @@
-;; Maintainer:  The LLVM team, http://llvm.cs.uiuc.edu/
+;; Maintainer:  The LLVM team, http://llvm.org/
 ;; Description: Major mode for the LLVM assembler language.
-;; Updated:     2003-06-02
+;; Updated:     2007-09-19
 
 ;; Create mode-specific tables.
 (defvar llvm-mode-syntax-table nil
    '("\"[^\"]+\"" . font-lock-string-face)
    ;; Unnamed variable slots
    '("%[-]?[0-9]+" . font-lock-variable-name-face)
+   ;; Types
+   `(,(regexp-opt '("void" "i[0-9]+" "float" "double" "type" "label" "opaque") 'words) . font-lock-type-face)
    ;; Integer literals
-   '("[-]?[0-9]+" . font-lock-preprocessor-face)
+   '("\\b[-]?[0-9]+\\b" . font-lock-preprocessor-face)
    ;; Floating point constants
-   '("[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?" . font-lock-preprocessor-face)
+   '("\\b[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?\\b" . font-lock-preprocessor-face)
    ;; Hex constants
-   '("0x[0-9A-Fa-f]+" . font-lock-preprocessor-face)
+   '("\\b0x[0-9A-Fa-f]+\\b" . font-lock-preprocessor-face)
    ;; Keywords
-   '("begin\\|end\\|true\\|false\\|zeroinitializer\\|declare\\|global\\|constant\\|const\\|internal\\|linkonce\\|weak\\|appending\\|uninitialized\\|implementation\\|\\.\\.\\.\\|null\\|undef\\|to\\|except\\|not\\|target\\|endian\\|little\\|big\\|pointersize\\|deplibs\\|volatile" . font-lock-keyword-face)
-   ;; Types
-   '("void\\|bool\\|sbyte\\|ubyte\\|u?short\\|u?int\\|u?long\\|float\\|double\\|type\\|label\\|opaque" . font-lock-type-face)
+   `(,(regexp-opt '("begin" "end" "true" "false" "zeroinitializer" "declare"
+                    "define" "global" "constant" "const" "internal" "linkonce" "linkonce_odr"
+                    "weak" "weak_odr" "appending" "uninitialized" "implementation" "..."
+                    "null" "undef" "to" "except" "not" "target" "endian" "little" "big"
+                    "pointersize" "deplibs" "volatile" "fastcc" "coldcc" "cc") 'words) . font-lock-keyword-face)
    ;; Arithmetic and Logical Operators
-   '("add\\|sub\\|mul\\|div\\|rem\\|and\\|or\\|xor\\|set\\(ne\\|eq\\|lt\\|gt\\|le\\|ge\\)" . font-lock-keyword-face)
+   `(,(regexp-opt '("add" "sub" "mul" "div" "rem" "and" "or" "xor"
+                    "setne" "seteq" "setlt" "setgt" "setle" "setge") 'words) . font-lock-keyword-face)
    ;; Special instructions
-   '("phi\\|call\\|cast\\|select\\|to\\|shl\\|shr\\|vaarg\\|vanext" . font-lock-keyword-face)
+   `(,(regexp-opt '("phi" "tail" "call" "cast" "select" "to" "shl" "shr" "vaarg" "vanext") 'words) . font-lock-keyword-face)
    ;; Control instructions
-   '("ret\\|br\\|switch\\|invoke\\|unwind\\|unreachable" . font-lock-keyword-face)
+   `(,(regexp-opt '("ret" "br" "switch" "invoke" "unwind" "unreachable") 'words) . font-lock-keyword-face)
    ;; Memory operators
-   '("malloc\\|alloca\\|free\\|load\\|store\\|getelementptr" . font-lock-keyword-face)
+   `(,(regexp-opt '("malloc" "alloca" "free" "load" "store" "getelementptr") 'words) . font-lock-keyword-face)
    )
   "Syntax highlighting for LLVM"
   )
 
   (setq local-abbrev-table llvm-mode-abbrev-table)
   (set-syntax-table llvm-mode-syntax-table)
+  (setq comment-start ";")
   (run-hooks 'llvm-mode-hook))          ; Finally, this permits the user to
                                         ;   customize the mode with a hook.
 
 ;; Associate .ll files with llvm-mode
 (setq auto-mode-alist
-   (append '(("\\.ll$" . llvm-mode) ("\\.llx$" . llvm-mode)) auto-mode-alist))
+   (append '(("\\.ll$" . llvm-mode)) auto-mode-alist))
 
 (provide 'llvm-mode)
 ;; end of llvm-mode.el