LLVM API Documentation
#include <BasicBlock.h>
Inheritance diagram for llvm::BasicBlock:
Public Types | |
typedef iplist< Instruction > | InstListType |
typedef InstListType::iterator | iterator |
Instruction iterators... | |
typedef InstListType::const_iterator | const_iterator |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef std::reverse_iterator< iterator > | reverse_iterator |
Public Member Functions | |
BasicBlock (const std::string &Name="", Function *Parent=0, BasicBlock *InsertBefore=0) | |
~BasicBlock () | |
virtual void | setName (const std::string &name, SymbolTable *ST=0) |
const Function * | getParent () const |
Function * | getParent () |
BasicBlock * | getNext () |
const BasicBlock * | getNext () const |
BasicBlock * | getPrev () |
const BasicBlock * | getPrev () const |
TerminatorInst * | getTerminator () |
const TerminatorInst *const | getTerminator () const |
void | removeFromParent () |
void | eraseFromParent () |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_t | size () const |
bool | empty () const |
const Instruction & | front () const |
Instruction & | front () |
const Instruction & | back () const |
Instruction & | back () |
const InstListType & | getInstList () const |
InstListType & | getInstList () |
virtual void | print (std::ostream &OS) const |
void | print (std::ostream &OS, AssemblyAnnotationWriter *AAW) const |
void | dropAllReferences () |
void | removePredecessor (BasicBlock *Pred) |
BasicBlock * | splitBasicBlock (iterator I, const std::string &BBName="") |
Static Public Member Functions | |
static bool | classof (const BasicBlock *BB) |
Methods for support type inquiry through isa, cast, and dyn_cast:. | |
static bool | classof (const Value *V) |
Friends | |
class | SymbolTableListTraits< BasicBlock, Function, Function > |
Definition at line 48 of file BasicBlock.h.
|
Definition at line 66 of file BasicBlock.h. |
|
Definition at line 67 of file BasicBlock.h. |
|
Definition at line 50 of file BasicBlock.h. |
|
Instruction iterators...
Definition at line 65 of file BasicBlock.h. |
|
Definition at line 68 of file BasicBlock.h. |
|
BasicBlock ctor - If the function parameter is specified, the basic block is automatically inserted at either the end of the function (if InsertBefore is null), or before the specified basic block. Definition at line 63 of file BasicBlock.cpp. References llvm::LeakDetector::addGarbageObject(), and llvm::Function::getBasicBlockList(). |
|
Definition at line 82 of file BasicBlock.cpp. References dropAllReferences(), and getParent(). |
|
Definition at line 129 of file BasicBlock.h. |
|
Definition at line 128 of file BasicBlock.h. Referenced by llvm::AliasAnalysis::canBasicBlockModify(), llvm::ImmediateDominators::runOnFunction(), and llvm::SimplifyCFG(). |
|
Definition at line 115 of file BasicBlock.h. |
|
|
Reimplemented from llvm::Value. Definition at line 142 of file BasicBlock.h. References llvm::Value::BasicBlockVal, and llvm::Value::getValueType(). |
|
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 141 of file BasicBlock.h. |
|
dropAllReferences() - This function causes all the subinstructions to "let go" of all references that they are maintaining. This allows one to 'delete' a whole class at a time, even though there may be circular references... first all references are dropped, and all use counts go to zero. Then everything is delete'd for real. Note that no operations are valid on an object that has "dropped all references", except operator delete. Definition at line 127 of file BasicBlock.cpp. References begin(), E, end(), and I. Referenced by ~BasicBlock(). |
|
Definition at line 125 of file BasicBlock.h. Referenced by llvm::SimplifyCFG(). |
|
Definition at line 117 of file BasicBlock.h. |
|
Definition at line 116 of file BasicBlock.h. Referenced by llvm::AliasSetTracker::add(), ApproximateLoopSize(), llvm::CloneBasicBlock(), ConvertMallocToType(), ConvertOperandToType(), dropAllReferences(), llvm::insertBB(), MarkAliveBlocks(), ReleasePtrSeqNumbers(), llvm::SimplifyCFG(), splitBasicBlock(), and llvm::SelectionDAGBuilder::visitBB(). |
|
eraseFromParent - This method unlinks 'this' from the containing function and deletes it. Definition at line 112 of file BasicBlock.cpp. References llvm::Function::getBasicBlockList(), and getParent(). Referenced by llvm::InlineFunction(), and llvm::SimplifyCFG(). |
|
Definition at line 127 of file BasicBlock.h. |
|
Definition at line 126 of file BasicBlock.h. Referenced by llvm::AliasAnalysis::canBasicBlockModify(), isBlockSimpleEnough(), PropagatePredecessorsForPHIs(), removePredecessor(), llvm::UnifyFunctionExitNodes::runOnFunction(), and llvm::SimplifyCFG(). |
|
Definition at line 135 of file BasicBlock.h. |
|
|
Definition at line 88 of file BasicBlock.h. References Next(). |
|
Definition at line 87 of file BasicBlock.h. References Next(). Referenced by ReleasePtrSeqNumbers(), splitBasicBlock(), and llvm::SplitCriticalEdge(). |
|
Definition at line 84 of file BasicBlock.h. |
|
|
Definition at line 90 of file BasicBlock.h. |
|
Definition at line 89 of file BasicBlock.h. |
|
Definition at line 122 of file BasicBlock.cpp. |
|
getTerminator() - If this is a well formed basic block, then this returns a pointer to the terminator instruction. If it is not, then you get a null pointer back. Definition at line 117 of file BasicBlock.cpp. Referenced by ApproximateLoopSize(), llvm::ChooseInstructionsForDelaySlots(), llvm::CloneFunctionInto(), llvm::ConstantFoldTerminator(), DominatesMergePoint(), FoldValueComparisonIntoPredecessors(), llvm::ProfileInfoLoader::getBlockCounts(), llvm::DOTGraphTraits< const Function * >::getEdgeSourceLabel(), GetIfCondition(), llvm::Loop::getTripCount(), llvm::InlineFunction(), llvm::insertBB(), InsertCodeToShowFunctionExit(), isBlockSimpleEnough(), llvm::BytecodeReader::ParseInstructionList(), llvm::ReplaceNopsWithUsefulInstr(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::SimplifyCFG(), splitBasicBlock(), llvm::SplitCriticalEdge(), llvm::succ_begin(), llvm::succ_end(), and TraceValuesAtBBExit(). |
|
Definition at line 1207 of file AsmWriter.cpp. References getParent(), and llvm::AssemblyWriter::write(). |
|
print - Implement operator<< on Value... Implements llvm::Value. Definition at line 137 of file BasicBlock.h. |
|
Definition at line 120 of file BasicBlock.h. |
|
Definition at line 119 of file BasicBlock.h. |
|
removeFromParent - This method unlinks 'this' from the containing function, but does not delete it. Definition at line 108 of file BasicBlock.cpp. References llvm::Function::getBasicBlockList(), and getParent(). |
|
removePredecessor - This method is used to notify a BasicBlock that the specified Predecessor of the block is no longer able to reach it. This is actually not used to update the Predecessor list, but is actually used to update the PHI nodes that reside in the block. Note that this should be called while the predecessor still refers to this block. Definition at line 138 of file BasicBlock.cpp. References begin(), front(), llvm::PHINode::getIncomingBlock(), getInstList(), llvm::Constant::getNullValue(), llvm::PHINode::getNumIncomingValues(), llvm::MVT::Other, llvm::pred_begin(), llvm::pred_end(), llvm::PHINode::removeIncomingValue(), and llvm::Value::replaceAllUsesWith(). Referenced by llvm::ConstantFoldTerminator(), FoldValueComparisonIntoPredecessors(), llvm::InlineFunction(), llvm::RemoveSuccessor(), and llvm::SimplifyCFG(). |
|
Definition at line 122 of file BasicBlock.h. |
|
Definition at line 121 of file BasicBlock.h. |
|
Reimplemented from llvm::Value. Definition at line 99 of file BasicBlock.cpp. References getParent(), llvm::Function::getSymbolTable(), llvm::Value::hasName(), llvm::SymbolTable::insert(), llvm::SymbolTable::remove(), and llvm::Value::setName(). Referenced by llvm::CloneBasicBlock(), getBBVal(), and llvm::SimplifyCFG(). |
|
Definition at line 124 of file BasicBlock.h. Referenced by isBlockSimpleEnough(). |
|
splitBasicBlock - This splits a basic block into two at the specified instruction. Note that all instructions BEFORE the specified iterator stay as part of the original basic block, an unconditional branch is added to the new BB, and the rest of the instructions in the BB are moved to the new BB, including the old terminator. The newly formed BasicBlock is returned. This function invalidates the specified iterator. Note that this only works on well formed basic blocks (must have a terminator), and 'I' must not be the end of instruction list (which would cause a degenerate basic block to be formed, having a terminator inside of the basic block). Definition at line 204 of file BasicBlock.cpp. References begin(), E, end(), llvm::PHINode::getBasicBlockIndex(), getInstList(), getNext(), getParent(), getTerminator(), llvm::PHINode::setIncomingBlock(), llvm::succ_begin(), and llvm::succ_end(). Referenced by llvm::InlineFunction(). |
|
Definition at line 58 of file BasicBlock.h. |