The
Block
class represents a basic block of code within the program. A basic block contains a straight-line piece of code that ends with a control instruction (e.g. a skip, a jump, a branch, or a call) or an implicit fall-through to the next basic block. It contains at most two references to successor basic blocks.
For
fallthroughs (no ending control instruction), the
next
field refers to the block immediately following this block, and the
other
field is null.
For
jumps, the
other
field refers to the block that is the target of the jump, and the
next
field is null.
For
skips,
branches, and
calls, the
next
field refers to the block immediately following this block (i.e. not-taken for branches, the return address for calls). The
other
field refers to the target address of the branch if it is taken or the address to be called.
For
indirect jumps both the
next
and
other
fields are null.
For
indirect calls the
next
field refers to the block immediately following this block (i.e. the return address). The
other
field is null because the target of the call cannot be known.