Blocks are labelled collections of statements/commands
in LLVM. When creating an LLVM routine
we use blocks so that we can branch between them.
For example, a loop will typically have a body block
and condition block. A function will have an entry block
in which local variables are allocated and initialized
and then we branch to another block.
Block
allows us to create a block within
the specified function being created.
Block(fun, id = character(), context = getGlobalContext(), n = 1)
getPredecessor(x, single = TRUE)
getSuccessor(x, single = TRUE)
the function for which this block is to be created
a block can have a label or name which is used
to identify the block when "dumping" the code in its IR form.
This is just to make the code more readable to humans. The label
can be the same or very different from the R variable used to
store the Block
object.
the LLVM context in which to create the block
the number of blocks to create. This is currently ignored. The idea is that we can create multiple blocks in a single call for convenience.
a BasicBlock
object
a logical value, indicating whether to use the getSinglePredecessor method or getUniquePredecessor method, or the same distinction for a successor.
An object of class Block
.
LLVM Documentation http://llvm.org/docs/