The ID of the entry node.
Normal exit node, if exists.
This would be the next statement after the current one in the source code.
For control-flow statements (like return
, break
, etc.) we won't have
an exit
, as the control-flow doesn't reach it.
Similarly, blocks ending with a flow-altering statement won't have an exit.
Optional
continuesThe active continue
nodes within this block.
A continue
is active if it's target is outside the current block.
Optional
breaksThe active break
nodes within this block.
Optional
labelsAll the labels within this block.
The mapping is from the label's name to the labeled node.
Optional
gotosAll the active goto
s within this block.
Active goto
s are one that were not yet resolved.
Optional
functionAll the function-exit statements within the block.
As the CFG is a single-function graph, function-exit statements are never
resolved within it.
This includes things like return
and throw
and raise
.
The
BasicBlock
is used in the process of building a CFG. It is meant to represent a "statement" or "block" of source-code.It allows us to abstract over individual CFG nodes and work with something that's closer to the source code.
BasicBlocks
s can be nested, just like code structures. If we have aBasicBlock
representing anif
statement, it will haveBasicBlock
s for the individual statements nested within it.Each
BasicBlock
can span many CFG nodes.