LLVM API Documentation

llvm::BranchInst Class Reference

#include <Instructions.h>

Inheritance diagram for llvm::BranchInst:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BranchInst (BasicBlock *IfTrue, Instruction *InsertBefore=0)
 BranchInst (BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond, Instruction *InsertBefore=0)
 BranchInst (BasicBlock *IfTrue, BasicBlock *InsertAtEnd)
 BranchInst (BasicBlock *IfTrue, BasicBlock *IfFalse, Value *Cond, BasicBlock *InsertAtEnd)
ValuegetOperand (unsigned i) const
 Transparently provide more efficient getOperand methods.
void setOperand (unsigned i, Value *Val)
virtual BranchInstclone () const
bool isUnconditional () const
bool isConditional () const
ValuegetCondition () const
void setCondition (Value *V)
void setUnconditionalDest (BasicBlock *Dest)
unsigned getNumSuccessors () const
BasicBlockgetSuccessor (unsigned i) const
void setSuccessor (unsigned idx, BasicBlock *NewSucc)

Static Public Member Functions

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

Detailed Description

BranchInst - Conditional or Unconditional Branch instruction.

Definition at line 1082 of file Instructions.h.


Constructor & Destructor Documentation

llvm::BranchInst::BranchInst ( BasicBlock IfTrue,
Instruction InsertBefore = 0 
) [inline]

Definition at line 1097 of file Instructions.h.

llvm::BranchInst::BranchInst ( BasicBlock IfTrue,
BasicBlock IfFalse,
Value Cond,
Instruction InsertBefore = 0 
) [inline]

Definition at line 1102 of file Instructions.h.

llvm::BranchInst::BranchInst ( BasicBlock IfTrue,
BasicBlock InsertAtEnd 
) [inline]

Definition at line 1113 of file Instructions.h.

llvm::BranchInst::BranchInst ( BasicBlock IfTrue,
BasicBlock IfFalse,
Value Cond,
BasicBlock InsertAtEnd 
) [inline]

Definition at line 1119 of file Instructions.h.


Member Function Documentation

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

Reimplemented from llvm::TerminatorInst.

Definition at line 1186 of file Instructions.h.

References llvm::CastInst::classof(), and V.

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

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

Reimplemented from llvm::TerminatorInst.

Definition at line 1183 of file Instructions.h.

References llvm::Instruction::getOpcode().

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

Definition at line 1182 of file Instructions.h.

BranchInst * BranchInst::clone (  )  const [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::TerminatorInst.

Definition at line 1291 of file Instructions.cpp.

Value* llvm::BranchInst::getCondition (  )  const [inline]

Definition at line 1146 of file Instructions.h.

References llvm::UnaryInstruction::getOperand().

Referenced by BlockIsSimpleEnoughToThreadThrough(), FoldCondBranchOnPHI(), GetIfCondition(), GetValueEqualityComparisonCases(), HoistThenElseCodeToIf(), isBlockSimpleEnough(), llvm::MSchedGraphSB::MSchedGraphSB(), llvm::SelectionDAGLowering::visitBr(), and llvm::Interpreter::visitBranchInst().

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

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

Reimplemented from llvm::TerminatorInst.

Definition at line 1168 of file Instructions.h.

Value* llvm::BranchInst::getOperand ( unsigned  i  )  const [inline]

Transparently provide more efficient getOperand methods.

Reimplemented from llvm::User.

Definition at line 1132 of file Instructions.h.

References llvm::UnaryInstruction::getNumOperands().

BasicBlock* llvm::BranchInst::getSuccessor ( unsigned  i  )  const [inline]

getSuccessor - Return the specified successor.

Reimplemented from llvm::TerminatorInst.

Definition at line 1170 of file Instructions.h.

References llvm::UnaryInstruction::getOperand().

Referenced by FoldCondBranchOnPHI(), GetIfCondition(), GetValueEqualityComparisonCases(), HoistThenElseCodeToIf(), llvm::SelectionDAGLowering::visitBr(), and llvm::Interpreter::visitBranchInst().

bool llvm::BranchInst::isConditional (  )  const [inline]

Definition at line 1144 of file Instructions.h.

References llvm::UnaryInstruction::getNumOperands().

Referenced by GetIfCondition(), isBlockSimpleEnough(), and llvm::MSchedGraphSB::MSchedGraphSB().

bool llvm::BranchInst::isUnconditional (  )  const [inline]

Definition at line 1143 of file Instructions.h.

References llvm::UnaryInstruction::getNumOperands().

Referenced by llvm::SelectionDAGLowering::visitBr(), and llvm::Interpreter::visitBranchInst().

void llvm::BranchInst::setCondition ( Value V  )  [inline]

Definition at line 1151 of file Instructions.h.

References llvm::UnaryInstruction::setOperand(), and V.

void llvm::BranchInst::setOperand ( unsigned  i,
Value Val 
) [inline]

Reimplemented from llvm::User.

Definition at line 1136 of file Instructions.h.

References llvm::UnaryInstruction::getNumOperands(), and Val.

void llvm::BranchInst::setSuccessor ( unsigned  idx,
BasicBlock NewSucc 
) [inline]

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

Reimplemented from llvm::TerminatorInst.

Definition at line 1176 of file Instructions.h.

References llvm::UnaryInstruction::setOperand().

void llvm::BranchInst::setUnconditionalDest ( BasicBlock Dest  )  [inline]

Definition at line 1159 of file Instructions.h.

References Dest, llvm::User::NumOperands, and llvm::UnaryInstruction::setOperand().


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