You've already forked linux-packaging-mono
Imported Upstream version 5.18.0.167
Former-commit-id: 289509151e0fee68a1b591a20c9f109c3c789d3a
This commit is contained in:
parent
e19d552987
commit
b084638f15
27
external/llvm/utils/emacs/README
vendored
27
external/llvm/utils/emacs/README
vendored
@ -1,27 +0,0 @@
|
||||
-*- llvm/utils/emacs/README -*-
|
||||
|
||||
These are syntax highlighting files for the Emacs and XEmacs editors. Included
|
||||
are:
|
||||
|
||||
* llvm-mode.el
|
||||
|
||||
Syntax highlighting mode for LLVM assembly files. To use, add this code to
|
||||
your ~/.emacs :
|
||||
|
||||
(setq load-path
|
||||
(cons (expand-file-name "path-to-llvm/utils/emacs") load-path))
|
||||
(require 'llvm-mode)
|
||||
|
||||
* tablegen-mode.el
|
||||
|
||||
Syntax highlighting mode for TableGen description files. To use, add this code
|
||||
to your ~/.emacs:
|
||||
|
||||
(setq load-path
|
||||
(cons (expand-file-name "path-to-llvm/utils/emacs") load-path))
|
||||
(require 'tablegen-mode)
|
||||
|
||||
|
||||
Note: If you notice missing or incorrect syntax highlighting, please contact
|
||||
<llvm-bugs [at] lists.llvm.org>; if you wish to provide a patch to improve the
|
||||
functionality, it will be most appreciated. Thank you.
|
22
external/llvm/utils/emacs/emacs.el
vendored
22
external/llvm/utils/emacs/emacs.el
vendored
@ -1,22 +0,0 @@
|
||||
;; LLVM coding style guidelines in emacs
|
||||
;; Maintainer: LLVM Team, http://llvm.org/
|
||||
|
||||
;; Add a cc-mode style for editing LLVM C and C++ code
|
||||
(c-add-style "llvm.org"
|
||||
'("gnu"
|
||||
(fill-column . 80)
|
||||
(c++-indent-level . 2)
|
||||
(c-basic-offset . 2)
|
||||
(indent-tabs-mode . nil)
|
||||
(c-offsets-alist . ((arglist-intro . ++)
|
||||
(innamespace . 0)
|
||||
(member-init-intro . ++)))))
|
||||
|
||||
;; Files with "llvm" in their names will automatically be set to the
|
||||
;; llvm.org coding style.
|
||||
(add-hook 'c-mode-common-hook
|
||||
(function
|
||||
(lambda nil
|
||||
(if (string-match "llvm" buffer-file-name)
|
||||
(progn
|
||||
(c-set-style "llvm.org"))))))
|
85
external/llvm/utils/emacs/llvm-mode.el
vendored
85
external/llvm/utils/emacs/llvm-mode.el
vendored
@ -1,85 +0,0 @@
|
||||
;;; llvm-mode.el --- Major mode for the LLVM assembler language.
|
||||
|
||||
;; Maintainer: The LLVM team, http://llvm.org/
|
||||
|
||||
;;; Commentary:
|
||||
|
||||
;; Major mode for editing LLVM IR files.
|
||||
|
||||
;;; Code:
|
||||
|
||||
(defvar llvm-mode-syntax-table
|
||||
(let ((table (make-syntax-table)))
|
||||
(modify-syntax-entry ?% "_" table)
|
||||
(modify-syntax-entry ?. "_" table)
|
||||
(modify-syntax-entry ?\; "< " table)
|
||||
(modify-syntax-entry ?\n "> " table)
|
||||
table)
|
||||
"Syntax table used while in LLVM mode.")
|
||||
|
||||
(defvar llvm-font-lock-keywords
|
||||
(list
|
||||
;; Variables
|
||||
'("%[-a-zA-Z$\._][-a-zA-Z$\._0-9]*" . font-lock-variable-name-face)
|
||||
;; Labels
|
||||
'("[-a-zA-Z$\._0-9]+:" . font-lock-variable-name-face)
|
||||
;; Unnamed variable slots
|
||||
'("%[-]?[0-9]+" . font-lock-variable-name-face)
|
||||
;; Types
|
||||
`(,(regexp-opt '("void" "i1" "i8" "i16" "i32" "i64" "i128" "float" "double" "type" "label" "opaque") 'symbols) . font-lock-type-face)
|
||||
;; Integer literals
|
||||
'("\\b[-]?[0-9]+\\b" . font-lock-preprocessor-face)
|
||||
;; Floating point constants
|
||||
'("\\b[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?\\b" . font-lock-preprocessor-face)
|
||||
;; Hex constants
|
||||
'("\\b0x[0-9A-Fa-f]+\\b" . font-lock-preprocessor-face)
|
||||
;; Keywords
|
||||
`(,(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" "volatile" "fastcc" "coldcc" "cc" "personality") 'symbols) . font-lock-keyword-face)
|
||||
;; Arithmetic and Logical Operators
|
||||
`(,(regexp-opt '("add" "sub" "mul" "sdiv" "udiv" "urem" "srem" "and" "or" "xor"
|
||||
"setne" "seteq" "setlt" "setgt" "setle" "setge") 'symbols) . font-lock-keyword-face)
|
||||
;; Floating-point operators
|
||||
`(,(regexp-opt '("fadd" "fsub" "fmul" "fdiv" "frem") 'symbols) . font-lock-keyword-face)
|
||||
;; Special instructions
|
||||
`(,(regexp-opt '("phi" "tail" "call" "select" "to" "shl" "lshr" "ashr" "fcmp" "icmp" "va_arg" "landingpad") 'symbols) . font-lock-keyword-face)
|
||||
;; Control instructions
|
||||
`(,(regexp-opt '("ret" "br" "switch" "invoke" "resume" "unwind" "unreachable" "indirectbr") 'symbols) . font-lock-keyword-face)
|
||||
;; Memory operators
|
||||
`(,(regexp-opt '("malloc" "alloca" "free" "load" "store" "getelementptr" "fence" "cmpxchg" "atomicrmw") 'symbols) . font-lock-keyword-face)
|
||||
;; Casts
|
||||
`(,(regexp-opt '("bitcast" "inttoptr" "ptrtoint" "trunc" "zext" "sext" "fptrunc" "fpext" "fptoui" "fptosi" "uitofp" "sitofp" "addrspacecast") 'symbols) . font-lock-keyword-face)
|
||||
;; Vector ops
|
||||
`(,(regexp-opt '("extractelement" "insertelement" "shufflevector") 'symbols) . font-lock-keyword-face)
|
||||
;; Aggregate ops
|
||||
`(,(regexp-opt '("extractvalue" "insertvalue") 'symbols) . font-lock-keyword-face)
|
||||
;; Metadata types
|
||||
`(,(regexp-opt '("distinct") 'symbols) . font-lock-keyword-face)
|
||||
;; Use-list order directives
|
||||
`(,(regexp-opt '("uselistorder" "uselistorder_bb") 'symbols) . font-lock-keyword-face))
|
||||
"Syntax highlighting for LLVM.")
|
||||
|
||||
;; Emacs 23 compatibility.
|
||||
(defalias 'llvm-mode-prog-mode
|
||||
(if (fboundp 'prog-mode)
|
||||
'prog-mode
|
||||
'fundamental-mode))
|
||||
|
||||
;;;###autoload
|
||||
(define-derived-mode llvm-mode llvm-mode-prog-mode "LLVM"
|
||||
"Major mode for editing LLVM source files.
|
||||
\\{llvm-mode-map}
|
||||
Runs `llvm-mode-hook' on startup."
|
||||
(setq font-lock-defaults `(llvm-font-lock-keywords))
|
||||
(setq comment-start ";"))
|
||||
|
||||
;; Associate .ll files with llvm-mode
|
||||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist (cons (purecopy "\\.ll\\'") 'llvm-mode))
|
||||
|
||||
(provide 'llvm-mode)
|
||||
|
||||
;;; llvm-mode.el ends here
|
131
external/llvm/utils/emacs/tablegen-mode.el
vendored
131
external/llvm/utils/emacs/tablegen-mode.el
vendored
@ -1,131 +0,0 @@
|
||||
;;; tablegen-mode.el --- Major mode for TableGen description files (part of LLVM project)
|
||||
|
||||
;; Maintainer: The LLVM team, http://llvm.org/
|
||||
|
||||
;;; Commentary:
|
||||
;; A major mode for TableGen description files in LLVM.
|
||||
|
||||
(require 'comint)
|
||||
(require 'custom)
|
||||
(require 'ansi-color)
|
||||
|
||||
;; Create mode-specific tables.
|
||||
;;; Code:
|
||||
|
||||
(defvar td-decorators-face 'td-decorators-face
|
||||
"Face method decorators.")
|
||||
(make-face 'td-decorators-face)
|
||||
|
||||
(defvar tablegen-font-lock-keywords
|
||||
(let ((kw (regexp-opt '("class" "defm" "def" "field" "include" "in"
|
||||
"let" "multiclass" "foreach")
|
||||
'words))
|
||||
(type-kw (regexp-opt '("bit" "bits" "code" "dag" "int" "list" "string")
|
||||
'words))
|
||||
)
|
||||
(list
|
||||
;; Comments
|
||||
;; '("\/\/" . font-lock-comment-face)
|
||||
;; Strings
|
||||
'("\"[^\"]+\"" . font-lock-string-face)
|
||||
;; Hex constants
|
||||
'("\\<0x[0-9A-Fa-f]+\\>" . font-lock-preprocessor-face)
|
||||
;; Binary constants
|
||||
'("\\<0b[01]+\\>" . font-lock-preprocessor-face)
|
||||
;; Integer literals
|
||||
'("\\<[-]?[0-9]+\\>" . font-lock-preprocessor-face)
|
||||
;; Floating point constants
|
||||
'("\\<[-+]?[0-9]+\.[0-9]*\([eE][-+]?[0-9]+\)?\\>" . font-lock-preprocessor-face)
|
||||
|
||||
'("^[ \t]*\\(@.+\\)" 1 'td-decorators-face)
|
||||
;; Keywords
|
||||
(cons (concat kw "[ \n\t(]") 1)
|
||||
|
||||
;; Type keywords
|
||||
(cons (concat type-kw "[ \n\t(]") 1)
|
||||
))
|
||||
"Additional expressions to highlight in TableGen mode.")
|
||||
(put 'tablegen-mode 'font-lock-defaults '(tablegen-font-lock-keywords))
|
||||
|
||||
;; ---------------------- Syntax table ---------------------------
|
||||
;; Shamelessly ripped from jasmin.el
|
||||
;; URL: http://www.neilvandyke.org/jasmin-emacs/jasmin.el
|
||||
|
||||
(defvar tablegen-mode-syntax-table nil
|
||||
"Syntax table used in `tablegen-mode' buffers.")
|
||||
(when (not tablegen-mode-syntax-table)
|
||||
(setq tablegen-mode-syntax-table (make-syntax-table))
|
||||
;; whitespace (` ')
|
||||
(modify-syntax-entry ?\ " " tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\t " " tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\r " " tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\n " " tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\f " " tablegen-mode-syntax-table)
|
||||
;; word constituents (`w')
|
||||
(modify-syntax-entry ?\% "w" tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\_ "w" tablegen-mode-syntax-table)
|
||||
;; comments
|
||||
(modify-syntax-entry ?/ ". 124b" tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?* ". 23" tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\n "> b" tablegen-mode-syntax-table)
|
||||
;; open paren (`(')
|
||||
(modify-syntax-entry ?\( "(" tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\[ "(" tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\{ "(" tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\< "(" tablegen-mode-syntax-table)
|
||||
;; close paren (`)')
|
||||
(modify-syntax-entry ?\) ")" tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\] ")" tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\} ")" tablegen-mode-syntax-table)
|
||||
(modify-syntax-entry ?\> ")" tablegen-mode-syntax-table)
|
||||
;; string quote ('"')
|
||||
(modify-syntax-entry ?\" "\"" tablegen-mode-syntax-table)
|
||||
)
|
||||
|
||||
;; --------------------- Abbrev table -----------------------------
|
||||
|
||||
(defvar tablegen-mode-abbrev-table nil
|
||||
"Abbrev table used while in TableGen mode.")
|
||||
(define-abbrev-table 'tablegen-mode-abbrev-table ())
|
||||
|
||||
(defvar tablegen-mode-hook nil)
|
||||
(defvar tablegen-mode-map nil) ; Create a mode-specific keymap.
|
||||
|
||||
(if (not tablegen-mode-map)
|
||||
() ; Do not change the keymap if it is already set up.
|
||||
(setq tablegen-mode-map (make-sparse-keymap))
|
||||
(define-key tablegen-mode-map "\t" 'tab-to-tab-stop)
|
||||
(define-key tablegen-mode-map "\es" 'center-line)
|
||||
(define-key tablegen-mode-map "\eS" 'center-paragraph))
|
||||
|
||||
;;;###autoload
|
||||
(defun tablegen-mode ()
|
||||
"Major mode for editing TableGen description files.
|
||||
\\{tablegen-mode-map}
|
||||
Runs `tablegen-mode-hook' on startup."
|
||||
(interactive)
|
||||
(kill-all-local-variables)
|
||||
(use-local-map tablegen-mode-map) ; Provides the local keymap.
|
||||
(make-local-variable 'font-lock-defaults)
|
||||
(setq major-mode 'tablegen-mode ; This is how describe-mode
|
||||
; finds the doc string to print.
|
||||
mode-name "TableGen" ; This name goes into the modeline.
|
||||
local-abbrev-table tablegen-mode-abbrev-table
|
||||
font-lock-defaults `(tablegen-font-lock-keywords)
|
||||
require-final-newline t
|
||||
)
|
||||
|
||||
(set-syntax-table tablegen-mode-syntax-table)
|
||||
(make-local-variable 'comment-start)
|
||||
(setq comment-start "//")
|
||||
(setq indent-tabs-mode nil)
|
||||
(run-hooks 'tablegen-mode-hook)) ; Finally, this permits the user to
|
||||
; customize the mode with a hook.
|
||||
|
||||
;; Associate .td files with tablegen-mode
|
||||
;;;###autoload
|
||||
(add-to-list 'auto-mode-alist (cons (purecopy "\\.td\\'") 'tablegen-mode))
|
||||
|
||||
(provide 'tablegen-mode)
|
||||
|
||||
;;; tablegen-mode.el ends here
|
Reference in New Issue
Block a user