Project Alice
Loading...
Searching...
No Matches
Collaboration diagram for Basic Block:

Functions

LLVMValueRef LLVMBasicBlockAsValue (LLVMBasicBlockRef BB)
 
LLVMBool LLVMValueIsBasicBlock (LLVMValueRef Val)
 
LLVMBasicBlockRef LLVMValueAsBasicBlock (LLVMValueRef Val)
 
const char * LLVMGetBasicBlockName (LLVMBasicBlockRef BB)
 
LLVMValueRef LLVMGetBasicBlockParent (LLVMBasicBlockRef BB)
 
LLVMValueRef LLVMGetBasicBlockTerminator (LLVMBasicBlockRef BB)
 
unsigned LLVMCountBasicBlocks (LLVMValueRef Fn)
 
void LLVMGetBasicBlocks (LLVMValueRef Fn, LLVMBasicBlockRef *BasicBlocks)
 
LLVMBasicBlockRef LLVMGetFirstBasicBlock (LLVMValueRef Fn)
 
LLVMBasicBlockRef LLVMGetLastBasicBlock (LLVMValueRef Fn)
 
LLVMBasicBlockRef LLVMGetNextBasicBlock (LLVMBasicBlockRef BB)
 
LLVMBasicBlockRef LLVMGetPreviousBasicBlock (LLVMBasicBlockRef BB)
 
LLVMBasicBlockRef LLVMGetEntryBasicBlock (LLVMValueRef Fn)
 
void LLVMInsertExistingBasicBlockAfterInsertBlock (LLVMBuilderRef Builder, LLVMBasicBlockRef BB)
 
void LLVMAppendExistingBasicBlock (LLVMValueRef Fn, LLVMBasicBlockRef BB)
 
LLVMBasicBlockRef LLVMCreateBasicBlockInContext (LLVMContextRef C, const char *Name)
 
LLVMBasicBlockRef LLVMAppendBasicBlockInContext (LLVMContextRef C, LLVMValueRef Fn, const char *Name)
 
LLVMBasicBlockRef LLVMAppendBasicBlock (LLVMValueRef Fn, const char *Name)
 
LLVMBasicBlockRef LLVMInsertBasicBlockInContext (LLVMContextRef C, LLVMBasicBlockRef BB, const char *Name)
 
LLVMBasicBlockRef LLVMInsertBasicBlock (LLVMBasicBlockRef InsertBeforeBB, const char *Name)
 
void LLVMDeleteBasicBlock (LLVMBasicBlockRef BB)
 
void LLVMRemoveBasicBlockFromParent (LLVMBasicBlockRef BB)
 
void LLVMMoveBasicBlockBefore (LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
 
void LLVMMoveBasicBlockAfter (LLVMBasicBlockRef BB, LLVMBasicBlockRef MovePos)
 
LLVMValueRef LLVMGetFirstInstruction (LLVMBasicBlockRef BB)
 
LLVMValueRef LLVMGetLastInstruction (LLVMBasicBlockRef BB)
 

Detailed Description

A basic block represents a single entry single exit section of code. Basic blocks contain a list of instructions which form the body of the block.

Basic blocks belong to functions. They have the type of label.

Basic blocks are themselves values. However, the C API models them as LLVMBasicBlockRef.

See also
llvm::BasicBlock

Function Documentation

◆ LLVMAppendBasicBlock()

LLVMBasicBlockRef LLVMAppendBasicBlock ( LLVMValueRef  Fn,
const char *  Name 
)

Append a basic block to the end of a function using the global context.

See also
llvm::BasicBlock::Create()

◆ LLVMAppendBasicBlockInContext()

LLVMBasicBlockRef LLVMAppendBasicBlockInContext ( LLVMContextRef  C,
LLVMValueRef  Fn,
const char *  Name 
)

Append a basic block to the end of a function.

See also
llvm::BasicBlock::Create()
Here is the caller graph for this function:

◆ LLVMAppendExistingBasicBlock()

void LLVMAppendExistingBasicBlock ( LLVMValueRef  Fn,
LLVMBasicBlockRef  BB 
)

Append the given basic block to the basic block list of the given function.

See also
llvm::Function::BasicBlockListType::push_back()
Here is the caller graph for this function:

◆ LLVMBasicBlockAsValue()

LLVMValueRef LLVMBasicBlockAsValue ( LLVMBasicBlockRef  BB)

Convert a basic block instance to a value type.

◆ LLVMCountBasicBlocks()

unsigned LLVMCountBasicBlocks ( LLVMValueRef  Fn)

Obtain the number of basic blocks in a function.

Parameters
FnFunction value to operate on.

◆ LLVMCreateBasicBlockInContext()

LLVMBasicBlockRef LLVMCreateBasicBlockInContext ( LLVMContextRef  C,
const char *  Name 
)

Create a new basic block without inserting it into a function.

See also
llvm::BasicBlock::Create()
Here is the caller graph for this function:

◆ LLVMDeleteBasicBlock()

void LLVMDeleteBasicBlock ( LLVMBasicBlockRef  BB)

Remove a basic block from a function and delete it.

This deletes the basic block from its containing function and deletes the basic block itself.

See also
llvm::BasicBlock::eraseFromParent()

◆ LLVMGetBasicBlockName()

const char * LLVMGetBasicBlockName ( LLVMBasicBlockRef  BB)

Obtain the string name of a basic block.

◆ LLVMGetBasicBlockParent()

LLVMValueRef LLVMGetBasicBlockParent ( LLVMBasicBlockRef  BB)

Obtain the function to which a basic block belongs.

See also
llvm::BasicBlock::getParent()

◆ LLVMGetBasicBlocks()

void LLVMGetBasicBlocks ( LLVMValueRef  Fn,
LLVMBasicBlockRef BasicBlocks 
)

Obtain all of the basic blocks in a function.

This operates on a function value. The BasicBlocks parameter is a pointer to a pre-allocated array of LLVMBasicBlockRef of at least LLVMCountBasicBlocks() in length. This array is populated with LLVMBasicBlockRef instances.

◆ LLVMGetBasicBlockTerminator()

LLVMValueRef LLVMGetBasicBlockTerminator ( LLVMBasicBlockRef  BB)

Obtain the terminator instruction for a basic block.

If the basic block does not have a terminator (it is not well-formed if it doesn't), then NULL is returned.

The returned LLVMValueRef corresponds to an llvm::Instruction.

See also
llvm::BasicBlock::getTerminator()

◆ LLVMGetEntryBasicBlock()

LLVMBasicBlockRef LLVMGetEntryBasicBlock ( LLVMValueRef  Fn)

Obtain the basic block that corresponds to the entry point of a function.

See also
llvm::Function::getEntryBlock()

◆ LLVMGetFirstBasicBlock()

LLVMBasicBlockRef LLVMGetFirstBasicBlock ( LLVMValueRef  Fn)

Obtain the first basic block in a function.

The returned basic block can be used as an iterator. You will likely eventually call into LLVMGetNextBasicBlock() with it.

See also
llvm::Function::begin()

◆ LLVMGetFirstInstruction()

LLVMValueRef LLVMGetFirstInstruction ( LLVMBasicBlockRef  BB)

Obtain the first instruction in a basic block.

The returned LLVMValueRef corresponds to a llvm::Instruction instance.

◆ LLVMGetLastBasicBlock()

LLVMBasicBlockRef LLVMGetLastBasicBlock ( LLVMValueRef  Fn)

Obtain the last basic block in a function.

See also
llvm::Function::end()

◆ LLVMGetLastInstruction()

LLVMValueRef LLVMGetLastInstruction ( LLVMBasicBlockRef  BB)

Obtain the last instruction in a basic block.

The returned LLVMValueRef corresponds to an LLVM:Instruction.

◆ LLVMGetNextBasicBlock()

LLVMBasicBlockRef LLVMGetNextBasicBlock ( LLVMBasicBlockRef  BB)

Advance a basic block iterator.

◆ LLVMGetPreviousBasicBlock()

LLVMBasicBlockRef LLVMGetPreviousBasicBlock ( LLVMBasicBlockRef  BB)

Go backwards in a basic block iterator.

◆ LLVMInsertBasicBlock()

LLVMBasicBlockRef LLVMInsertBasicBlock ( LLVMBasicBlockRef  InsertBeforeBB,
const char *  Name 
)

Insert a basic block in a function using the global context.

See also
llvm::BasicBlock::Create()

◆ LLVMInsertBasicBlockInContext()

LLVMBasicBlockRef LLVMInsertBasicBlockInContext ( LLVMContextRef  C,
LLVMBasicBlockRef  BB,
const char *  Name 
)

Insert a basic block in a function before another basic block.

The function to add to is determined by the function of the passed basic block.

See also
llvm::BasicBlock::Create()

◆ LLVMInsertExistingBasicBlockAfterInsertBlock()

void LLVMInsertExistingBasicBlockAfterInsertBlock ( LLVMBuilderRef  Builder,
LLVMBasicBlockRef  BB 
)

Insert the given basic block after the insertion point of the given builder.

The insertion point must be valid.

See also
llvm::Function::BasicBlockListType::insertAfter()

◆ LLVMMoveBasicBlockAfter()

void LLVMMoveBasicBlockAfter ( LLVMBasicBlockRef  BB,
LLVMBasicBlockRef  MovePos 
)

Move a basic block to after another one.

See also
llvm::BasicBlock::moveAfter()

◆ LLVMMoveBasicBlockBefore()

void LLVMMoveBasicBlockBefore ( LLVMBasicBlockRef  BB,
LLVMBasicBlockRef  MovePos 
)

Move a basic block to before another one.

See also
llvm::BasicBlock::moveBefore()

◆ LLVMRemoveBasicBlockFromParent()

void LLVMRemoveBasicBlockFromParent ( LLVMBasicBlockRef  BB)

Remove a basic block from a function.

This deletes the basic block from its containing function but keep the basic block alive.

See also
llvm::BasicBlock::removeFromParent()

◆ LLVMValueAsBasicBlock()

LLVMBasicBlockRef LLVMValueAsBasicBlock ( LLVMValueRef  Val)

Convert an LLVMValueRef to an LLVMBasicBlockRef instance.

◆ LLVMValueIsBasicBlock()

LLVMBool LLVMValueIsBasicBlock ( LLVMValueRef  Val)

Determine whether an LLVMValueRef is itself a basic block.