14 #ifndef LLVM_IR_BASICBLOCK_H
15 #define LLVM_IR_BASICBLOCK_H
238 inline size_t size()
const {
return InstList.size(); }
239 inline bool empty()
const {
return InstList.empty(); }
254 return &BasicBlock::InstList;
262 return V->
getValueID() == Value::BasicBlockVal;
333 void AdjustBlockAddressRefCount(
int Amt) {
336 "Refcount wrap-around");
341 void setValueSubclassData(
unsigned short D) {
351 #endif // LLVM_IR_BASICBLOCK_H
BasicBlock * getUniqueSuccessor()
Return the successor of this block if it has a unique successor.
This class provides a symbol table of name/value pairs.
BasicBlock * getUniquePredecessor()
Return the predecessor of this block if it has a unique predecessor block.
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
void insertInto(Function *Parent, BasicBlock *InsertBefore=nullptr)
Insert unlinked basic block into a function.
A Module instance is used to store all the information related to an LLVM module. ...
CallInst * getTerminatingMustTailCall()
Returns the call instruction marked 'musttail' prior to the terminating return instruction of this ba...
This class represents a function call, abstracting a target machine's calling convention.
const CallInst * getTerminatingDeoptimizeCall() const
bool isEHPad() const
Return true if this basic block is an exception handling block.
const Function * getParent() const
Return the enclosing method, or null if none.
const Instruction & front() const
reverse_iterator rbegin()
iterator begin()
Instruction iterator methods.
const_iterator begin() const
Instruction * getFirstNonPHIOrDbg()
Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic...
The address of a basic block.
#define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
const Module * getModule() const
Return the module owning the function this basic block belongs to, or nullptr it the function does no...
static GCRegistry::Add< StatepointGC > D("statepoint-example","an example strategy for statepoint")
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.
const BasicBlock * getSingleSuccessor() const
const_reverse_iterator rbegin() const
BasicBlock & operator=(const BasicBlock &)=delete
const BasicBlock * getSinglePredecessor() const
InstListType::const_iterator const_iterator
bool canSplitPredecessors() const
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
An ilist node that can access its parent list.
SymbolTableList< Instruction > InstListType
The landingpad instruction holds all of the information necessary to generate correct exception handl...
Subclasses of this class are all able to terminate a basic block.
LLVM Basic Block Representation.
This is an important class for using LLVM in a threaded context.
LandingPadInst * getLandingPadInst()
Return the landingpad instruction associated with the landing pad.
const InstListType & getInstList() const
Return the underlying instruction list container.
unsigned getValueID() const
Return an ID for the concrete type of this object.
static BasicBlock * Create(LLVMContext &Context, const Twine &Name="", Function *Parent=nullptr, BasicBlock *InsertBefore=nullptr)
Creates a new BasicBlock.
const BasicBlock * getUniqueSuccessor() const
self_iterator getIterator()
Instruction * getFirstNonPHIOrDbgOrLifetime()
Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic...
const CallInst * getTerminatingMustTailCall() const
CallInst * getTerminatingDeoptimizeCall()
Returns the call instruction calling .experimental.deoptimize prior to the terminating return instruc...
void removeFromParent()
Unlink 'this' from the containing function, but do not delete it.
const Instruction * getFirstNonPHIOrDbgOrLifetime() const
Iterator for intrusive lists based on ilist_node.
void moveAfter(BasicBlock *MovePos)
Unlink this basic block from its current function and insert it right after MovePos in the function M...
struct LLVMOpaqueBasicBlock * LLVMBasicBlockRef
Represents a basic block of instructions in LLVM IR.
const_iterator end() const
void setValueSubclassData(unsigned short D)
static GCRegistry::Add< ShadowStackGC > C("shadow-stack","Very portable GC for uncooperative code generators")
BasicBlock * getSingleSuccessor()
Return the successor of this block if it has a single successor.
BasicBlock * getSinglePredecessor()
Return the predecessor of this block if it has a single predecessor block.
bool isEHPad() const
Return true if the instruction is a variety of EH-block.
unsigned short getSubclassDataFromValue() const
static InstListType BasicBlock::* getSublistAccess(Instruction *)
Returns a pointer to a member of the instruction list.
SymbolTableList< BasicBlock >::iterator eraseFromParent()
Unlink 'this' from the containing function and delete it.
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.
BasicBlock * splitBasicBlock(Instruction *I, const Twine &BBName="")
BasicBlock * splitBasicBlock(iterator I, const Twine &BBName="")
Split the basic block into two basic blocks at the specified instruction.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVMContext & getContext() const
Get the context in which this basic block lives.
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