From: David Vázquez Date: Sun, 12 May 2013 13:58:47 +0000 (+0100) Subject: Fix ir-complete X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=fc74a350c8382575b8e924e60cdaf5033e70d49e;p=jscl.git Fix ir-complete --- diff --git a/experimental/compiler.lisp b/experimental/compiler.lisp index 30e8d4a..388157f 100644 --- a/experimental/compiler.lisp +++ b/experimental/compiler.lisp @@ -339,6 +339,11 @@ `(dolist (,block (component-blocks ,component) ,result) ,@body)) +(defmacro do-blocks-backward ((block component &optional result) &body body) + `(dolist (,block (reverse (component-blocks ,component)) ,result) + ,@body)) + + ;;; A few consistency checks in the IR useful for catching bugs. (defun check-ir-consistency (component) (with-simple-restart (continue "Continue execution") @@ -623,7 +628,7 @@ t)))) (defun ir-complete (&optional (component *component*)) - (do-blocks (block component) + (do-blocks-backward (block component) (maybe-coalesce-block block) (when (empty-block-p block) (delete-empty-block block))))