14 #ifndef LLVM_IR_BASICBLOCK_H
15 #define LLVM_IR_BASICBLOCK_H
22 #include "llvm/Support/DataTypes.h"
85 void operator=(const
BasicBlock &) LLVM_DELETED_FUNCTION;
111 return new BasicBlock(Context, Name, Parent, InsertBefore);
203 inline size_t size()
const {
return InstList.
size(); }
219 return &BasicBlock::InstList;
290 void AdjustBlockAddressRefCount(
int Amt) {
293 "Refcount wrap-around");
297 void setValueSubclassData(
unsigned short D) {
BasicBlock * getUniquePredecessor()
Return this block if it has a unique predecessor block. Otherwise return a null pointer.
void removePredecessor(BasicBlock *Pred, bool DontDeleteUselessPHIs=false)
Notify the BasicBlock that the predecessor Pred is no longer able to reach it.
InstListType & getInstList()
const Instruction & back() const
const Function * getParent() const
Return the enclosing method, or null if none.
const Instruction & front() const
reverse_iterator rbegin()
const_iterator begin() const
reverse_iterator rbegin()
Instruction * getFirstNonPHIOrDbg()
Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic...
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
Instruction * getFirstNonPHI()
Returns a pointer to the first instruction in this block that is not a PHINode instruction.
const_reverse_iterator rend() const
bool hasAddressTaken() const
Returns true if there are any uses of this basic block other than direct branches, switches, etc. to it.
const_reverse_iterator rbegin() const
Instruction * provideInitialHead() const
Instruction * ensureHead(Instruction *) const
const BasicBlock * getSinglePredecessor() const
static void noteHead(Instruction *, Instruction *)
iplist< Instruction > InstListType
const_iterator getFirstInsertionPt() const
InstListType::reverse_iterator reverse_iterator
const Instruction * getFirstNonPHI() const
void replaceSuccessorsPhiUsesWith(BasicBlock *New)
Update all phi nodes in this basic block's successors to refer to basic block New instead of to it...
const BasicBlock * getUniquePredecessor() const
LLVM Basic Block Representation.
size_type LLVM_ATTRIBUTE_UNUSED_RESULT size() const
LandingPadInst * getLandingPadInst()
Return the landingpad instruction associated with the landing pad.
const InstListType & getInstList() const
Return the underlying instruction list container.
unsigned getValueID() const
Instruction * getFirstNonPHIOrDbgOrLifetime()
Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic...
void removeFromParent()
Unlink 'this' from the containing function, but do not delete it.
const Instruction * getFirstNonPHIOrDbgOrLifetime() const
void moveAfter(BasicBlock *MovePos)
Unlink this basic block from its current function and insert it right after MovePos in the function M...
static iplist< Instruction > BasicBlock::* getSublistAccess(Instruction *)
Returns a pointer to a member of the instruction list.
static void destroySentinel(Instruction *)
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
void eraseFromParent()
Unlink 'this' from the containing function and delete it.
const_iterator end() const
bool LLVM_ATTRIBUTE_UNUSED_RESULT empty() const
void setValueSubclassData(unsigned short D)
#define LLVM_DELETED_FUNCTION
BasicBlock * getSinglePredecessor()
Return this block if it has a single predecessor block. Otherwise return a null pointer.
unsigned short getSubclassDataFromValue() const
ValueSymbolTable * getValueSymbolTable()
Returns a pointer to the symbol table if one exists.
TerminatorInst * getTerminator()
Returns the terminator instruction if the block is well formed or null if the block is not well forme...
bool isLandingPad() const
Return true if this basic block is a landing pad.
static bool classof(const Value *V)
Methods for support type inquiry through isa, cast, and dyn_cast.
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=0, BasicBlock *InsertBefore=0)
Creates a new BasicBlock.
BasicBlock * splitBasicBlock(iterator I, const Twine &BBName="")
Split the basic block into two basic blocks at the specified instruction.
static NodeTy * createSentinel()
createSentinel - create the dynamic sentinel
LLVMContext & getContext() const
Get the context in which this basic block lives.
Instruction * createSentinel() const
Return a node that marks the end of a list.
LLVM Value Representation.
iterator getFirstInsertionPt()
Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI i...
InstListType::const_reverse_iterator const_reverse_iterator
void moveBefore(BasicBlock *MovePos)
Unlink this basic block from its current function and insert it into the function that MovePos lives ...
InstListType::iterator iterator
Instruction iterators...
void dropAllReferences()
Cause all subinstructions to "let go" of all the references that said subinstructions are maintaining...
const Instruction * getFirstNonPHIOrDbg() const