0.8.8.10:
[sbcl.git] / src / compiler / dfo.lisp
index 7739e60..195226d 100644 (file)
@@ -22,7 +22,7 @@
   (let ((head (component-head component)))
     (do ()
        ((dolist (ep (block-succ head) t)
-          (unless (block-flag ep)
+          (unless (or (block-flag ep) (block-delete-p ep))
             (find-dfo-aux ep head component)
             (return nil))))))
   (let ((num 0))
     (do-blocks-backwards (block component :both)
       (if (block-flag block)
          (setf (block-number block) (incf num))
-         (setf (block-delete-p block) t)))
-    (do-blocks (block component)
-      (when (block-delete-p block)
-       (delete-block block))))
+         (delete-block-lazily block)))
+    (clean-component component (component-head component)))
   (values))
 
 ;;; Move all the code and entry points from OLD to NEW. The code in
@@ -89,7 +87,7 @@
 (defun find-dfo-aux (block head component)
   (unless (eq (block-component block) component)
     (join-components component (block-component block)))
-  (unless (block-flag block)
+  (unless (or (block-flag block) (block-delete-p block))
     (setf (block-flag block) t)
     (dolist (succ (block-succ block))
       (find-dfo-aux succ head component))
     ;; in the old LAMBDA into the new one (with LETs implicitly moved
     ;; by changing their home.)
     (do-blocks (block component)
-      (do-nodes (node cont block)
+      (do-nodes (node nil block)
        (let ((lexenv (node-lexenv node)))
          (when (eq (lexenv-lambda lexenv) lambda)
            (setf (lexenv-lambda lexenv) result-lambda))))
       ;; Make sure the result's return node starts a block so that we
       ;; can splice code in before it.
       (let ((prev (node-prev
-                  (continuation-use
-                   (return-result result-return)))))
-       (when (continuation-use prev)
-         (node-ends-block (continuation-use prev)))
-       (do-uses (use prev)
-         (let ((new (make-continuation)))
-           (delete-continuation-use use)
-           (add-continuation-use use new))))
+                  (lvar-uses (return-result result-return)))))
+       (when (ctran-use prev)
+         (node-ends-block (ctran-use prev))))
 
       (dolist (lambda (rest lambdas))
        (merge-1-toplevel-lambda result-lambda lambda)))