|
LLVM 22.0.0git
|
A basic block represents a single entry single exit section of code. More...
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.
| LLVM_C_ABI LLVMBasicBlockRef LLVMAppendBasicBlock | ( | LLVMValueRef | Fn, |
| const char * | Name ) |
Append a basic block to the end of a function using the global context.
Definition at line 2886 of file Core.cpp.
References LLVMAppendBasicBlockInContext(), and LLVMGetGlobalContext().
| LLVM_C_ABI LLVMBasicBlockRef LLVMAppendBasicBlockInContext | ( | LLVMContextRef | C, |
| LLVMValueRef | Fn, | ||
| const char * | Name ) |
Append a basic block to the end of a function.
Definition at line 2880 of file Core.cpp.
References llvm::CallingConv::C, llvm::BasicBlock::Create(), llvm::unwrap(), and llvm::wrap().
Referenced by LLVMAppendBasicBlock().
| LLVM_C_ABI void LLVMAppendExistingBasicBlock | ( | LLVMValueRef | Fn, |
| LLVMBasicBlockRef | BB ) |
Append the given basic block to the basic block list of the given function.
Definition at line 2875 of file Core.cpp.
References llvm::unwrap().
| LLVM_C_ABI LLVMValueRef LLVMBasicBlockAsValue | ( | LLVMBasicBlockRef | BB | ) |
Convert a basic block instance to a value type.
Definition at line 2792 of file Core.cpp.
References llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI unsigned LLVMCountBasicBlocks | ( | LLVMValueRef | Fn | ) |
Obtain the number of basic blocks in a function.
| Fn | Function value to operate on. |
Definition at line 2816 of file Core.cpp.
References llvm::unwrap().
| LLVM_C_ABI LLVMBasicBlockRef LLVMCreateBasicBlockInContext | ( | LLVMContextRef | C, |
| const char * | Name ) |
Create a new basic block without inserting it into a function.
Definition at line 2862 of file Core.cpp.
References llvm::CallingConv::C, llvm::BasicBlock::Create(), llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI 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.
Definition at line 2902 of file Core.cpp.
References llvm::unwrap().
| LLVM_C_ABI const char * LLVMGetBasicBlockName | ( | LLVMBasicBlockRef | BB | ) |
Obtain the string name of a basic block.
Definition at line 2804 of file Core.cpp.
References llvm::unwrap().
| LLVM_C_ABI LLVMValueRef LLVMGetBasicBlockParent | ( | LLVMBasicBlockRef | BB | ) |
Obtain the function to which a basic block belongs.
Definition at line 2808 of file Core.cpp.
References getParent(), llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI 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.
Definition at line 2820 of file Core.cpp.
References llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI 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.
Definition at line 2812 of file Core.cpp.
References llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI LLVMBasicBlockRef LLVMGetEntryBasicBlock | ( | LLVMValueRef | Fn | ) |
Obtain the basic block that corresponds to the entry point of a function.
Definition at line 2826 of file Core.cpp.
References llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI 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.
Definition at line 2830 of file Core.cpp.
References I, llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI LLVMValueRef LLVMGetFirstInstruction | ( | LLVMBasicBlockRef | BB | ) |
Obtain the first instruction in a basic block.
The returned LLVMValueRef corresponds to a llvm::Instruction instance.
Definition at line 2924 of file Core.cpp.
References llvm::Block, I, llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI LLVMBasicBlockRef LLVMGetLastBasicBlock | ( | LLVMValueRef | Fn | ) |
Obtain the last basic block in a function.
Definition at line 2838 of file Core.cpp.
References I, llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI LLVMValueRef LLVMGetLastInstruction | ( | LLVMBasicBlockRef | BB | ) |
Obtain the last instruction in a basic block.
The returned LLVMValueRef corresponds to an LLVM:Instruction.
Definition at line 2932 of file Core.cpp.
References llvm::Block, I, llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI LLVMBasicBlockRef LLVMGetNextBasicBlock | ( | LLVMBasicBlockRef | BB | ) |
Advance a basic block iterator.
Definition at line 2846 of file Core.cpp.
References llvm::Block, I, llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI LLVMBasicBlockRef LLVMGetPreviousBasicBlock | ( | LLVMBasicBlockRef | BB | ) |
Go backwards in a basic block iterator.
Definition at line 2854 of file Core.cpp.
References llvm::Block, I, llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI LLVMBasicBlockRef LLVMInsertBasicBlock | ( | LLVMBasicBlockRef | InsertBeforeBB, |
| const char * | Name ) |
Insert a basic block in a function using the global context.
Definition at line 2897 of file Core.cpp.
References LLVMGetGlobalContext(), and LLVMInsertBasicBlockInContext().
| LLVM_C_ABI 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.
Definition at line 2890 of file Core.cpp.
References llvm::CallingConv::C, llvm::BasicBlock::Create(), llvm::BasicBlock::getParent(), llvm::unwrap(), and llvm::wrap().
Referenced by LLVMInsertBasicBlock().
| LLVM_C_ABI 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.
Definition at line 2867 of file Core.cpp.
References assert(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::BasicBlock::getParent(), llvm::Function::insert(), and llvm::unwrap().
| LLVM_C_ABI void LLVMMoveBasicBlockAfter | ( | LLVMBasicBlockRef | BB, |
| LLVMBasicBlockRef | MovePos ) |
Move a basic block to after another one.
Definition at line 2914 of file Core.cpp.
References llvm::unwrap().
| LLVM_C_ABI void LLVMMoveBasicBlockBefore | ( | LLVMBasicBlockRef | BB, |
| LLVMBasicBlockRef | MovePos ) |
Move a basic block to before another one.
Definition at line 2910 of file Core.cpp.
References llvm::unwrap().
| LLVM_C_ABI 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.
Definition at line 2906 of file Core.cpp.
References llvm::unwrap().
| LLVM_C_ABI LLVMBasicBlockRef LLVMValueAsBasicBlock | ( | LLVMValueRef | Val | ) |
Convert an LLVMValueRef to an LLVMBasicBlockRef instance.
Definition at line 2800 of file Core.cpp.
References llvm::unwrap(), and llvm::wrap().
| LLVM_C_ABI LLVMBool LLVMValueIsBasicBlock | ( | LLVMValueRef | Val | ) |
Determine whether an LLVMValueRef is itself a basic block.
Definition at line 2796 of file Core.cpp.
References llvm::isa(), and llvm::unwrap().