Block: Functions to create and manipulate an LLVM BasicBlock

View source: R/block.R

BlockR Documentation

Functions to create and manipulate an LLVM BasicBlock

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)
getLandingPadInst(block)

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, block

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.

Author(s)

Duncan Temple Lang

References

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

See Also

IRBuilder


duncantl/Rllvm documentation built on April 23, 2024, 6:14 p.m.