LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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)
virtual BranchInst * clone () const
 Terminators must implement the methods required by Instruction...
bool isUnconditional () const
bool isConditional () const
Value * getCondition () const
void setCondition (Value *V)
void setUnconditionalDest (BasicBlock *Dest)
virtual const BasicBlock * getSuccessor (unsigned i) const
BasicBlock * getSuccessor (unsigned idx)
virtual void setSuccessor (unsigned idx, BasicBlock *NewSucc)
 Set a successor at a given index.
virtual unsigned getNumSuccessors () const

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 871 of file Instructions.h.


Constructor & Destructor Documentation

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

Definition at line 883 of file Instructions.h.

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

Definition at line 887 of file Instructions.h.

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

Definition at line 893 of file Instructions.h.

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

Definition at line 898 of file Instructions.h.


Member Function Documentation

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

Reimplemented from llvm::TerminatorInst.

Definition at line 949 of file Instructions.h.

References classof().

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 946 of file Instructions.h.

References llvm::ISD::Br, and llvm::Instruction::getOpcode().

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

Definition at line 945 of file Instructions.h.

Referenced by classof().

BranchInst * BranchInst::clone (   )  const [virtual]
 

Terminators must implement the methods required by Instruction...

Implements llvm::TerminatorInst.

Definition at line 818 of file Instructions.cpp.

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

Definition at line 909 of file Instructions.h.

References isConditional(), and llvm::User::Operands.

Referenced by GetIfCondition(), GetValueEqualityComparisonCases(), HoistThenElseCodeToIf(), isBlockSimpleEnough(), llvm::SimplifyCFG(), llvm::SelectionDAGBuilder::visitBr(), and llvm::Interpreter::visitBranchInst().

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

Implements llvm::TerminatorInst.

Definition at line 942 of file Instructions.h.

References isConditional().

Referenced by getSuccessor(), setSuccessor(), and llvm::valueAssignmentToEdges().

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

Reimplemented from llvm::TerminatorInst.

Definition at line 932 of file Instructions.h.

References getSuccessor().

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

Additionally, they must provide a method to get at the successors of this terminator instruction. 'idx' may not be >= the number of successors returned by getNumSuccessors()!

Implements llvm::TerminatorInst.

Definition at line 927 of file Instructions.h.

References getNumSuccessors(), and llvm::User::Operands.

Referenced by GetIfCondition(), getSuccessor(), GetValueEqualityComparisonCases(), HoistThenElseCodeToIf(), llvm::insertBB(), llvm::SimplifyCFG(), llvm::valueAssignmentToEdges(), llvm::SelectionDAGBuilder::visitBr(), and llvm::Interpreter::visitBranchInst().

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

Definition at line 907 of file Instructions.h.

References llvm::User::Operands.

Referenced by getCondition(), GetIfCondition(), getNumSuccessors(), isBlockSimpleEnough(), setCondition(), and setUnconditionalDest().

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

Definition at line 906 of file Instructions.h.

References llvm::User::Operands.

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

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

Definition at line 914 of file Instructions.h.

References isConditional(), and llvm::User::setOperand().

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

Set a successor at a given index.

Implements llvm::TerminatorInst.

Definition at line 937 of file Instructions.h.

References getNumSuccessors(), and llvm::User::Operands.

Referenced by llvm::insertBB().

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

Definition at line 922 of file Instructions.h.

References isConditional(), and llvm::User::Operands.

Referenced by llvm::insertBB().


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