mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-13 12:52:08 -08:00
Add a type update phase for variables in LET forms
This commit is contained in:
parent
4f2d4679d3
commit
d276d2e2ea
1 changed files with 15 additions and 0 deletions
|
|
@ -181,6 +181,12 @@
|
|||
(member v (rest i)))
|
||||
(return t))))
|
||||
|
||||
(defun update-variable-type (var form)
|
||||
(unless (or (var-set-nodes var)
|
||||
(unboxed var))
|
||||
(setf (var-type var)
|
||||
(type-and (var-type var) (c1form-primary-type form)))))
|
||||
|
||||
(defun c2let (vars forms body
|
||||
&aux (block-p nil) (bindings nil)
|
||||
initials
|
||||
|
|
@ -189,6 +195,10 @@
|
|||
(*env-lvl* *env-lvl*) env-grows)
|
||||
(declare (type boolean block-p))
|
||||
|
||||
;; FIXME! Until we switch on the type propagation phase we do
|
||||
;; this little optimization here
|
||||
(mapc 'update-variable-type vars forms)
|
||||
|
||||
;; Allocation is needed for:
|
||||
;; 1. each variable which is LOCAL and which is not REPLACED
|
||||
;; or whose value is not DISCARDED
|
||||
|
|
@ -320,6 +330,11 @@
|
|||
(*env* *env*)
|
||||
(*env-lvl* *env-lvl*) env-grows)
|
||||
(declare (type boolean block-p))
|
||||
|
||||
;; FIXME! Until we switch on the type propagation phase we do
|
||||
;; this little optimization here
|
||||
(mapc 'update-variable-type vars forms)
|
||||
|
||||
(do ((vl vars (cdr vl))
|
||||
(fl forms (cdr fl))
|
||||
(var) (form) (kind))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue