Add a type update phase for variables in LET forms

This commit is contained in:
Juan Jose Garcia Ripoll 2010-05-19 09:48:28 +02:00
parent 4f2d4679d3
commit d276d2e2ea

View file

@ -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))