[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/native-comp c412d39 5/6: * lisp/emacs-lisp/comp.el (comp-mvar-va
From: |
Andrea Corallo |
Subject: |
feature/native-comp c412d39 5/6: * lisp/emacs-lisp/comp.el (comp-mvar-value-vld-p): Fix logic. |
Date: |
Thu, 12 Nov 2020 18:11:57 -0500 (EST) |
branch: feature/native-comp
commit c412d396b0e714c604b3386369b64f0c7e762fe8
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>
* lisp/emacs-lisp/comp.el (comp-mvar-value-vld-p): Fix logic.
---
lisp/emacs-lisp/comp.el | 24 +++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 583a336..217eec1 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -456,15 +456,21 @@ Interg values are handled in the `range' slot.")
(defun comp-mvar-value-vld-p (mvar)
"Return t if one single value can be extracted by the MVAR constrains."
- (or (= (length (comp-mvar-valset mvar)) 1)
- (let ((r (comp-mvar-range mvar)))
- (and (= (length r) 1)
- (let ((low (caar r))
- (high (cdar r)))
- (and
- (integerp low)
- (integerp high)
- (= low high)))))))
+ (when (null (comp-mvar-typeset mvar))
+ (let* ((v (comp-mvar-valset mvar))
+ (r (comp-mvar-range mvar))
+ (valset-len (length v))
+ (range-len (length r)))
+ (if (and (= valset-len 1)
+ (= range-len 0))
+ t
+ (when (and (= valset-len 0)
+ (= range-len 1))
+ (let* ((low (caar r))
+ (high (cdar r)))
+ (and (integerp low)
+ (integerp high)
+ (= low high))))))))
(defun comp-mvar-value (mvar)
"Return the constant value of MVAR.
- feature/native-comp updated (2435c10 -> 9bb2fc1), Andrea Corallo, 2020/11/12
- feature/native-comp 6f10e0f 2/6: * Rework `comp-ret-type-spec' in terms of `comp-phi', Andrea Corallo, 2020/11/12
- feature/native-comp c3daee7 3/6: * Add few more type specifier tests, Andrea Corallo, 2020/11/12
- feature/native-comp c4749ce 1/6: * Move phi function code into dedicated function and improve it, Andrea Corallo, 2020/11/12
- feature/native-comp 9bb2fc1 6/6: Add copy insn testcase, Andrea Corallo, 2020/11/12
- feature/native-comp c412d39 5/6: * lisp/emacs-lisp/comp.el (comp-mvar-value-vld-p): Fix logic.,
Andrea Corallo <=
- feature/native-comp a37cc95 4/6: * Memoize `comp-common-supertype', Andrea Corallo, 2020/11/12