LLVM API Documentation

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 ()
void reserveOperandSpace (unsigned NumValues)
virtual PHINodeclone () const
 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value)
 Provide fast operand accessors.
unsigned getNumIncomingValues () const
ValuegetIncomingValue (unsigned i) const
void setIncomingValue (unsigned i, Value *V)
unsigned getOperandNumForIncomingValue (unsigned i)
BasicBlockgetIncomingBlock (unsigned i) const
void setIncomingBlock (unsigned i, BasicBlock *BB)
unsigned getOperandNumForIncomingBlock (unsigned i)
void addIncoming (Value *V, BasicBlock *BB)
ValueremoveIncomingValue (unsigned Idx, bool DeletePHIIfEmpty=true)
ValueremoveIncomingValue (const BasicBlock *BB, bool DeletePHIIfEmpty=true)
int getBasicBlockIndex (const BasicBlock *BB) const
ValuegetIncomingValueForBlock (const BasicBlock *BB) const
ValuehasConstantValue (bool AllowNonDominatingInstruction=false) const

Static Public Member Functions

static PHINodeCreate (const Type *Ty, const std::string &NameStr="", Instruction *InsertBefore=0)
static PHINodeCreate (const Type *Ty, const std::string &NameStr, BasicBlock *InsertAtEnd)
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 1875 of file Instructions.h.


Constructor & Destructor Documentation

PHINode::~PHINode (  ) 

Definition at line 183 of file Instructions.cpp.

References llvm::User::dropHungoffUses(), and llvm::User::OperandList.


Member Function Documentation

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

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

Definition at line 1902 of file Instructions.h.

void llvm::PHINode::reserveOperandSpace ( unsigned  NumValues  )  [inline]

reserveOperandSpace - This method can be used to avoid repeated reallocation of PHI operand lists by reserving space for the correct number of operands before adding them. Unlike normal vector reserves, this method can also be used to trim the operand space.

Definition at line 1912 of file Instructions.h.

Referenced by LowerPartSelect(), and LowerPartSet().

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 2945 of file Instructions.cpp.

llvm::PHINode::DECLARE_TRANSPARENT_OPERAND_ACCESSORS ( Value   ) 

Provide fast operand accessors.

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

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

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

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

Definition at line 1935 of file Instructions.h.

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

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

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

Definition at line 1947 of file Instructions.h.

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

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 190 of file Instructions.cpp.

References llvm::Instruction::eraseFromParent(), llvm::UndefValue::get(), llvm::User::getNumOperands(), llvm::Value::getType(), llvm::User::NumOperands, llvm::User::OperandList, llvm::Value::replaceAllUsesWith(), and llvm::Use::set().

Referenced by llvm::CloneAndPruneFunctionInto(), llvm::BasicBlock::removePredecessor(), llvm::SplitBlockPredecessors(), TryToSimplifyUncondBranchFromEmptyBlock(), and llvm::UnrollLoop().

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

Definition at line 1977 of file Instructions.h.

References Idx.

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

Referenced by SimplifyCondBranchToCondBranch(), llvm::BasicBlock::splitBasicBlock(), and llvm::SplitCriticalEdge().

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

Value * PHINode::hasConstantValue ( bool  AllowNonDominatingInstruction = false  )  const

hasConstantValue - If the specified PHI node always merges together the same value, return the value, otherwise return null.

hasConstantValue - If the specified PHI node always merges together the same value, return the value, otherwise return null.

Definition at line 252 of file Instructions.cpp.

References llvm::UndefValue::get(), getIncomingValue(), getNumIncomingValues(), and llvm::Value::getType().

Referenced by FindPHIToPartitionLoops(), llvm::BasicBlock::removePredecessor(), and llvm::SplitBlockPredecessors().

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

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

Definition at line 2003 of file Instructions.h.

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

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

Reimplemented from llvm::Instruction.

Definition at line 2004 of file Instructions.h.

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

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

Reimplemented from llvm::Instruction.

Definition at line 2007 of file Instructions.h.


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



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.