aboutsummaryrefslogtreecommitdiff
path: root/src/interp/g-util.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-12-11 19:57:34 +0000
committerdos-reis <gdr@axiomatics.org>2011-12-11 19:57:34 +0000
commit2159e0cec3aa62a8822f1f42f0d14b55df445676 (patch)
tree51fc54b8838ba03a8bc7b8f4e4af28849969b668 /src/interp/g-util.boot
parentd60b0772098f0907850b7cc520224a1bfb093e44 (diff)
downloadopen-axiom-2159e0cec3aa62a8822f1f42f0d14b55df445676.tar.gz
* interp/g-opt.boot (inlineLocals!): Single-used temporaries should go.
(spliceSeqArgs): Splice sequences drapped in %scope cloths too.
Diffstat (limited to 'src/interp/g-util.boot')
-rw-r--r--src/interp/g-util.boot10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 8313c000..3b1782f9 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -96,15 +96,19 @@ splitAssignments! u == main(u,nil) where
++ an %exit-form in it. In particular, it should be called
++ (if at all) before any call to simplifyVMForm.
spliceSeqArgs l ==
- atomic? l => l
+ l = nil => l
s := first l
s is ['%seq,:.] =>
stmts := spliceSeqArgs s.args
stmts = nil => spliceSeqArgs rest l
lastNode(stmts).rest := spliceSeqArgs rest l
stmts
- s is ['%LET,x,y] and (stmts := splitAssignments y) =>
- lastNode(stmts).rest := [['%LET,x,second y],:spliceSeqArgs rest l]
+ s is ['%scope,tag,['%seq,:ys,['%leave,=tag,z]]] and hasNoLeave?(ys,tag) =>
+ stmts := spliceSeqArgs [:ys,z]
+ lastNode(stmts).rest := spliceSeqArgs rest l
+ stmts
+ s is ['%LET,:.] and (stmts := splitAssignments! s) =>
+ lastNode(stmts).rest := [s,:spliceSeqArgs rest l]
stmts
rest l = nil => l
l.rest := spliceSeqArgs rest l