llvm_hiwrap.value.basic_block

Members

Functions

isTerminator
bool isTerminator(LxOpcode op)

Note that isTerminator and isCall overlap.

Structs

BasicBlock
struct BasicBlock

A basic block represents a single entry single exit section of code.

BasicBlockVisitor
struct BasicBlockVisitor(UserT)

A depth-first visitor.

Meta

Authors

Joakim Brännström (joakim.brannstrom@gmx.com)

From the LLVM source code, llvm/IR/BasicBlock.h

LLVM Basic Block Representation

This represents a single basic block in LLVM. A basic block is simply a container of instructions that execute sequentially. Basic blocks are Values because they are referenced by instructions such as branches and switch tables. The type of a BasicBlock is "Type::LabelTy" because the basic block represents a label to which a branch can jump.

A well formed basic block is formed of a list of non-terminating instructions followed by a single TerminatorInst instruction. TerminatorInst's may not occur in the middle of basic blocks, and must terminate the blocks. The BasicBlock class allows malformed basic blocks to occur because it may be useful in the intermediate stage of constructing or modifying a program. However, the verifier will ensure that basic blocks are "well formed".