From 7a71e20b95b9665665176715d75770d4cc72092a Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 20 Jul 1988 07:37:29 +0000 Subject: [PATCH] It is now legal for a continuation to have a noop node as its entry, 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 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/v7/src/compiler/fgopt/order.scm b/v7/src/compiler/fgopt/order.scm index 7ced60ebc..168b4ea0c 100644 --- a/v7/src/compiler/fgopt/order.scm +++ b/v7/src/compiler/fgopt/order.scm @@ -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 -- 2.25.1