diff --git a/basis/compiler/cfg/builder/blocks/blocks.factor b/basis/compiler/cfg/builder/blocks/blocks.factor index 293c3fe09b..82af0f9b30 100644 --- a/basis/compiler/cfg/builder/blocks/blocks.factor +++ b/basis/compiler/cfg/builder/blocks/blocks.factor @@ -60,19 +60,14 @@ IN: compiler.cfg.builder.blocks : set-successors ( branches -- ) ! Set the successor of each branch's final basic block to the ! current block. - basic-block get dup [ - '[ [ [ _ ] dip first successors>> push ] when* ] each - ] [ 2drop ] if ; - -: merge-heights ( branches -- ) - ! If all elements are f, that means every branch ended with a backward - ! jump so the height is irrelevant since this block is unreachable. - [ ] find nip [ second current-height set ] [ end-basic-block ] if* ; + [ [ [ basic-block get ] dip first successors>> push ] when* ] each ; : emit-conditional ( branches -- ) ! branches is a sequence of pairs as above end-basic-block - [ merge-heights begin-basic-block ] - [ set-successors ] - bi ; + dup [ ] find nip dup [ + second current-height set + begin-basic-block + set-successors + ] [ 2drop ] if ;