diff --git a/basis/compiler/cfg/builder/blocks/blocks-docs.factor b/basis/compiler/cfg/builder/blocks/blocks-docs.factor index 7c7b2d6448..d096f7b85f 100644 --- a/basis/compiler/cfg/builder/blocks/blocks-docs.factor +++ b/basis/compiler/cfg/builder/blocks/blocks-docs.factor @@ -53,7 +53,7 @@ HELP: emit-conditional { $values { "block" basic-block } { "branches" "sequence of pairs" } - { "block'" basic-block } + { "block'/f" { $maybe basic-block } } } { $description "Emits a sequence of conditional branches to the current " { $link cfg } ". Each branch is a pair where the first item is the entry basic block and the second the branches " { $link height-state } ". 'block' is the block in which the control flow is branched and \"block'\" the block in which it converges again." } ; diff --git a/basis/compiler/cfg/builder/blocks/blocks.factor b/basis/compiler/cfg/builder/blocks/blocks.factor index 12b589e5c0..e3d3006ba5 100644 --- a/basis/compiler/cfg/builder/blocks/blocks.factor +++ b/basis/compiler/cfg/builder/blocks/blocks.factor @@ -3,12 +3,10 @@ USING: accessors arrays compiler.cfg compiler.cfg.instructions compiler.cfg.stacks compiler.cfg.stacks.local compiler.cfg.utilities kernel make math namespaces sequences ; -SLOT: in-d -SLOT: out-d IN: compiler.cfg.builder.blocks : set-basic-block ( basic-block -- ) - [ instructions>> building set ] [ begin-local-analysis ] bi ; + dup begin-local-analysis instructions>> building set ; : end-basic-block ( block -- ) [ end-local-analysis ] when* building off ; @@ -17,7 +15,7 @@ IN: compiler.cfg.builder.blocks swap [ over connect-bbs ] when* dup set-basic-block ; : begin-basic-block ( block -- block' ) - dup [ end-local-analysis ] when* (begin-basic-block) ; + dup end-basic-block (begin-basic-block) ; : emit-trivial-block ( block quot: ( ..a block' -- ..b ) -- block' ) ##branch, swap begin-basic-block @@ -52,7 +50,7 @@ IN: compiler.cfg.builder.blocks : with-branch ( block quot: ( ..a block -- ..b block' ) -- pair/f ) [ [ begin-branch ] dip call end-branch ] with-scope ; inline -: emit-conditional ( block branches -- block' ) +: emit-conditional ( block branches -- block'/f ) swap end-basic-block sift [ f ] [ dup first second height-state set