cmp: constants: get rid of an edge case where we return a list

This commit is contained in:
Daniel Kochmański 2023-06-27 12:20:59 +02:00
parent 5427ba657b
commit ba3afa81f3
2 changed files with 4 additions and 7 deletions

View file

@ -19,9 +19,9 @@
(defun make-single-constant-optimizer (name c-value)
(cond ((symbolp name)
(let* ((value (symbol-value name))
(type (lisp-type->rep-type (type-of value))))
(cons value `(ffi:c-inline () () ,type ,c-value
:one-liner t :side-effects nil))))
(type (lisp-type->rep-type (type-of value)))
(location (make-vv :location c-value :value value :rep-type type)))
(cons value (make-c1form* 'LOCATION :type type :args location))))
((floatp name)
(let* ((value name)
(type (type-of value))

View file

@ -128,10 +128,7 @@
((ext:when-let ((x (assoc val *optimizable-constants*)))
(pushnew "#include <float.h>" *clines-string-list*)
(pushnew "#include <complex.h>" *clines-string-list*)
(setf x (cdr x))
(if (listp x)
(c1expr x)
x)))
(cdr x)))
((eq val nil) (c1nil))
((eq val t) (c1t))
((ext:fixnump val)