 : emit-nodes ( nodes -- )
     [ current-node emit-node check-basic-block ] iterate-nodes
     finalize-phantoms ;
-
-: remember-loop ( label -- )
-    basic-block get swap loops get set-at ;
 
 : begin-word ( -- )
     #! We store the basic block after the prologue as a loop

    ##prologue
    ##branch
    begin-basic-block
    current-label get remember-loop ;

: (build-cfg) ( nodes word label -- )
    [

M: #return-recursive emit-node
    finalize-phantoms
    label>> id>> loops get key?
    [ iterate-next ] [ ##epilogue ##return stop-iterating ] if ;

! #terminate
M: #terminate emit-node
