From: Andrea Corallo Date: Sat, 14 Nov 2020 15:55:39 +0000 (+0100) Subject: * Add a number of type specifiers for pure function X-Git-Tag: emacs-28.0.90~2727^2~323 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=aced2cf6ac50d3c62380c224c7d553f597c1f574;p=emacs.git * Add a number of type specifiers for pure function * lisp/emacs-lisp/comp.el (comp-known-type-specifiers): Add 60 pure function type specifiers. --- diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 96b2b29043a..fa94d399eb5 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el @@ -191,6 +191,7 @@ For internal use only by the testsuite.") Each function in FUNCTIONS is run after PASS. Useful to hook into pass checkers.") +;; FIXME this probably should not be here but... good for now. (defconst comp-known-type-specifiers `((cons (function (t t) cons)) (1+ (function ((or number marker)) number)) @@ -199,7 +200,52 @@ Useful to hook into pass checkers.") (- (function (&rest (or number marker)) number)) (* (function (&rest (or number marker)) number)) (/ (function ((or number marker) &rest (or number marker)) number)) - (% (function ((or number marker) (or number marker)) number))) + (% (function ((or number marker) (or number marker)) number)) + (concat (function (&rest sequence) string)) + (regexp-opt (function (list) string)) + (string-to-char (function (string) integer)) + (symbol-name (function (symbol) string)) + (eq (function (t t) boolean)) + (eql (function (t t) boolean)) + (= (function ((or number marker) (or number marker)) boolean)) + (/= (function ((or number marker) (or number marker)) boolean)) + (< (function ((or number marker) &rest (or number marker)) boolean)) + (<= (function ((or number marker) &rest (or number marker)) boolean)) + (>= (function ((or number marker) &rest (or number marker)) boolean)) + (> (function ((or number marker) &rest (or number marker)) boolean)) + (min (function ((or number marker) &rest (or number marker)) number)) + (max (function ((or number marker) &rest (or number marker)) number)) + (mod (function ((or number marker) (or number marker)) + (or (integer 0 *) (float 0 *)))) + (abs (function (number) number)) + (ash (function (integer integer) integer)) + (sqrt (function (number) float)) + (logand (function (&rest (or integer marker)) integer)) + (logior (function (&rest (or integer marker)) integer)) + (lognot (function (integer) integer)) + (logxor (function (&rest (or integer marker)) integer)) + (logcount (function (integer) integer)) + (copysign (function (float float) float)) + (isnan (function (float) boolean)) + (ldexp (function (number integer) float)) + (float (function (number) float)) + (logb (function (number) integer)) + (floor (function (number &optional number) integer)) + (ceiling (function (number &optional number) integer)) + (round (function (number &optional number) integer)) + (truncate (function (number &optional number) integer)) + (ffloor (function (float) float)) + (fceiling (function (float) float)) + (fround (function (float) float)) + (ftruncate (function (float) float)) + (string= (function ((or string symbol) (or string symbol)) boolean)) + (string-equal (function ((or string symbol) (or string symbol)) boolean)) + (string< (function ((or string symbol) (or string symbol)) boolean)) + (string-lessp (function ((or string symbol) (or string symbol)) boolean)) + (string-search (function (string string) (or integer null))) + ;; Type hints + (comp-hint-fixnum (function (t) fixnum)) + (comp-hint-cons (function (t) cons))) "Alist used for type propagation.") (defconst comp-symbol-values-optimizable '(most-positive-fixnum