[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp 8e816b0 11/19: Symplify type specifier (not t) as ni
From: |
Andrea Corallo |
Subject: |
feature/native-comp 8e816b0 11/19: Symplify type specifier (not t) as nil |
Date: |
Mon, 21 Dec 2020 14:52:40 -0500 (EST) |
branch: feature/native-comp
commit 8e816b0ad574a279b12a4d6622c6f224b67083b8
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
Symplify type specifier (not t) as nil
* lisp/emacs-lisp/comp-cstr.el (comp-cstr-intersection-no-mem):
Add logic.
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add two tests.
---
lisp/emacs-lisp/comp-cstr.el | 9 +++++++++
test/lisp/emacs-lisp/comp-cstr-tests.el | 6 +++++-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/lisp/emacs-lisp/comp-cstr.el b/lisp/emacs-lisp/comp-cstr.el
index 3f3f4f6..cd8f432 100644
--- a/lisp/emacs-lisp/comp-cstr.el
+++ b/lisp/emacs-lisp/comp-cstr.el
@@ -598,6 +598,15 @@ DST is returned."
(valset dst) (valset neg)
(range dst) (range neg)
(neg dst) t)
+
+ ;; (not t) => nil
+ (when (and (null (valset dst))
+ (null (range dst))
+ (neg dst)
+ (equal '(t) (typeset dst)))
+ (setf (typeset dst) ()
+ (neg dst) nil))
+
(cl-return-from comp-cstr-intersection-no-mem dst))
(when (cl-some
diff --git a/test/lisp/emacs-lisp/comp-cstr-tests.el
b/test/lisp/emacs-lisp/comp-cstr-tests.el
index 03bf789..f7ea00e 100644
--- a/test/lisp/emacs-lisp/comp-cstr-tests.el
+++ b/test/lisp/emacs-lisp/comp-cstr-tests.el
@@ -195,7 +195,11 @@
;; 77
((and (or symbol string) (or number marker)) . nil)
;; 78
- ((and t t) . t))
+ ((and t t) . t)
+ ;; 80
+ ((and (or marker number) (integer 0 0)) . (integer 0 0))
+ ;; 81
+ ((and t (not t)) . nil))
"Alist type specifier -> expected type specifier.")
(defmacro comp-cstr-synthesize-tests ()
- feature/native-comp 34c1d75 05/19: * Enumerate and split type specifier tests in comp-tests.el to ease debug, (continued)
- feature/native-comp 34c1d75 05/19: * Enumerate and split type specifier tests in comp-tests.el to ease debug, Andrea Corallo, 2020/12/21
- feature/native-comp 7074988 06/19: * Add a type specifier test to comp-cstr-tests.el, Andrea Corallo, 2020/12/21
- feature/native-comp 0255108 08/19: * Rename comp-cond-cstr into comp-add-cstrs, Andrea Corallo, 2020/12/21
- feature/native-comp 48d43f5 04/19: * Improve constraint simplification logic in comp-cstr.el, Andrea Corallo, 2020/12/21
- feature/native-comp 07b75de 10/19: Enhance type inference constraining function arguments, Andrea Corallo, 2020/12/21
- feature/native-comp e0f20da 14/19: Simplify correctly (or (integer 1 1) (not (integer 1 1))) as t, Andrea Corallo, 2020/12/21
- feature/native-comp 6f3570c 16/19: Fix value type inference for doubly negate constraints, Andrea Corallo, 2020/12/21
- feature/native-comp d072ee9 07/19: * Two minors in comp.el, Andrea Corallo, 2020/12/21
- feature/native-comp 23791cf 09/19: * Allow for modifying insn-cell inside `comp-loop-insn-in-block', Andrea Corallo, 2020/12/21
- feature/native-comp 9bbe6ea 15/19: Fix native compiler tests when they are bytecompiled, Andrea Corallo, 2020/12/21
- feature/native-comp 8e816b0 11/19: Symplify type specifier (not t) as nil,
Andrea Corallo <=
- feature/native-comp c70c080 12/19: * Allow for overlapping src and dst in cstr set operations, Andrea Corallo, 2020/12/21
- feature/native-comp 5376563 17/19: Fix `comp-add-call-cstr' and add a test, Andrea Corallo, 2020/12/21
- feature/native-comp ebf8963 18/19: * Fix a bunch of known type specifiers, Andrea Corallo, 2020/12/21
- feature/native-comp 9676e4d 19/19: * Fix a test in auth-source-tests.el, Andrea Corallo, 2020/12/21
- feature/native-comp 3540b1f 13/19: * Guarantee fwprop convergence and termination, Andrea Corallo, 2020/12/21