mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-21 12:03:40 -08:00
cmp: inl: tighter type bounds for inlined arguments
Also improve PRECISE-LOC-LISP-TYPE to AND both types instead of picking the "new type".
This commit is contained in:
parent
e97d3c6219
commit
2690dde0d3
2 changed files with 13 additions and 16 deletions
|
|
@ -132,19 +132,15 @@
|
|||
|
||||
(defun emit-inline-form (form forms)
|
||||
(with-c1form-env (form form)
|
||||
(case (c1form-name form)
|
||||
(LOCATION
|
||||
(precise-loc-lisp-type (c1form-arg 0 form) (c1form-primary-type form)))
|
||||
(VARIABLE
|
||||
(emit-inlined-variable form forms))
|
||||
(SETQ
|
||||
(emit-inlined-setq form forms))
|
||||
(PROGN
|
||||
(emit-inlined-progn form forms))
|
||||
(VALUES
|
||||
(emit-inlined-values form forms))
|
||||
(t
|
||||
(emit-inlined-temp-var form (c1form-primary-type form) :object)))))
|
||||
(precise-loc-lisp-type
|
||||
(case (c1form-name form)
|
||||
(LOCATION (c1form-arg 0 form) )
|
||||
(VARIABLE (emit-inlined-variable form forms))
|
||||
(SETQ (emit-inlined-setq form forms))
|
||||
(PROGN (emit-inlined-progn form forms))
|
||||
(VALUES (emit-inlined-values form forms))
|
||||
(t (emit-inlined-temp-var form t :object)))
|
||||
(c1form-primary-type form))))
|
||||
|
||||
;;;
|
||||
;;; inline-args:
|
||||
|
|
|
|||
|
|
@ -155,9 +155,10 @@
|
|||
;;; CL-VA-ARG
|
||||
|
||||
(defun precise-loc-lisp-type (loc new-type)
|
||||
(if (subtypep (loc-lisp-type loc) new-type)
|
||||
loc
|
||||
`(the ,new-type ,loc)))
|
||||
(let ((loc-type (loc-lisp-type loc)))
|
||||
(if (subtypep loc-type new-type)
|
||||
loc
|
||||
`(the ,(type-and loc-type new-type) ,loc))))
|
||||
|
||||
(defun loc-in-c1form-movable-p (loc)
|
||||
"A location that is in a C1FORM and can be moved"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue