compiler.cfg.builder.blocks: removes assignments to basic-block variable
Now it isn't used at all in the cfg creation step.db4
parent
9df955e199
commit
b27634bff7
|
@ -5,22 +5,21 @@ IN: compiler.cfg.builder.blocks
|
||||||
<<
|
<<
|
||||||
STRING: ex-emit-trivial-block
|
STRING: ex-emit-trivial-block
|
||||||
USING: compiler.cfg.builder.blocks make prettyprint ;
|
USING: compiler.cfg.builder.blocks make prettyprint ;
|
||||||
<basic-block> set-basic-block [ [ gensym ##call, ] emit-trivial-block ] { } make drop basic-block get .
|
begin-stack-analysis <basic-block> dup set-basic-block [ gensym ##call, drop ] emit-trivial-block predecessors>> first .
|
||||||
T{ basic-block
|
T{ basic-block
|
||||||
{ id 2040412 }
|
{ instructions
|
||||||
|
V{ T{ ##call { word ( gensym ) } } T{ ##branch } }
|
||||||
|
}
|
||||||
{ successors
|
{ successors
|
||||||
|
V{
|
||||||
|
T{ basic-block { predecessors V{ ~circularity~ } } }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{ predecessors
|
||||||
V{
|
V{
|
||||||
T{ basic-block
|
T{ basic-block
|
||||||
{ id 2040413 }
|
{ instructions V{ T{ ##branch } } }
|
||||||
{ instructions
|
{ successors V{ ~circularity~ } }
|
||||||
V{
|
|
||||||
T{ ##call { word ( gensym ) } }
|
|
||||||
T{ ##branch }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
{ successors
|
|
||||||
V{ T{ basic-block { id 2040414 } } }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
USING: accessors compiler.cfg compiler.cfg.builder.blocks
|
USING: accessors compiler.cfg compiler.cfg.builder.blocks
|
||||||
compiler.cfg.instructions compiler.cfg.stacks.local
|
compiler.cfg.instructions compiler.cfg.stacks.local
|
||||||
compiler.cfg.utilities compiler.test kernel make namespaces sequences
|
compiler.cfg.utilities compiler.test kernel namespaces sequences
|
||||||
tools.test ;
|
tools.test ;
|
||||||
IN: compiler.cfg.builder.blocks.tests
|
IN: compiler.cfg.builder.blocks.tests
|
||||||
|
|
||||||
|
|
|
@ -1,19 +1,17 @@
|
||||||
! Copyright (C) 2009, 2010 Slava Pestov.
|
! Copyright (C) 2009, 2010 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors arrays compiler.cfg compiler.cfg.instructions
|
USING: accessors arrays compiler.cfg compiler.cfg.instructions
|
||||||
compiler.cfg.stacks compiler.cfg.stacks.local compiler.cfg.utilities fry kernel
|
compiler.cfg.stacks compiler.cfg.stacks.local compiler.cfg.utilities
|
||||||
make math namespaces sequences ;
|
kernel make math namespaces sequences ;
|
||||||
SLOT: in-d
|
SLOT: in-d
|
||||||
SLOT: out-d
|
SLOT: out-d
|
||||||
IN: compiler.cfg.builder.blocks
|
IN: compiler.cfg.builder.blocks
|
||||||
|
|
||||||
: set-basic-block ( basic-block -- )
|
: set-basic-block ( basic-block -- )
|
||||||
[ basic-block set ]
|
[ instructions>> building set ] [ begin-local-analysis ] bi ;
|
||||||
[ instructions>> building set ]
|
|
||||||
[ begin-local-analysis ] tri ;
|
|
||||||
|
|
||||||
: end-basic-block ( block -- )
|
: end-basic-block ( block -- )
|
||||||
[ end-local-analysis ] when* building off basic-block off ;
|
[ end-local-analysis ] when* building off ;
|
||||||
|
|
||||||
: (begin-basic-block) ( block -- block' )
|
: (begin-basic-block) ( block -- block' )
|
||||||
<basic-block> swap [ over connect-bbs ] when* dup set-basic-block ;
|
<basic-block> swap [ over connect-bbs ] when* dup set-basic-block ;
|
||||||
|
|
|
@ -254,7 +254,7 @@ SYMBOL: foo
|
||||||
! emit-branch
|
! emit-branch
|
||||||
{ 77 } [
|
{ 77 } [
|
||||||
{ T{ #call { word + } } }
|
{ T{ #call { word + } } }
|
||||||
V{ } 77 insns>block dup basic-block set
|
V{ } 77 insns>block
|
||||||
emit-branch
|
emit-branch
|
||||||
first predecessors>>
|
first predecessors>>
|
||||||
first predecessors>>
|
first predecessors>>
|
||||||
|
@ -377,9 +377,7 @@ SYMBOL: foo
|
||||||
T{ ##return }
|
T{ ##return }
|
||||||
}
|
}
|
||||||
} [
|
} [
|
||||||
[
|
<basic-block> dup set-basic-block end-word instructions>>
|
||||||
<basic-block> dup set-basic-block end-word
|
|
||||||
] V{ } make drop instructions>>
|
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue