class BasicBlock

Declaration

class BasicBlock : public Value { /* full declaration omitted */ };

Declared at: llvm/include/llvm/IR/BasicBlock.h:57

Inherits from: Value

Member Variables

Inherited from Value:

protected SubclassOptionalData
protected NumUserOperands
protected IsUsedByMD
protected HasName
protected HasHungOffUses
protected HasDescriptor
public static MaxAlignmentExponent = 29
public static MaximumAlignment = 1U << MaxAlignmentExponent

Method Overview

Inherited from Value:

Methods

BasicBlock(const llvm::BasicBlock&)

Declared at: llvm/include/llvm/IR/BasicBlock.h:81

Parameters

const llvm::BasicBlock&

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:99

Parameters

llvm::LLVMContext& Context
const llvm::Twine& Name = ""
llvm::Function* Parent = nullptr
llvm::BasicBlock* InsertBefore = nullptr

inline const llvm::Instruction& back() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:287

inline llvm::Instruction& back()

Declared at: llvm/include/llvm/IR/BasicBlock.h:288

inline int begin() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:274

inline int begin()

Declared at: llvm/include/llvm/IR/BasicBlock.h:273

bool canSplitPredecessors() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:372

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:350

Parameters

const llvm::Value* V

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:362

inline bool empty() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:284

inline int end() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:276

inline int end()

Declared at: llvm/include/llvm/IR/BasicBlock.h:275

int eraseFromParent()

Declared at: llvm/include/llvm/IR/BasicBlock.h:206

inline const llvm::Instruction& front() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:285

inline llvm::Instruction& front()

Declared at: llvm/include/llvm/IR/BasicBlock.h:286

llvm::LLVMContext& getContext() const

Description

Get the context in which this basic block lives.

Declared at: llvm/include/llvm/IR/BasicBlock.h:86

int getFirstInsertionPt() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:177

int getFirstInsertionPt()

Declared at: llvm/include/llvm/IR/BasicBlock.h:178

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:151

llvm::Instruction* getFirstNonPHI()

Declared at: llvm/include/llvm/IR/BasicBlock.h:152

const llvm::Instruction* getFirstNonPHIOrDbg()
    const

Description

Returns a pointer to the first instruction in this block that is not a PHINode or a debug intrinsic.

Declared at: llvm/include/llvm/IR/BasicBlock.h:159

llvm::Instruction* getFirstNonPHIOrDbg()

Declared at: llvm/include/llvm/IR/BasicBlock.h:160

const llvm::Instruction*
getFirstNonPHIOrDbgOrLifetime() const

Description

Returns a pointer to the first instruction in this block that is not a PHINode, a debug intrinsic, or a lifetime intrinsic.

Declared at: llvm/include/llvm/IR/BasicBlock.h:167

llvm::Instruction* getFirstNonPHIOrDbgOrLifetime()

Declared at: llvm/include/llvm/IR/BasicBlock.h:168

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:338

llvm::BasicBlock::InstListType& getInstList()

Declared at: llvm/include/llvm/IR/BasicBlock.h:339

Optional<uint64_t> getIrrLoopHeaderWeight() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:429

llvm::LandingPadInst* getLandingPadInst()

Declared at: llvm/include/llvm/IR/BasicBlock.h:421

const llvm::LandingPadInst* getLandingPadInst()
    const

Description

Return the landingpad instruction associated with the landing pad.

Declared at: llvm/include/llvm/IR/BasicBlock.h:420

llvm::Module* getModule()

Declared at: llvm/include/llvm/IR/BasicBlock.h:114

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:113

const llvm::Function* getParent() const

Description

Return the enclosing method, or null if none.

Declared at: llvm/include/llvm/IR/BasicBlock.h:106

llvm::Function* getParent()

Declared at: llvm/include/llvm/IR/BasicBlock.h:107

llvm::BasicBlock* getSinglePredecessor()

Declared at: llvm/include/llvm/IR/BasicBlock.h:227

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:226

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:254

llvm::BasicBlock* getSingleSuccessor()

Declared at: llvm/include/llvm/IR/BasicBlock.h:255

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:342

Parameters

llvm::Instruction*

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:130

llvm::CallInst* getTerminatingDeoptimizeCall()

Declared at: llvm/include/llvm/IR/BasicBlock.h:131

llvm::CallInst* getTerminatingMustTailCall()

Declared at: llvm/include/llvm/IR/BasicBlock.h:140

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:139

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:121

llvm::Instruction* getTerminator()

Declared at: llvm/include/llvm/IR/BasicBlock.h:122

llvm::BasicBlock* getUniquePredecessor()

Declared at: llvm/include/llvm/IR/BasicBlock.h:239

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:238

llvm::BasicBlock* getUniqueSuccessor()

Declared at: llvm/include/llvm/IR/BasicBlock.h:265

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:264

llvm::ValueSymbolTable* getValueSymbolTable()

Description

Returns a pointer to the symbol table if one exists.

Declared at: llvm/include/llvm/IR/BasicBlock.h:347

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:396

bool hasNPredecessors(unsigned int N) const

Description

Return true if this block has exactly N predecessors.

Declared at: llvm/include/llvm/IR/BasicBlock.h:245

Parameters

unsigned int N

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:248

Parameters

unsigned int N

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:222

Parameters

llvm::Function* Parent
llvm::BasicBlock* InsertBefore = nullptr

bool isEHPad() const

Description

Return true if this basic block is an exception handling block.

Declared at: llvm/include/llvm/IR/BasicBlock.h:411

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:417

bool isLegalToHoistInto() const

Description

Return true if it is legal to hoist instructions into this block.

Declared at: llvm/include/llvm/IR/BasicBlock.h:427

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:214

Parameters

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:210

Parameters

llvm::BasicBlock* MovePos

int phis()

Declared at: llvm/include/llvm/IR/BasicBlock.h:332

int phis() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:329

inline int rbegin()

Declared at: llvm/include/llvm/IR/BasicBlock.h:278

inline int rbegin() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:279

void removeFromParent()

Description

Unlink 'this' from the containing function, but do not delete it.

Declared at: llvm/include/llvm/IR/BasicBlock.h:201

void removePredecessor(
    llvm::BasicBlock* Pred,
    bool KeepOneInputPHIs = false)

Description

Notify the BasicBlock that the predecessor \p Pred 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.

Declared at: llvm/include/llvm/IR/BasicBlock.h:370

Parameters

llvm::BasicBlock* Pred
bool KeepOneInputPHIs = false

inline int rend() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:281

inline int rend()

Declared at: llvm/include/llvm/IR/BasicBlock.h:280

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:400

Parameters

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:404

Parameters

llvm::BasicBlock* Old
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:408

Parameters

llvm::BasicBlock* New

inline size_t size() const

Declared at: llvm/include/llvm/IR/BasicBlock.h:283

llvm::BasicBlock* splitBasicBlock(
    llvm::Instruction* I,
    const llvm::Twine& BBName = "")

Declared at: llvm/include/llvm/IR/BasicBlock.h:390

Parameters

llvm::Instruction* I
const llvm::Twine& BBName = ""

llvm::BasicBlock* splitBasicBlock(
    int I,
    const llvm::Twine& BBName = "")

Declared at: llvm/include/llvm/IR/BasicBlock.h:389

Parameters

int I
const llvm::Twine& BBName = ""

~BasicBlock()

Declared at: llvm/include/llvm/IR/BasicBlock.h:83