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::PHINode Class Reference

#include <Instructions.h>

Inheritance diagram for llvm::PHINode:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PHINode (const Type *Ty, const std::string &Name="", Instruction *InsertBefore=0)
 PHINode (const Type *Ty, const std::string &Name, BasicBlock *InsertAtEnd)
virtual PHINode * clone () const
unsigned getNumIncomingValues () const
Value * getIncomingValue (unsigned i) const
void setIncomingValue (unsigned i, Value *V)
unsigned getOperandNumForIncomingValue (unsigned i)
BasicBlock * getIncomingBlock (unsigned i) const
void setIncomingBlock (unsigned i, BasicBlock *BB)
unsigned getOperandNumForIncomingBlock (unsigned i)
void addIncoming (Value *V, BasicBlock *BB)
Value * removeIncomingValue (unsigned Idx, bool DeletePHIIfEmpty=true)
Value * removeIncomingValue (const BasicBlock *BB, bool DeletePHIIfEmpty=true)
int getBasicBlockIndex (const BasicBlock *BB) const
Value * getIncomingValueForBlock (const BasicBlock *BB) const

Static Public Member Functions

static bool classof (const PHINode *)
 Methods for support type inquiry through isa, cast, and dyn_cast:.
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

Definition at line 700 of file Instructions.h.


Constructor & Destructor Documentation

llvm::PHINode::PHINode (  const Type *  Ty,
const std::string &  Name = "",
Instruction *  InsertBefore = 0
)  [inline]
 

Definition at line 703 of file Instructions.h.

llvm::PHINode::PHINode (  const Type *  Ty,
const std::string &  Name,
BasicBlock *  InsertAtEnd
)  [inline]
 

Definition at line 708 of file Instructions.h.


Member Function Documentation

void llvm::PHINode::addIncoming (  Value *  V,
BasicBlock *  BB
)  [inline]
 

addIncoming - Add an incoming value to the end of the PHI list

Definition at line 748 of file Instructions.h.

References llvm::Value::getType(), and llvm::User::Operands.

Referenced by AddPredecessorToBlock(), llvm::ConvertExpressionToType(), ConvertOperandToType(), llvm::InlineFunction(), llvm::insertBB(), llvm::BytecodeReader::ParseInstruction(), PropagatePredecessorsForPHIs(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::SimplifyCFG(), and llvm::SplitCriticalEdge().

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

Reimplemented from llvm::Instruction.

Definition at line 789 of file Instructions.h.

References classof().

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

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

Reimplemented from llvm::Instruction.

Definition at line 786 of file Instructions.h.

References llvm::Instruction::getOpcode(), and llvm::Instruction::PHI.

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

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

Definition at line 785 of file Instructions.h.

Referenced by classof().

PHINode * PHINode::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::Instruction.

Definition at line 816 of file Instructions.cpp.

int llvm::PHINode::getBasicBlockIndex (  const BasicBlock *  BB  )  const [inline]
 

getBasicBlockIndex - Return the first index of the specified basic block in the value list for this PHI. Returns -1 if no instance.

Definition at line 774 of file Instructions.h.

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

Referenced by getIncomingValueForBlock(), llvm::insertBB(), PropagatePredecessorsForPHIs(), removeIncomingValue(), and llvm::BasicBlock::splitBasicBlock().

BasicBlock* llvm::PHINode::getIncomingBlock (  unsigned  i  )  const [inline]
 

getIncomingBlock - Return incoming basic block x

Definition at line 734 of file Instructions.h.

References llvm::User::Operands.

Referenced by llvm::ConvertExpressionToType(), ConvertOperandToType(), FindPHIToPartitionLoops(), getBasicBlockIndex(), llvm::Loop::getTripCount(), HoistThenElseCodeToIf(), PropagatePredecessorsForPHIs(), and llvm::BasicBlock::removePredecessor().

Value* llvm::PHINode::getIncomingValue (  unsigned  i  )  const [inline]
 

getIncomingValue - Return incoming value x

Definition at line 720 of file Instructions.h.

References llvm::User::Operands.

Referenced by llvm::ConvertExpressionToType(), ConvertOperandToType(), llvm::ExpressionConvertibleToType(), FindPHIToPartitionLoops(), getIncomingValueForBlock(), llvm::hasConstantValue(), llvm::insertBB(), OperandConvertibleToType(), PropagatePredecessorsForPHIs(), and llvm::SimplifyCFG().

Value* llvm::PHINode::getIncomingValueForBlock (  const BasicBlock *  BB  )  const [inline]
 

Definition at line 780 of file Instructions.h.

References getBasicBlockIndex(), and getIncomingValue().

Referenced by AddPredecessorToBlock(), llvm::CloneTrace(), llvm::Loop::getCanonicalInductionVariable(), HoistThenElseCodeToIf(), llvm::InlineFunction(), SafeToMergeTerminators(), and llvm::SimplifyCFG().

unsigned llvm::PHINode::getNumIncomingValues (   )  const [inline]
 

getNumIncomingValues - Return the number of incoming edges

Definition at line 716 of file Instructions.h.

References llvm::User::Operands.

Referenced by llvm::ExpressionConvertibleToType(), FindPHIToPartitionLoops(), llvm::hasConstantValue(), HoistThenElseCodeToIf(), OperandConvertibleToType(), PropagatePredecessorsForPHIs(), and llvm::BasicBlock::removePredecessor().

unsigned llvm::PHINode::getOperandNumForIncomingBlock (  unsigned  i  )  [inline]
 

Definition at line 742 of file Instructions.h.

unsigned llvm::PHINode::getOperandNumForIncomingValue (  unsigned  i  )  [inline]
 

Definition at line 728 of file Instructions.h.

Value* llvm::PHINode::removeIncomingValue (  const BasicBlock *  BB,
bool  DeletePHIIfEmpty = true
)  [inline]
 

Definition at line 765 of file Instructions.h.

References getBasicBlockIndex(), and removeIncomingValue().

Value * PHINode::removeIncomingValue (  unsigned  Idx,
bool  DeletePHIIfEmpty = true
) 
 

removeIncomingValue - Remove an incoming value. This is useful if a predecessor basic block is deleted. The value removed is returned.

If the last incoming value for a PHI node is removed (and DeletePHIIfEmpty is true), the PHI node is destroyed and any uses of it are replaced with dummy values. The only time there should be zero incoming values to a PHI node is when the block is dead, so this strategy is sound.

Definition at line 51 of file InstrTypes.cpp.

References llvm::BasicBlock::getInstList(), llvm::Constant::getNullValue(), llvm::User::getNumOperands(), llvm::Instruction::getParent(), llvm::Value::getType(), llvm::User::Operands, and llvm::Value::replaceAllUsesWith().

Referenced by llvm::ConvertExpressionToType(), ConvertOperandToType(), PropagatePredecessorsForPHIs(), removeIncomingValue(), llvm::BasicBlock::removePredecessor(), and llvm::SplitCriticalEdge().

void llvm::PHINode::setIncomingBlock (  unsigned  i,
BasicBlock *  BB
)  [inline]
 

Definition at line 738 of file Instructions.h.

References llvm::User::Operands.

Referenced by llvm::insertBB(), and llvm::BasicBlock::splitBasicBlock().

void llvm::PHINode::setIncomingValue (  unsigned  i,
Value *  V
)  [inline]
 

Definition at line 724 of file Instructions.h.

References llvm::User::Operands.

Referenced by HoistThenElseCodeToIf().


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