]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/compiler/cfg/dataflow-analysis/dataflow-analysis.factor
stomp.cli: simplify
[factor.git] / basis / compiler / cfg / dataflow-analysis / dataflow-analysis.factor
index e85315d1197bfed05b7a137aa3492f641db21562..3e7ce5000c882ad2ca71a801e89019811e7741e5 100644 (file)
@@ -1,8 +1,9 @@
 ! Copyright (C) 2009 Slava Pestov.
-! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs combinators.short-circuit compiler.cfg.predecessors
-compiler.cfg.rpo compiler.cfg.utilities deques dlists functors kernel lexer
-locals namespaces sequences ;
+! See https://factorcode.org/license.txt for BSD license.
+USING: accessors assocs combinators.short-circuit
+compiler.cfg.predecessors compiler.cfg.rpo
+compiler.cfg.utilities deques dlists functors kernel lexer
+namespaces sequences ;
 IN: compiler.cfg.dataflow-analysis
 
 GENERIC: join-sets ( sets bb dfa -- set )
@@ -54,10 +55,10 @@ MIXIN: dataflow-analysis
     in-sets
     out-sets ; inline
 
-M: dataflow-analysis join-sets 2drop assoc-refine ;
+M: dataflow-analysis join-sets 2drop assoc-intersect-all ;
 M: dataflow-analysis ignore-block? drop kill-block?>> ;
 
-FUNCTOR: define-analysis ( name -- )
+<FUNCTOR: define-analysis ( name -- )
 
 name DEFINES-CLASS ${name}
 name-ins DEFINES ${name}-ins
@@ -77,7 +78,7 @@ SYMBOL: name-outs
 
 : name-out ( bb -- set ) name-outs get at ;
 
-;FUNCTOR
+;FUNCTOR>
 
 ! ! ! Forward dataflow analysis
 
@@ -88,7 +89,7 @@ M: forward-analysis block-order  drop reverse-post-order ;
 M: forward-analysis successors   drop successors>> ;
 M: forward-analysis predecessors drop predecessors>> ;
 
-FUNCTOR: define-forward-analysis ( name -- )
+<FUNCTOR: define-forward-analysis ( name -- )
 
 name IS ${name}
 name-ins IS ${name}-ins
@@ -103,7 +104,7 @@ INSTANCE: name forward-analysis
     name run-dataflow-analysis
     [ name-ins set ] [ name-outs set ] bi* ;
 
-;FUNCTOR
+;FUNCTOR>
 
 ! ! ! Backward dataflow analysis
 
@@ -114,7 +115,7 @@ M: backward-analysis block-order  drop post-order ;
 M: backward-analysis successors   drop predecessors>> ;
 M: backward-analysis predecessors drop successors>> ;
 
-FUNCTOR: define-backward-analysis ( name -- )
+<FUNCTOR: define-backward-analysis ( name -- )
 
 name IS ${name}
 name-ins IS ${name}-ins
@@ -129,7 +130,7 @@ INSTANCE: name backward-analysis
     \ name run-dataflow-analysis
     [ name-outs set ] [ name-ins set ] bi* ;
 
-;FUNCTOR
+;FUNCTOR>
 
 PRIVATE>