]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.cfg.phi-elimination: move some utilities from compiler.cfg.utilities here...
authorSlava Pestov <slava@shill.local>
Fri, 24 Jul 2009 21:45:31 +0000 (16:45 -0500)
committerSlava Pestov <slava@shill.local>
Fri, 24 Jul 2009 21:45:31 +0000 (16:45 -0500)
basis/compiler/cfg/phi-elimination/phi-elimination.factor
basis/compiler/cfg/utilities/utilities.factor

index 7e73f0b8549408b5ace81c58a60c85f2f3b01e19..38e82176cae63106238c164c58d6a8e7cc94841c 100644 (file)
@@ -6,6 +6,20 @@ compiler.cfg.utilities compiler.cfg.hats make
 locals ;
 IN: compiler.cfg.phi-elimination
 
+! assoc mapping predecessors to sequences
+SYMBOL: added-instructions
+
+: add-instructions ( predecessor quot -- )
+    [
+        added-instructions get
+        [ drop V{ } clone ] cache
+        building
+    ] dip with-variable ; inline
+
+: insert-basic-blocks ( bb -- )
+    [ added-instructions get ] dip
+    '[ [ _ ] dip <simple-block> insert-basic-block ] assoc-each ;
+
 : insert-copy ( predecessor input output -- )
     '[ _ _ swap ##copy ] add-instructions ;
 
index ad3ee9c57ba48a3a22e7880bae746e1452e7ce13..4b0468b911cc19a9229970c0541b328de4de128e 100644 (file)
@@ -48,16 +48,6 @@ SYMBOL: visited
 : skip-empty-blocks ( bb -- bb' )
     H{ } clone visited [ (skip-empty-blocks) ] with-variable ;
 
-! assoc mapping predecessors to sequences
-SYMBOL: added-instructions
-
-: add-instructions ( predecessor quot -- )
-    [
-        added-instructions get
-        [ drop V{ } clone ] cache
-        building
-    ] dip with-variable ; inline
-
 :: insert-basic-block ( from to bb -- )
     bb from 1vector >>predecessors drop
     bb to 1vector >>successors drop
@@ -69,7 +59,3 @@ SYMBOL: added-instructions
     swap >vector
     \ ##branch new-insn over push
     >>instructions ;
-
-: insert-basic-blocks ( bb -- )
-    [ added-instructions get ] dip
-    '[ [ _ ] dip <simple-block> insert-basic-block ] assoc-each ;