class BasicBlock
Declaration
class BasicBlock : public Value, public ilist_node_with_parent { /* full declaration omitted */ };
Description
LLVM Basic Block Representation This represents a single basic block in LLVM. A basic block is simply a container of instructions that execute sequentially. Basic blocks are Values because they are referenced by instructions such as branches and switch tables. The type of a BasicBlock is "Type::LabelTy" because the basic block represents a label to which a branch can jump. A well formed basic block is formed of a list of non-terminating instructions followed by a single terminator instruction. Terminator instructions may not occur in the middle of basic blocks, and must terminate the blocks. The BasicBlock class allows malformed basic blocks to occur because it may be useful in the intermediate stage of constructing or modifying a program. However, the verifier will ensure that basic blocks are "well formed".
Declared at: llvm/include/llvm/IR/BasicBlock.h:55
Inherits from: Value, ilist_node_with_parent
Member Variables
- private llvm::BasicBlock::InstListType InstList
- private llvm::Function* Parent
Inherited from Value:
- protected SubclassOptionalData
- protected NumUserOperands
- protected IsUsedByMD
- protected HasName
- protected HasMetadata
- protected HasHungOffUses
- protected HasDescriptor
- public static MaxAlignmentExponent = 32
- public static MaximumAlignment = 1ULL << MaxAlignmentExponent
Method Overview
- private void AdjustBlockAddressRefCount(int Amt)
- private BasicBlock(llvm::LLVMContext & C, const llvm::Twine & Name = "", llvm::Function * Parent = nullptr, llvm::BasicBlock * InsertBefore = nullptr)
- public BasicBlock(const llvm::BasicBlock &)
- public static llvm::BasicBlock * Create(llvm::LLVMContext & Context, const llvm::Twine & Name = "", llvm::Function * Parent = nullptr, llvm::BasicBlock * InsertBefore = nullptr)
- public inline llvm::Instruction & back()
- public inline const llvm::Instruction & back() const
- public inline llvm::BasicBlock::const_iterator begin() const
- public inline llvm::BasicBlock::iterator begin()
- public bool canSplitPredecessors() const
- public static bool classof(const llvm::Value * V)
- public void dropAllReferences()
- public inline bool empty() const
- public inline llvm::BasicBlock::iterator end()
- public inline llvm::BasicBlock::const_iterator end() const
- public SymbolTableList<BasicBlock>::iterator eraseFromParent()
- public inline const llvm::Instruction & front() const
- public inline llvm::Instruction & front()
- private llvm::BasicBlock::BasicBlockBits getBasicBlockBits() const
- public llvm::LLVMContext & getContext() const
- public llvm::BasicBlock::iterator getFirstInsertionPt()
- public llvm::BasicBlock::const_iterator getFirstInsertionPt() const
- public const llvm::Instruction * getFirstNonPHI() const
- public llvm::Instruction * getFirstNonPHI()
- public llvm::Instruction * getFirstNonPHIOrDbg(bool SkipPseudoOp = true)
- public const llvm::Instruction * getFirstNonPHIOrDbg(bool SkipPseudoOp = true) const
- public llvm::Instruction * getFirstNonPHIOrDbgOrLifetime(bool SkipPseudoOp = true)
- public const llvm::Instruction * getFirstNonPHIOrDbgOrLifetime(bool SkipPseudoOp = true) const
- public const llvm::BasicBlock::InstListType & getInstList() const
- public llvm::BasicBlock::InstListType & getInstList()
- public Optional<uint64_t> getIrrLoopHeaderWeight() const
- public const llvm::LandingPadInst * getLandingPadInst() const
- public llvm::LandingPadInst * getLandingPadInst()
- public llvm::Module * getModule()
- public const llvm::Module * getModule() const
- public const llvm::Function * getParent() const
- public llvm::Function * getParent()
- public llvm::CallInst * getPostdominatingDeoptimizeCall()
- public const llvm::CallInst * getPostdominatingDeoptimizeCall() const
- public const llvm::BasicBlock * getSinglePredecessor() const
- public llvm::BasicBlock * getSinglePredecessor()
- public const llvm::BasicBlock * getSingleSuccessor() const
- public llvm::BasicBlock * getSingleSuccessor()
- public static llvm::BasicBlock::InstListType llvm::BasicBlock::* getSublistAccess(llvm::Instruction *)
- public const llvm::CallInst * getTerminatingDeoptimizeCall() const
- public llvm::CallInst * getTerminatingDeoptimizeCall()
- public const llvm::CallInst * getTerminatingMustTailCall() const
- public llvm::CallInst * getTerminatingMustTailCall()
- public const llvm::Instruction * getTerminator() const
- public llvm::Instruction * getTerminator()
- public llvm::BasicBlock * getUniquePredecessor()
- public const llvm::BasicBlock * getUniquePredecessor() const
- public const llvm::BasicBlock * getUniqueSuccessor() const
- public llvm::BasicBlock * getUniqueSuccessor()
- public llvm::ValueSymbolTable * getValueSymbolTable()
- public bool hasAddressTaken() const
- public bool hasNPredecessors(unsigned int N) const
- public bool hasNPredecessorsOrMore(unsigned int N) const
- public void insertInto(llvm::Function * Parent, llvm::BasicBlock * InsertBefore = nullptr)
- public iterator_range<filter_iterator<BasicBlock::iterator, std::function<bool (Instruction &)>>> instructionsWithoutDebug(bool SkipPseudoOp = true)
- public iterator_range<filter_iterator<BasicBlock::const_iterator, std::function<bool (const Instruction &)>>> instructionsWithoutDebug(bool SkipPseudoOp = true) const
- public void invalidateOrders()
- public bool isEHPad() const
- public bool isEntryBlock() const
- public bool isInstrOrderValid() const
- public bool isLandingPad() const
- public bool isLegalToHoistInto() const
- public void moveAfter(llvm::BasicBlock * MovePos)
- public void moveBefore(llvm::BasicBlock * MovePos)
- public iterator_range<llvm::BasicBlock::phi_iterator> phis()
- public iterator_range<llvm::BasicBlock::const_phi_iterator> phis() const
- public void print(llvm::raw_ostream & OS, llvm::AssemblyAnnotationWriter * AAW = nullptr, bool ShouldPreserveUseListOrder = false, bool IsForDebug = false) const
- public inline llvm::BasicBlock::const_reverse_iterator rbegin() const
- public inline llvm::BasicBlock::reverse_iterator rbegin()
- public void removeFromParent()
- public void removePredecessor(llvm::BasicBlock * Pred, bool KeepOneInputPHIs = false)
- public inline llvm::BasicBlock::const_reverse_iterator rend() const
- public inline llvm::BasicBlock::reverse_iterator rend()
- public void renumberInstructions()
- public void replacePhiUsesWith(llvm::BasicBlock * Old, llvm::BasicBlock * New)
- public void replaceSuccessorsPhiUsesWith(llvm::BasicBlock * Old, llvm::BasicBlock * New)
- public void replaceSuccessorsPhiUsesWith(llvm::BasicBlock * New)
- private void setBasicBlockBits(llvm::BasicBlock::BasicBlockBits AsBits)
- private void setParent(llvm::Function * parent)
- private void setValueSubclassData(unsigned short D)
- public inline size_t size() const
- public filter_iterator<BasicBlock::const_iterator, std::function<bool (const Instruction &)>>::difference_type sizeWithoutDebug() const
- public llvm::BasicBlock * splitBasicBlock(llvm::BasicBlock::iterator I, const llvm::Twine & BBName = "", bool Before = false)
- public llvm::BasicBlock * splitBasicBlock(llvm::Instruction * I, const llvm::Twine & BBName = "", bool Before = false)
- public llvm::BasicBlock * splitBasicBlockBefore(llvm::BasicBlock::iterator I, const llvm::Twine & BBName = "")
- public llvm::BasicBlock * splitBasicBlockBefore(llvm::Instruction * I, const llvm::Twine & BBName = "")
- public void validateInstrOrdering() const
- public ~BasicBlock()
Inherited from Value:
- public DoPHITranslation
- public DoPHITranslation
- protected addMetadata
- protected addMetadata
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public canBeFreed
- protected clearMetadata
- public clearSubclassOptionalData
- public deleteValue
- public dropDroppableUse
- public dropDroppableUses
- public dropDroppableUsesIn
- public dump
- protected eraseMetadata
- protected getAllMetadata
- public getContext
- protected getMetadata
- protected getMetadata
- protected getMetadata
- protected getMetadata
- public getName
- public getNameOrAsOperand
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- public getSingleUndroppableUse
- public getSingleUndroppableUse
- protected getSubclassDataFromValue
- public getType
- public getUniqueUndroppableUser
- public getUniqueUndroppableUser
- public getValueID
- public getValueName
- protected hasMetadata
- protected hasMetadata
- protected hasMetadata
- public hasNUndroppableUses
- public hasNUndroppableUsesOrMore
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasOneUser
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isTransitiveUsedByMetadataOnly
- public isUsedByMetadata
- public isUsedInBasicBlock
- public materialized_use_begin
- public materialized_use_begin
- public materialized_use_empty
- public materialized_user_begin
- public materialized_user_begin
- public materialized_users
- public materialized_users
- public materialized_uses
- public materialized_uses
- public mutateType
- public print
- public print
- public printAsOperand
- public printAsOperand
- public replaceAllUsesWith
- public replaceNonMetadataUsesWith
- public replaceUsesOutsideBlock
- public replaceUsesWithIf
- public reverseUseList
- protected setMetadata
- protected setMetadata
- public setName
- public setValueName
- protected setValueSubclassData
- public sortUseList
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsOffsets
- public stripInBoundsOffsets
- public stripPointerCasts
- public stripPointerCasts
- public stripPointerCastsAndAliases
- public stripPointerCastsAndAliases
- public stripPointerCastsForAliasAnalysis
- public stripPointerCastsForAliasAnalysis
- public stripPointerCastsSameRepresentation
- public stripPointerCastsSameRepresentation
- public takeName
- public use_begin
- public use_begin
- public use_empty
- public use_end
- public use_end
- public user_back
- public user_back
- public user_begin
- public user_begin
- public user_empty
- public user_end
- public user_end
- public users
- public users
- public uses
- public uses
Methods
¶void AdjustBlockAddressRefCount(int Amt)
void AdjustBlockAddressRefCount(int Amt)
Description
Increment the internal refcount of the number of BlockAddresses referencing this BasicBlock by \p Amt. This is almost always 0, sometimes one possibly, but almost never 2, and inconceivably 3 or more.
Declared at: llvm/include/llvm/IR/BasicBlock.h:560
Parameters
- int Amt
¶BasicBlock(
llvm::LLVMContext& C,
const llvm::Twine& Name = "",
llvm::Function* Parent = nullptr,
llvm::BasicBlock* InsertBefore = nullptr)
BasicBlock(
llvm::LLVMContext& C,
const llvm::Twine& Name = "",
llvm::Function* Parent = nullptr,
llvm::BasicBlock* InsertBefore = nullptr)
Description
Constructor. 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.
Declared at: llvm/include/llvm/IR/BasicBlock.h:74
Parameters
- llvm::LLVMContext& C
- const llvm::Twine& Name = ""
- llvm::Function* Parent = nullptr
- llvm::BasicBlock* InsertBefore = nullptr
¶BasicBlock(const llvm::BasicBlock&)
BasicBlock(const llvm::BasicBlock&)
Declared at: llvm/include/llvm/IR/BasicBlock.h:79
Parameters
- const llvm::BasicBlock&
¶static llvm::BasicBlock* Create(
llvm::LLVMContext& Context,
const llvm::Twine& Name = "",
llvm::Function* Parent = nullptr,
llvm::BasicBlock* InsertBefore = nullptr)
static llvm::BasicBlock* Create(
llvm::LLVMContext& Context,
const llvm::Twine& Name = "",
llvm::Function* Parent = nullptr,
llvm::BasicBlock* InsertBefore = nullptr)
Description
Creates a new BasicBlock. If the Parent parameter is specified, the basic block is automatically inserted at either the end of the function (if InsertBefore is 0), or before the specified basic block.
Declared at: llvm/include/llvm/IR/BasicBlock.h:97
Parameters
- llvm::LLVMContext& Context
- const llvm::Twine& Name = ""
- llvm::Function* Parent = nullptr
- llvm::BasicBlock* InsertBefore = nullptr
¶inline llvm::Instruction& back()
inline llvm::Instruction& back()
Declared at: llvm/include/llvm/IR/BasicBlock.h:312
¶inline const llvm::Instruction& back() const
inline const llvm::Instruction& back() const
Declared at: llvm/include/llvm/IR/BasicBlock.h:311
¶inline llvm::BasicBlock::const_iterator begin()
const
inline llvm::BasicBlock::const_iterator begin()
const
Declared at: llvm/include/llvm/IR/BasicBlock.h:298
¶inline llvm::BasicBlock::iterator begin()
inline llvm::BasicBlock::iterator begin()
Description
Instruction iterator methods
Declared at: llvm/include/llvm/IR/BasicBlock.h:297
¶bool canSplitPredecessors() const
bool canSplitPredecessors() const
Declared at: llvm/include/llvm/IR/BasicBlock.h:398
¶static bool classof(const llvm::Value* V)
static bool classof(const llvm::Value* V)
Description
Methods for support type inquiry through isa, cast, and dyn_cast.
Declared at: llvm/include/llvm/IR/BasicBlock.h:376
Parameters
- const llvm::Value* V
¶void dropAllReferences()
void dropAllReferences()
Description
Cause all subinstructions to "let go" of all the references that said subinstructions 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.
Declared at: llvm/include/llvm/IR/BasicBlock.h:388
¶inline bool empty() const
inline bool empty() const
Declared at: llvm/include/llvm/IR/BasicBlock.h:308
¶inline llvm::BasicBlock::iterator end()
inline llvm::BasicBlock::iterator end()
Declared at: llvm/include/llvm/IR/BasicBlock.h:299
¶inline llvm::BasicBlock::const_iterator end()
const
inline llvm::BasicBlock::const_iterator end()
const
Declared at: llvm/include/llvm/IR/BasicBlock.h:300
¶SymbolTableList<BasicBlock>::iterator
eraseFromParent()
SymbolTableList<BasicBlock>::iterator
eraseFromParent()
Description
Unlink 'this' from the containing function and delete it.
Declared at: llvm/include/llvm/IR/BasicBlock.h:224
¶inline const llvm::Instruction& front() const
inline const llvm::Instruction& front() const
Declared at: llvm/include/llvm/IR/BasicBlock.h:309
¶inline llvm::Instruction& front()
inline llvm::Instruction& front()
Declared at: llvm/include/llvm/IR/BasicBlock.h:310
¶llvm::BasicBlock::BasicBlockBits
getBasicBlockBits() const
llvm::BasicBlock::BasicBlockBits
getBasicBlockBits() const
Description
Safely reinterpret the subclass data bits to a more useful form.
Declared at: llvm/include/llvm/IR/BasicBlock.h:539
¶llvm::LLVMContext& getContext() const
llvm::LLVMContext& getContext() const
Description
Get the context in which this basic block lives.
Declared at: llvm/include/llvm/IR/BasicBlock.h:84
¶llvm::BasicBlock::iterator getFirstInsertionPt()
llvm::BasicBlock::iterator getFirstInsertionPt()
Declared at: llvm/include/llvm/IR/BasicBlock.h:194
¶llvm::BasicBlock::const_iterator
getFirstInsertionPt() const
llvm::BasicBlock::const_iterator
getFirstInsertionPt() const
Description
Returns an iterator to the first instruction in this block that is suitable for inserting a non-PHI instruction. In particular, it skips all PHIs and LandingPad instructions.
Declared at: llvm/include/llvm/IR/BasicBlock.h:193
¶const llvm::Instruction* getFirstNonPHI() const
const llvm::Instruction* getFirstNonPHI() const
Description
Returns a pointer to the first instruction in this block that is not a PHINode instruction. When adding instructions to the beginning of the basic block, they should be added before the returned value, not before the first instruction, which might be PHI. Returns 0 is there's no non-PHI instruction.
Declared at: llvm/include/llvm/IR/BasicBlock.h:162
¶llvm::Instruction* getFirstNonPHI()
llvm::Instruction* getFirstNonPHI()
Declared at: llvm/include/llvm/IR/BasicBlock.h:163
¶llvm::Instruction* getFirstNonPHIOrDbg(
bool SkipPseudoOp = true)
llvm::Instruction* getFirstNonPHIOrDbg(
bool SkipPseudoOp = true)
Declared at: llvm/include/llvm/IR/BasicBlock.h:172
Parameters
- bool SkipPseudoOp = true
¶const llvm::Instruction* getFirstNonPHIOrDbg(
bool SkipPseudoOp = true) const
const llvm::Instruction* getFirstNonPHIOrDbg(
bool SkipPseudoOp = true) const
Description
Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic, or any pseudo operation if \c SkipPseudoOp is true.
Declared at: llvm/include/llvm/IR/BasicBlock.h:171
Parameters
- bool SkipPseudoOp = true
¶llvm::Instruction* getFirstNonPHIOrDbgOrLifetime(
bool SkipPseudoOp = true)
llvm::Instruction* getFirstNonPHIOrDbgOrLifetime(
bool SkipPseudoOp = true)
Declared at: llvm/include/llvm/IR/BasicBlock.h:183
Parameters
- bool SkipPseudoOp = true
¶const llvm::Instruction*
getFirstNonPHIOrDbgOrLifetime(
bool SkipPseudoOp = true) const
const llvm::Instruction*
getFirstNonPHIOrDbgOrLifetime(
bool SkipPseudoOp = true) const
Description
Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic, or a lifetime intrinsic, or any pseudo operation if \c SkipPseudoOp is true.
Declared at: llvm/include/llvm/IR/BasicBlock.h:182
Parameters
- bool SkipPseudoOp = true
¶const llvm::BasicBlock::InstListType&
getInstList() const
const llvm::BasicBlock::InstListType&
getInstList() const
Description
Return the underlying instruction list container. Currently you need to access the underlying instruction list container directly if you want to modify it.
Declared at: llvm/include/llvm/IR/BasicBlock.h:364
¶llvm::BasicBlock::InstListType& getInstList()
llvm::BasicBlock::InstListType& getInstList()
Declared at: llvm/include/llvm/IR/BasicBlock.h:365
¶Optional<uint64_t> getIrrLoopHeaderWeight() const
Optional<uint64_t> getIrrLoopHeaderWeight() const
Declared at: llvm/include/llvm/IR/BasicBlock.h:488
¶const llvm::LandingPadInst* getLandingPadInst()
const
const llvm::LandingPadInst* getLandingPadInst()
const
Description
Return the landingpad instruction associated with the landing pad.
Declared at: llvm/include/llvm/IR/BasicBlock.h:475
¶llvm::LandingPadInst* getLandingPadInst()
llvm::LandingPadInst* getLandingPadInst()
Declared at: llvm/include/llvm/IR/BasicBlock.h:476
¶llvm::Module* getModule()
llvm::Module* getModule()
Declared at: llvm/include/llvm/IR/BasicBlock.h:112
¶const llvm::Module* getModule() const
const llvm::Module* getModule() const
Description
Return the module owning the function this basic block belongs to, or nullptr if the function does not have a module. Note: this is undefined behavior if the block does not have a parent.
Declared at: llvm/include/llvm/IR/BasicBlock.h:111
¶const llvm::Function* getParent() const
const llvm::Function* getParent() const
Description
Return the enclosing method, or null if none.
Declared at: llvm/include/llvm/IR/BasicBlock.h:104
¶llvm::Function* getParent()
llvm::Function* getParent()
Declared at: llvm/include/llvm/IR/BasicBlock.h:105
¶llvm::CallInst* getPostdominatingDeoptimizeCall()
llvm::CallInst* getPostdominatingDeoptimizeCall()
Declared at: llvm/include/llvm/IR/BasicBlock.h:142
¶const llvm::CallInst*
getPostdominatingDeoptimizeCall() const
const llvm::CallInst*
getPostdominatingDeoptimizeCall() const
Description
Returns the call instruction calling @ llvm.experimental.deoptimize that is present either in current basic block or in block that is a unique successor to current block, if such call is present. Otherwise, returns null.
Declared at: llvm/include/llvm/IR/BasicBlock.h:141
¶const llvm::BasicBlock* getSinglePredecessor()
const
const llvm::BasicBlock* getSinglePredecessor()
const
Description
Return the predecessor of this block if it has a single predecessor block. Otherwise return a null pointer.
Declared at: llvm/include/llvm/IR/BasicBlock.h:244
¶llvm::BasicBlock* getSinglePredecessor()
llvm::BasicBlock* getSinglePredecessor()
Declared at: llvm/include/llvm/IR/BasicBlock.h:245
¶const llvm::BasicBlock* getSingleSuccessor() const
const llvm::BasicBlock* getSingleSuccessor() const
Description
Return the successor of this block if it has a single successor. Otherwise return a null pointer. This method is analogous to getSinglePredecessor above.
Declared at: llvm/include/llvm/IR/BasicBlock.h:272
¶llvm::BasicBlock* getSingleSuccessor()
llvm::BasicBlock* getSingleSuccessor()
Declared at: llvm/include/llvm/IR/BasicBlock.h:273
¶static llvm::BasicBlock::InstListType
llvm::BasicBlock::*
getSublistAccess(llvm::Instruction*)
static llvm::BasicBlock::InstListType
llvm::BasicBlock::*
getSublistAccess(llvm::Instruction*)
Description
Returns a pointer to a member of the instruction list.
Declared at: llvm/include/llvm/IR/BasicBlock.h:368
Parameters
¶const llvm::CallInst*
getTerminatingDeoptimizeCall() const
const llvm::CallInst*
getTerminatingDeoptimizeCall() const
Description
Returns the call instruction calling @ llvm.experimental.deoptimize prior to the terminating return instruction of this basic block, if such a call is present. Otherwise, returns null.
Declared at: llvm/include/llvm/IR/BasicBlock.h:132
¶llvm::CallInst* getTerminatingDeoptimizeCall()
llvm::CallInst* getTerminatingDeoptimizeCall()
Declared at: llvm/include/llvm/IR/BasicBlock.h:133
¶const llvm::CallInst* getTerminatingMustTailCall()
const
const llvm::CallInst* getTerminatingMustTailCall()
const
Description
Returns the call instruction marked 'musttail' prior to the terminating return instruction of this basic block, if such a call is present. Otherwise, returns null.
Declared at: llvm/include/llvm/IR/BasicBlock.h:150
¶llvm::CallInst* getTerminatingMustTailCall()
llvm::CallInst* getTerminatingMustTailCall()
Declared at: llvm/include/llvm/IR/BasicBlock.h:151
¶const llvm::Instruction* getTerminator() const
const llvm::Instruction* getTerminator() const
Description
Returns the terminator instruction if the block is well formed or null if the block is not well formed.
Declared at: llvm/include/llvm/IR/BasicBlock.h:119
¶llvm::Instruction* getTerminator()
llvm::Instruction* getTerminator()
Declared at: llvm/include/llvm/IR/BasicBlock.h:124
¶llvm::BasicBlock* getUniquePredecessor()
llvm::BasicBlock* getUniquePredecessor()
Declared at: llvm/include/llvm/IR/BasicBlock.h:257
¶const llvm::BasicBlock* getUniquePredecessor()
const
const llvm::BasicBlock* getUniquePredecessor()
const
Description
Return the predecessor of this block if it has a unique predecessor block. Otherwise return a null pointer. Note that unique predecessor doesn't mean single edge, there can be multiple edges from the unique predecessor to this block (for example a switch statement with multiple cases having the same destination).
Declared at: llvm/include/llvm/IR/BasicBlock.h:256
¶const llvm::BasicBlock* getUniqueSuccessor() const
const llvm::BasicBlock* getUniqueSuccessor() const
Description
Return the successor of this block if it has a unique successor. Otherwise return a null pointer. This method is analogous to getUniquePredecessor above.
Declared at: llvm/include/llvm/IR/BasicBlock.h:282
¶llvm::BasicBlock* getUniqueSuccessor()
llvm::BasicBlock* getUniqueSuccessor()
Declared at: llvm/include/llvm/IR/BasicBlock.h:283
¶llvm::ValueSymbolTable* getValueSymbolTable()
llvm::ValueSymbolTable* getValueSymbolTable()
Description
Returns a pointer to the symbol table if one exists.
Declared at: llvm/include/llvm/IR/BasicBlock.h:373
¶bool hasAddressTaken() const
bool hasAddressTaken() const
Description
Returns true if there are any uses of this basic block other than direct branches, switches, etc. to it.
Declared at: llvm/include/llvm/IR/BasicBlock.h:449
¶bool hasNPredecessors(unsigned int N) const
bool hasNPredecessors(unsigned int N) const
Description
Return true if this block has exactly N predecessors.
Declared at: llvm/include/llvm/IR/BasicBlock.h:263
Parameters
- unsigned int N
¶bool hasNPredecessorsOrMore(unsigned int N) const
bool hasNPredecessorsOrMore(unsigned int N) const
Description
Return true if this block has N predecessors or more.
Declared at: llvm/include/llvm/IR/BasicBlock.h:266
Parameters
- unsigned int N
¶void insertInto(
llvm::Function* Parent,
llvm::BasicBlock* InsertBefore = nullptr)
void insertInto(
llvm::Function* Parent,
llvm::BasicBlock* InsertBefore = nullptr)
Description
Insert unlinked basic block into a function. Inserts an unlinked basic block into \c Parent. If \c InsertBefore is provided, inserts before that basic block, otherwise inserts at the end.
Declared at: llvm/include/llvm/IR/BasicBlock.h:240
Parameters
- llvm::Function* Parent
- llvm::BasicBlock* InsertBefore = nullptr
¶iterator_range<filter_iterator<
BasicBlock::iterator,
std::function<bool(Instruction&)>>>
instructionsWithoutDebug(bool SkipPseudoOp = true)
iterator_range<filter_iterator<
BasicBlock::iterator,
std::function<bool(Instruction&)>>>
instructionsWithoutDebug(bool SkipPseudoOp = true)
Description
Return an iterator range over the instructions in the block, skipping any debug instructions. Skip and any pseudo operations as well if \c SkipPseudoOp is true.
Declared at: llvm/include/llvm/IR/BasicBlock.h:211
Parameters
- bool SkipPseudoOp = true
¶iterator_range<filter_iterator<
BasicBlock::const_iterator,
std::function<bool(const Instruction&)>>>
instructionsWithoutDebug(
bool SkipPseudoOp = true) const
iterator_range<filter_iterator<
BasicBlock::const_iterator,
std::function<bool(const Instruction&)>>>
instructionsWithoutDebug(
bool SkipPseudoOp = true) const
Description
Return a const iterator range over the instructions in the block, skipping any debug instructions. Skip any pseudo operations as well if \c SkipPseudoOp is true.
Declared at: llvm/include/llvm/IR/BasicBlock.h:204
Parameters
- bool SkipPseudoOp = true
¶void invalidateOrders()
void invalidateOrders()
Description
Mark instruction ordering invalid. Done on every instruction insert.
Declared at: llvm/include/llvm/IR/BasicBlock.h:496
¶bool isEHPad() const
bool isEHPad() const
Description
Return true if this basic block is an exception handling block.
Declared at: llvm/include/llvm/IR/BasicBlock.h:466
¶bool isEntryBlock() const
bool isEntryBlock() const
Description
Return true if this is the entry block of the containing function. This method can only be used on blocks that have a parent function.
Declared at: llvm/include/llvm/IR/BasicBlock.h:486
¶bool isInstrOrderValid() const
bool isInstrOrderValid() const
Description
Returns true if the Order field of child Instructions is valid.
Declared at: llvm/include/llvm/IR/BasicBlock.h:491
¶bool isLandingPad() const
bool isLandingPad() const
Description
Return true if this basic block is a landing pad. Being a ``landing pad'' means that the basic block is the destination of the 'unwind' edge of an invoke instruction.
Declared at: llvm/include/llvm/IR/BasicBlock.h:472
¶bool isLegalToHoistInto() const
bool isLegalToHoistInto() const
Description
Return true if it is legal to hoist instructions into this block.
Declared at: llvm/include/llvm/IR/BasicBlock.h:482
¶void moveAfter(llvm::BasicBlock* MovePos)
void moveAfter(llvm::BasicBlock* MovePos)
Description
Unlink this basic block from its current function and insert it right after \p MovePos in the function \p MovePos lives in.
Declared at: llvm/include/llvm/IR/BasicBlock.h:232
Parameters
- llvm::BasicBlock* MovePos
¶void moveBefore(llvm::BasicBlock* MovePos)
void moveBefore(llvm::BasicBlock* MovePos)
Description
Unlink this basic block from its current function and insert it into the function that \p MovePos lives in, right before \p MovePos.
Declared at: llvm/include/llvm/IR/BasicBlock.h:228
Parameters
- llvm::BasicBlock* MovePos
¶iterator_range<llvm::BasicBlock::phi_iterator>
phis()
iterator_range<llvm::BasicBlock::phi_iterator>
phis()
Declared at: llvm/include/llvm/IR/BasicBlock.h:358
¶iterator_range<
llvm::BasicBlock::const_phi_iterator>
phis() const
iterator_range<
llvm::BasicBlock::const_phi_iterator>
phis() const
Description
Returns a range that iterates over the phis in the basic block. Note that this cannot be used with basic blocks that have no terminator.
Declared at: llvm/include/llvm/IR/BasicBlock.h:355
¶void print(
llvm::raw_ostream& OS,
llvm::AssemblyAnnotationWriter* AAW = nullptr,
bool ShouldPreserveUseListOrder = false,
bool IsForDebug = false) const
void print(
llvm::raw_ostream& OS,
llvm::AssemblyAnnotationWriter* AAW = nullptr,
bool ShouldPreserveUseListOrder = false,
bool IsForDebug = false) const
Description
Print the basic block to an output stream with an optional AssemblyAnnotationWriter.
Declared at: llvm/include/llvm/IR/BasicBlock.h:290
Parameters
- llvm::raw_ostream& OS
- llvm::AssemblyAnnotationWriter* AAW = nullptr
- bool ShouldPreserveUseListOrder = false
- bool IsForDebug = false
¶inline llvm::BasicBlock::const_reverse_iterator
rbegin() const
inline llvm::BasicBlock::const_reverse_iterator
rbegin() const
Declared at: llvm/include/llvm/IR/BasicBlock.h:303
¶inline llvm::BasicBlock::reverse_iterator rbegin()
inline llvm::BasicBlock::reverse_iterator rbegin()
Declared at: llvm/include/llvm/IR/BasicBlock.h:302
¶void removeFromParent()
void removeFromParent()
Description
Unlink 'this' from the containing function, but do not delete it.
Declared at: llvm/include/llvm/IR/BasicBlock.h:219
¶void removePredecessor(
llvm::BasicBlock* Pred,
bool KeepOneInputPHIs = false)
void removePredecessor(
llvm::BasicBlock* Pred,
bool KeepOneInputPHIs = false)
Description
Update PHI nodes in this BasicBlock before removal of predecessor \p Pred. Note that this function does not actually remove the predecessor. If \p KeepOneInputPHIs is true then don't remove PHIs that are left with zero or one incoming values, and don't simplify PHIs with all incoming values the same.
Declared at: llvm/include/llvm/IR/BasicBlock.h:396
Parameters
- llvm::BasicBlock* Pred
- bool KeepOneInputPHIs = false
¶inline llvm::BasicBlock::const_reverse_iterator
rend() const
inline llvm::BasicBlock::const_reverse_iterator
rend() const
Declared at: llvm/include/llvm/IR/BasicBlock.h:305
¶inline llvm::BasicBlock::reverse_iterator rend()
inline llvm::BasicBlock::reverse_iterator rend()
Declared at: llvm/include/llvm/IR/BasicBlock.h:304
¶void renumberInstructions()
void renumberInstructions()
Description
Renumber instructions and mark the ordering as valid.
Declared at: llvm/include/llvm/IR/BasicBlock.h:504
¶void replacePhiUsesWith(llvm::BasicBlock* Old,
llvm::BasicBlock* New)
void replacePhiUsesWith(llvm::BasicBlock* Old,
llvm::BasicBlock* New)
Description
Update all phi nodes in this basic block to refer to basic block \p New instead of basic block \p Old.
Declared at: llvm/include/llvm/IR/BasicBlock.h:455
Parameters
- llvm::BasicBlock* Old
- llvm::BasicBlock* New
¶void replaceSuccessorsPhiUsesWith(
llvm::BasicBlock* Old,
llvm::BasicBlock* New)
void replaceSuccessorsPhiUsesWith(
llvm::BasicBlock* Old,
llvm::BasicBlock* New)
Description
Update all phi nodes in this basic block's successors to refer to basic block \p New instead of basic block \p Old.
Declared at: llvm/include/llvm/IR/BasicBlock.h:459
Parameters
- llvm::BasicBlock* Old
- llvm::BasicBlock* New
¶void replaceSuccessorsPhiUsesWith(
llvm::BasicBlock* New)
void replaceSuccessorsPhiUsesWith(
llvm::BasicBlock* New)
Description
Update all phi nodes in this basic block's successors to refer to basic block \p New instead of to it.
Declared at: llvm/include/llvm/IR/BasicBlock.h:463
Parameters
- llvm::BasicBlock* New
¶void setBasicBlockBits(
llvm::BasicBlock::BasicBlockBits AsBits)
void setBasicBlockBits(
llvm::BasicBlock::BasicBlockBits AsBits)
Description
Reinterpret our subclass bits and store them back into Value.
Declared at: llvm/include/llvm/IR/BasicBlock.h:549
Parameters
¶void setParent(llvm::Function* parent)
void setParent(llvm::Function* parent)
Declared at: llvm/include/llvm/IR/BasicBlock.h:67
Parameters
- llvm::Function* parent
¶void setValueSubclassData(unsigned short D)
void setValueSubclassData(unsigned short D)
Description
Shadow Value::setValueSubclassData with a private forwarding method so that any future subclasses cannot accidentally use it.
Declared at: llvm/include/llvm/IR/BasicBlock.h:569
Parameters
- unsigned short D
¶inline size_t size() const
inline size_t size() const
Declared at: llvm/include/llvm/IR/BasicBlock.h:307
¶filter_iterator<
BasicBlock::const_iterator,
std::function<bool(const Instruction&)>>::
difference_type
sizeWithoutDebug() const
filter_iterator<
BasicBlock::const_iterator,
std::function<bool(const Instruction&)>>::
difference_type
sizeWithoutDebug() const
Description
Return the size of the basic block ignoring debug instructions
Declared at: llvm/include/llvm/IR/BasicBlock.h:216
¶llvm::BasicBlock* splitBasicBlock(
llvm::BasicBlock::iterator I,
const llvm::Twine& BBName = "",
bool Before = false)
llvm::BasicBlock* splitBasicBlock(
llvm::BasicBlock::iterator I,
const llvm::Twine& BBName = "",
bool Before = false)
Description
Split the basic block into two basic blocks at the specified instruction. If \p Before is true, splitBasicBlockBefore handles the block splitting. Otherwise, execution proceeds as described below. Note that all instructions BEFORE the specified iterator stay as part of the original basic block, an unconditional branch is added to the original BB, and the rest of the instructions in the BB are moved to the new BB, including the old terminator. The newly formed basic block is returned. This function invalidates the specified iterator. Note that this only works on well formed basic blocks (must have a terminator), and \p 'I' must not be the end of instruction list (which 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). Also note that this doesn't preserve any passes. To split blocks while keeping loop information consistent, use the SplitBlock utility function.
Declared at: llvm/include/llvm/IR/BasicBlock.h:418
Parameters
- llvm::BasicBlock::iterator I
- const llvm::Twine& BBName = ""
- bool Before = false
¶llvm::BasicBlock* splitBasicBlock(
llvm::Instruction* I,
const llvm::Twine& BBName = "",
bool Before = false)
llvm::BasicBlock* splitBasicBlock(
llvm::Instruction* I,
const llvm::Twine& BBName = "",
bool Before = false)
Declared at: llvm/include/llvm/IR/BasicBlock.h:420
Parameters
- llvm::Instruction* I
- const llvm::Twine& BBName = ""
- bool Before = false
¶llvm::BasicBlock* splitBasicBlockBefore(
llvm::BasicBlock::iterator I,
const llvm::Twine& BBName = "")
llvm::BasicBlock* splitBasicBlockBefore(
llvm::BasicBlock::iterator I,
const llvm::Twine& BBName = "")
Description
Split the basic block into two basic blocks at the specified instruction and insert the new basic blocks as the predecessor of the current block. This function ensures all instructions AFTER and including the specified iterator \p I are part of the original basic block. All Instructions BEFORE the iterator \p I are moved to the new BB and an unconditional branch is added to the new BB. The new basic block is returned. Note that this only works on well formed basic blocks (must have a terminator), and \p 'I' must not be the end of instruction list (which 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). \p 'I' cannot be a iterator for a PHINode cannot be a iterator for a PHINode with multiple incoming blocks. Also note that this doesn't preserve any passes. To split blocks while keeping loop information consistent, use the SplitBlockBefore utility function.
Declared at: llvm/include/llvm/IR/BasicBlock.h:442
Parameters
- llvm::BasicBlock::iterator I
- const llvm::Twine& BBName = ""
¶llvm::BasicBlock* splitBasicBlockBefore(
llvm::Instruction* I,
const llvm::Twine& BBName = "")
llvm::BasicBlock* splitBasicBlockBefore(
llvm::Instruction* I,
const llvm::Twine& BBName = "")
Declared at: llvm/include/llvm/IR/BasicBlock.h:443
Parameters
- llvm::Instruction* I
- const llvm::Twine& BBName = ""
¶void validateInstrOrdering() const
void validateInstrOrdering() const
Description
Asserts that instruction order numbers are marked invalid, or that they are in ascending order. This is constant time if the ordering is invalid, and linear in the number of instructions if the ordering is valid. Callers should be careful not to call this in ways that make common operations O(n^2). For example, it takes O(n) time to assign order numbers to instructions, so the order should be validated no more than once after each ordering to ensure that transforms have the same algorithmic complexity when asserts are enabled as when they are disabled.
Declared at: llvm/include/llvm/IR/BasicBlock.h:514
¶~BasicBlock()
~BasicBlock()
Declared at: llvm/include/llvm/IR/BasicBlock.h:81