aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Corallo2020-09-01 21:28:22 +0200
committerAndrea Corallo2020-09-14 23:06:42 +0200
commitc4cc13917cdf733b142ed2dee9b5aee9df9f8153 (patch)
tree49eeb62294aef9b2798b84def2776d9ecb5a07c1
parent21021e56ad609a459ec117bcfc60b2802176a9a7 (diff)
downloademacs-c4cc13917cdf733b142ed2dee9b5aee9df9f8153.tar.gz
emacs-c4cc13917cdf733b142ed2dee9b5aee9df9f8153.zip
* lisp/emacs-lisp/cl-macs.el (cl-the): Emit compiler hints when native.
-rw-r--r--lisp/emacs-lisp/cl-macs.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index c38019d4a73..7adb9100703 100644
--- a/lisp/emacs-lisp/cl-macs.el
+++ b/lisp/emacs-lisp/cl-macs.el
@@ -2329,6 +2329,14 @@ values. For compatibility, (cl-values A B C) is a synonym for (list A B C).
2329(defmacro cl-the (type form) 2329(defmacro cl-the (type form)
2330 "Return FORM. If type-checking is enabled, assert that it is of TYPE." 2330 "Return FORM. If type-checking is enabled, assert that it is of TYPE."
2331 (declare (indent 1) (debug (cl-type-spec form))) 2331 (declare (indent 1) (debug (cl-type-spec form)))
2332 ;; When native compiling possibly add the appropriate type hint.
2333 (when (and (boundp 'byte-native-compiling)
2334 byte-native-compiling)
2335 (setf form
2336 (cl-case type
2337 (fixnum `(comp-hint-fixnum ,form))
2338 (cons `(comp-hint-cons ,form))
2339 (otherwise form))))
2332 (if (not (or (not (cl--compiling-file)) 2340 (if (not (or (not (cl--compiling-file))
2333 (< cl--optimize-speed 3) 2341 (< cl--optimize-speed 3)
2334 (= cl--optimize-safety 3))) 2342 (= cl--optimize-safety 3)))