LLVM API Documentation

llvm::TerminatorInst Class Reference

#include <InstrTypes.h>

Inheritance diagram for llvm::TerminatorInst:

Inheritance graph
[legend]
Collaboration diagram for llvm::TerminatorInst:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual Instructionclone () const =0
unsigned getNumSuccessors () const
BasicBlockgetSuccessor (unsigned idx) const
void setSuccessor (unsigned idx, BasicBlock *B)

Static Public Member Functions

static bool classof (const TerminatorInst *)
static bool classof (const Instruction *I)
 Methods for support type inquiry through isa, cast, and dyn_cast:.
static bool classof (const Value *V)

Protected Member Functions

 TerminatorInst (Instruction::TermOps iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=0)
 TerminatorInst (const Type *Ty, Instruction::TermOps iType, Use *Ops, unsigned NumOps, const std::string &Name="", Instruction *InsertBefore=0)
 TerminatorInst (Instruction::TermOps iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd)
 TerminatorInst (const Type *Ty, Instruction::TermOps iType, Use *Ops, unsigned NumOps, const std::string &Name, BasicBlock *InsertAtEnd)
virtual BasicBlockgetSuccessorV (unsigned idx) const =0
virtual unsigned getNumSuccessorsV () const =0
virtual void setSuccessorV (unsigned idx, BasicBlock *B)=0

Detailed Description

TerminatorInst - Subclasses of this class are all able to terminate a basic block. Thus, these are all the flow control type of operations.

Definition at line 30 of file InstrTypes.h.


Constructor & Destructor Documentation

TerminatorInst::TerminatorInst ( Instruction::TermOps  iType,
Use Ops,
unsigned  NumOps,
Instruction InsertBefore = 0 
) [protected]

Definition at line 41 of file Instructions.cpp.

llvm::TerminatorInst::TerminatorInst ( const Type Ty,
Instruction::TermOps  iType,
Use Ops,
unsigned  NumOps,
const std::string &  Name = "",
Instruction InsertBefore = 0 
) [inline, protected]

Definition at line 34 of file InstrTypes.h.

References Name.

TerminatorInst::TerminatorInst ( Instruction::TermOps  iType,
Use Ops,
unsigned  NumOps,
BasicBlock InsertAtEnd 
) [protected]

Definition at line 46 of file Instructions.cpp.

llvm::TerminatorInst::TerminatorInst ( const Type Ty,
Instruction::TermOps  iType,
Use Ops,
unsigned  NumOps,
const std::string &  Name,
BasicBlock InsertAtEnd 
) [inline, protected]

Definition at line 41 of file InstrTypes.h.


Member Function Documentation

static bool llvm::TerminatorInst::classof ( const Value V  )  [inline, static]

Reimplemented from llvm::Instruction.

Reimplemented in llvm::ReturnInst, llvm::BranchInst, llvm::SwitchInst, llvm::InvokeInst, llvm::UnwindInst, and llvm::UnreachableInst.

Definition at line 78 of file InstrTypes.h.

References classof(), and V.

static bool llvm::TerminatorInst::classof ( const Instruction I  )  [inline, static]

Methods for support type inquiry through isa, cast, and dyn_cast:.

Reimplemented from llvm::Instruction.

Reimplemented in llvm::ReturnInst, llvm::BranchInst, llvm::SwitchInst, llvm::InvokeInst, llvm::UnwindInst, and llvm::UnreachableInst.

Definition at line 75 of file InstrTypes.h.

References llvm::Instruction::getOpcode().

static bool llvm::TerminatorInst::classof ( const TerminatorInst  )  [inline, static]

Definition at line 74 of file InstrTypes.h.

Referenced by classof().

virtual Instruction* llvm::TerminatorInst::clone (  )  const [pure virtual]

clone() - Create a copy of 'this' instruction that is identical in all ways except the following: The instruction has no parent The instruction has no name

Implements llvm::Instruction.

Implemented in llvm::ReturnInst, llvm::BranchInst, llvm::SwitchInst, llvm::InvokeInst, llvm::UnwindInst, and llvm::UnreachableInst.

unsigned llvm::TerminatorInst::getNumSuccessors (  )  const [inline]

getNumSuccessors - Return the number of successors that this terminator has.

Reimplemented in llvm::ReturnInst, llvm::BranchInst, llvm::SwitchInst, llvm::InvokeInst, llvm::UnwindInst, and llvm::UnreachableInst.

Definition at line 57 of file InstrTypes.h.

References getNumSuccessorsV().

Referenced by FoldCondBranchOnPHI(), llvm::ProfileInfoLoader::getBlockCounts(), llvm::ProfileInfoLoader::getEdgeCounts(), llvm::isCriticalEdge(), recBackEdge(), llvm::RemoveSuccessor(), and llvm::SplitCriticalEdge().

virtual unsigned llvm::TerminatorInst::getNumSuccessorsV (  )  const [protected, pure virtual]

Referenced by getNumSuccessors().

BasicBlock* llvm::TerminatorInst::getSuccessor ( unsigned  idx  )  const [inline]

getSuccessor - Return the specified successor.

Reimplemented in llvm::BranchInst, llvm::SwitchInst, and llvm::InvokeInst.

Definition at line 63 of file InstrTypes.h.

References getSuccessorV().

Referenced by FoldCondBranchOnPHI(), llvm::ProfileInfoLoader::getBlockCounts(), llvm::isCriticalEdge(), recBackEdge(), llvm::RemoveSuccessor(), and llvm::SplitCriticalEdge().

virtual BasicBlock* llvm::TerminatorInst::getSuccessorV ( unsigned  idx  )  const [protected, pure virtual]

Virtual methods - Terminators should overload these and provide inline overrides of non-V methods.

Referenced by getSuccessor().

void llvm::TerminatorInst::setSuccessor ( unsigned  idx,
BasicBlock B 
) [inline]

setSuccessor - Update the specified successor to point at the provided block.

Reimplemented in llvm::BranchInst, llvm::SwitchInst, and llvm::InvokeInst.

Definition at line 69 of file InstrTypes.h.

References B, and setSuccessorV().

Referenced by FoldCondBranchOnPHI(), and llvm::SplitCriticalEdge().

virtual void llvm::TerminatorInst::setSuccessorV ( unsigned  idx,
BasicBlock B 
) [protected, pure virtual]

Referenced by setSuccessor().


The documentation for this class was generated from the following files: