(remove-from-dfo block)
(values))
-;;; Do stuff to indicate that the return node Node is being deleted.
-;;; We set the RETURN to NIL.
+;;; Do stuff to indicate that the return node NODE is being deleted.
(defun delete-return (node)
(declare (type creturn node))
- (let ((fun (return-lambda node)))
+ (let* ((fun (return-lambda node))
+ (tail-set (lambda-tail-set fun)))
(aver (lambda-return fun))
- (setf (lambda-return fun) nil))
+ (setf (lambda-return fun) nil)
+ (when (and tail-set (not (find-if #'lambda-return (tail-set-funs tail-set))))
+ (setf (tail-set-type tail-set) *empty-type*)))
(values))
;;; If any of the VARS in FUN was never referenced and was not
(append before-args inside-args after-args))
(change-ref-leaf (continuation-use inside-fun)
(find-free-fun 'list "???"))
- (setf (combination-kind inside) :full)
+ (setf (combination-kind inside)
+ (info :function :info 'list))
(setf (node-derived-type inside) *wild-type*)
(flush-dest cont)
(setf (continuation-asserted-type cont) *wild-type*)
(setf (continuation-type-to-check cont) *wild-type*)
(values))))))
+
+(defun flush-combination (combination)
+ (declare (type combination combination))
+ (flush-dest (combination-fun combination))
+ (dolist (arg (combination-args combination))
+ (flush-dest arg))
+ (unlink-node combination)
+ (values))
+
\f
;;;; leaf hackery
(setf (ref-leaf ref) leaf)
(setf (leaf-ever-used leaf) t)
(let ((ltype (leaf-type leaf)))
- (if (fun-type-p ltype)
+ (if (let* ((cont (node-cont ref))
+ (dest (continuation-dest cont)))
+ (and (basic-combination-p dest)
+ (eq cont (basic-combination-fun dest))))
(setf (node-derived-type ref) ltype)
(derive-node-type ref ltype)))
(reoptimize-continuation (node-cont ref)))
:type (ctype-of object)
:where-from :defined)))
\f
+;;; Return true if VAR would have to be closed over if environment
+;;; analysis ran now (i.e. if there are any uses that have a different
+;;; home lambda than VAR's home.)
+(defun closure-var-p (var)
+ (declare (type lambda-var var))
+ (let ((home (lambda-var-home var)))
+ (cond ((eq (functional-kind home) :deleted)
+ nil)
+ (t (let ((home (lambda-home home)))
+ (flet ((frob (l)
+ (find home l :key #'node-home-lambda
+ :test-not #'eq)))
+ (or (frob (leaf-refs var))
+ (frob (basic-var-sets var)))))))))
+
;;; If there is a non-local exit noted in ENTRY's environment that
;;; exits to CONT in that entry, then return it, otherwise return NIL.
(defun find-nlx-info (entry cont)