compiler.cfg.utilities: adding connect-bbs and make-edges

db4
Björn Lindqvist 2014-12-10 23:53:35 +01:00
parent 00e2d9f116
commit 628c87c5b1
2 changed files with 8 additions and 8 deletions

View File

@ -177,13 +177,6 @@ IN: compiler.cfg.stacks.vacant.tests
{ { 0 { -1 } } } [ cfg1 output-stack-map first ] unit-test
: connect-bbs ( from to -- )
[ [ successors>> ] dip suffix! drop ]
[ predecessors>> swap suffix! drop ] 2bi ;
: make-edges ( block-map edgelist -- )
[ [ of ] with map first2 connect-bbs ] with each ;
! Same cfg structure as the bug1021:run-test word but with
! non-datastack instructions mostly omitted.
: bug1021-cfg ( -- cfg )

View File

@ -86,3 +86,10 @@ IN: compiler.cfg.utilities
: apply-passes ( obj passes -- )
[ execute( x -- ) ] with each ;
: connect-bbs ( from to -- )
[ [ successors>> ] dip suffix! drop ]
[ predecessors>> swap suffix! drop ] 2bi ;
: make-edges ( block-map edgelist -- )
[ [ of ] with map first2 connect-bbs ] with each ;