It is now legal for a continuation to have a noop node as its entry,
authorChris Hanson <org/chris-hanson/cph>
Wed, 20 Jul 1988 07:37:29 +0000 (07:37 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 20 Jul 1988 07:37:29 +0000 (07:37 +0000)
provided that the noop node has no next.  If it is a noop node,
connect to the next of the noop node rather than the entry of the
continuation.

v7/src/compiler/fgopt/order.scm

index 7ced60ebc4a742dec42b4b6f57b8c5aac72c53b3..168b4ea0cbdad5cd99d35b83f3054e1df375dd5b 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/fgopt/order.scm,v 4.5 1988/06/14 08:35:17 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/fgopt/order.scm,v 4.6 1988/07/20 07:37:29 cph Exp $
 
 Copyright (c) 1988 Massachusetts Institute of Technology
 
@@ -71,10 +71,15 @@ MIT in each case. |#
        (prefix (subproblem-prefix subproblem)))
     (if (subproblem-canonical? subproblem)
        (begin
-         (if (continuation/entry-node continuation)
-             (error "Attempt to reattach continuation body"
-                    continuation))
-         (set-continuation/entry-node! continuation rest)
+         (let ((node (continuation/entry-node continuation)))
+           (cond ((not node)
+                  (set-continuation/entry-node! continuation rest))
+                 ((and (cfg-node/noop? node)
+                       (not (snode-next-edge node)))
+                  (create-edge! node set-snode-next-edge! rest))
+                 (else
+                  (error "Attempt to reattach continuation body"
+                         continuation))))
          (cfg-entry-node prefix))
        (scfg*node->node!
         prefix