Learn R Programming

Rllvm (version 0.7-0)

Block: Create an LLVM block

Description

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.

Usage

Block(fun, id = character(), context = getGlobalContext(), n = 1)
getPredecessor(x, single = TRUE)
getSuccessor(x, single = TRUE)

Arguments

fun

the function for which this block is to be created

id

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.

context

the LLVM context in which to create the block

n

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.

x

a BasicBlock object

single

a logical value, indicating whether to use the getSinglePredecessor method or getUniquePredecessor method, or the same distinction for a successor.

Value

An object of class Block.

References

LLVM Documentation http://llvm.org/docs/

See Also

IRBuilder