"Emits a call to the given word to the " { $link cfg } " being constructed. \"height\" is the number of items being added to or removed from the data stack."
$nl
"Side effects of the word is that it modifies the \"basic-block\" and " { $link height-state } " variables."
{ $description "Emits CFG instructions for the given SSA node. The word can add one or more basic blocks to the " { $link cfg } ". The next block to operate on is pushed onto the stack. "
$nl
"The following classes emit-node methods does not change the current block:"
{ $list
{ $link #alien-assembly }
{ $link #alien-callback }
{ $link #alien-indirect }
}
} ;
HELP:emit-nodes
{ $values
{ "block""current " { $link basic-block } }
{ "nodes"sequence }
{ "block'" basic-block }
}
{ $description "Emits all tree nodes to the cfg. The next block to operate on is pushed onto the stack." } ;
HELP:end-word
{ $values
{ "block""current " { $link basic-block } }
{ "block'" basic-block }
}
{ $description "Ends the word by adding a basic block containing a " { $link ##return } " instructions to the " { $link cfg } "." } ;
{ $description "Checks whether nodes is a trivial branch or not. The branch is counted as trivial if all it does is push a literal value on the stack." }
{ $values { "nodes"sequence } { "word" word } { "label" word } { "quot" quotation } }
{ $description "Combinator used to begin and end stack analysis so that the given quotation can build the cfg. The quotation is passed the initial basic block on the stack." } ;
"The compiler first builds an SSA IR tree of the word to be compiled (see " { $vocab-link "compiler.tree.builder" } ") then this vocab converts it to a CFG IR tree. The result is not in SSA form; this is constructed later by calling compiler.cfg.ssa.construction:construct-ssa."
"Each tree node type has its own implementation of the " { $link emit-node } " generic. In that word, cfg instructions (tuples prefixed with ##) are outputted to basic blocks and the cfg constructed."