[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp c4cc139 1/8: * lisp/emacs-lisp/cl-macs.el (cl-the):
From: |
Andrea Corallo |
Subject: |
feature/native-comp c4cc139 1/8: * lisp/emacs-lisp/cl-macs.el (cl-the): Emit compiler hints when native. |
Date: |
Mon, 14 Sep 2020 17:22:56 -0400 (EDT) |
branch: feature/native-comp
commit c4cc13917cdf733b142ed2dee9b5aee9df9f8153
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
* lisp/emacs-lisp/cl-macs.el (cl-the): Emit compiler hints when native.
---
lisp/emacs-lisp/cl-macs.el | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el
index c38019d..7adb910 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).
(defmacro cl-the (type form)
"Return FORM. If type-checking is enabled, assert that it is of TYPE."
(declare (indent 1) (debug (cl-type-spec form)))
+ ;; When native compiling possibly add the appropriate type hint.
+ (when (and (boundp 'byte-native-compiling)
+ byte-native-compiling)
+ (setf form
+ (cl-case type
+ (fixnum `(comp-hint-fixnum ,form))
+ (cons `(comp-hint-cons ,form))
+ (otherwise form))))
(if (not (or (not (cl--compiling-file))
(< cl--optimize-speed 3)
(= cl--optimize-safety 3)))
- feature/native-comp updated (21021e5 -> 5f37c18), Andrea Corallo, 2020/09/14
- feature/native-comp c4cc139 1/8: * lisp/emacs-lisp/cl-macs.el (cl-the): Emit compiler hints when native.,
Andrea Corallo <=
- feature/native-comp 9531271 2/8: * Add 'cl-optimize' as function declaration, Andrea Corallo, 2020/09/14
- feature/native-comp 2da2ad2 5/8: * lisp/emacs-lisp/comp.el (comp-sp): Better style gv-setter declaration., Andrea Corallo, 2020/09/14
- feature/native-comp a3dc11e 4/8: * Remove type check emission from type hints low level primitives, Andrea Corallo, 2020/09/14
- feature/native-comp 82171a8 6/8: * Add gv-setters for compiler hints, Andrea Corallo, 2020/09/14
- feature/native-comp e972837 7/8: * Fix free function compilation load process., Andrea Corallo, 2020/09/14
- feature/native-comp c9a9b07 3/8: * lisp/emacs-lisp/cl-macs.el: Define fixnum and bignum., Andrea Corallo, 2020/09/14
- feature/native-comp 5f37c18 8/8: * test/src/comp-tests.el (comp-tests-bootstrap): Print compilation time., Andrea Corallo, 2020/09/14