LLVM API Documentation

llvm::ETForestBase Struct Reference

#include <Dominators.h>

Inheritance diagram for llvm::ETForestBase:

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

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::map< BasicBlock *,
ETNode * > 
ETMapType

Public Member Functions

 ETForestBase (bool isPostDom)
virtual void releaseMemory ()
void updateDFSNumbers ()
bool dominates (BasicBlock *A, BasicBlock *B)
bool properlyDominates (BasicBlock *A, BasicBlock *B)
BasicBlocknearestCommonDominator (BasicBlock *A, BasicBlock *B) const
 Return the nearest common dominator of A and B.
virtual void getAnalysisUsage (AnalysisUsage &AU) const
void addNewBlock (BasicBlock *BB, BasicBlock *IDom)
void setImmediateDominator (BasicBlock *BB, BasicBlock *NewIDom)
virtual void print (std::ostream &OS, const Module *=0) const

Protected Member Functions

ETNodegetNode (BasicBlock *BB) const
ETNodeoperator[] (BasicBlock *BB) const
void reset ()

Protected Attributes

ETMapType Nodes
bool DFSInfoValid
unsigned int SlowQueries

Detailed Description

ET-Forest Class - Class used to construct forwards and backwards ET-Forests

Definition at line 398 of file Dominators.h.


Member Typedef Documentation

typedef std::map<BasicBlock*, ETNode*> llvm::ETForestBase::ETMapType

Definition at line 404 of file Dominators.h.


Constructor & Destructor Documentation

llvm::ETForestBase::ETForestBase ( bool  isPostDom  )  [inline]

Definition at line 399 of file Dominators.h.


Member Function Documentation

void ETForestBase::addNewBlock ( BasicBlock BB,
BasicBlock IDom 
)

addNewBlock - Add a new block to the CFG, with the specified immediate dominator.

Definition at line 888 of file Dominators.cpp.

References BB, DFSInfoValid, getNode(), Nodes, and llvm::ETNode::setFather().

Referenced by llvm::SplitCriticalEdge().

bool llvm::ETForestBase::dominates ( BasicBlock A,
BasicBlock B 
) [inline]

dominates - Return true if A dominates B.

Definition at line 410 of file Dominators.h.

References A, B, DFSInfoValid, llvm::ETNode::DominatedBy(), llvm::ETNode::DominatedBySlow(), getNode(), SlowQueries, and updateDFSNumbers().

Referenced by CalcRegionExitBlocks(), IVUseShouldUsePostIncValue(), and properlyDominates().

virtual void llvm::ETForestBase::getAnalysisUsage ( AnalysisUsage AU  )  const [inline, virtual]

getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.

Reimplemented from llvm::Pass.

Reimplemented in llvm::PostETForest.

Definition at line 448 of file Dominators.h.

References llvm::AnalysisUsage::addRequired(), and llvm::AnalysisUsage::setPreservesAll().

ETNode* llvm::ETForestBase::getNode ( BasicBlock BB  )  const [inline, protected]

getNode - return the (Post)DominatorTree node for the specified basic block. This is the same as using operator[] on this class.

Definition at line 474 of file Dominators.h.

References BB, and Nodes.

Referenced by addNewBlock(), dominates(), nearestCommonDominator(), operator[](), print(), setImmediateDominator(), and updateDFSNumbers().

BasicBlock* llvm::ETForestBase::nearestCommonDominator ( BasicBlock A,
BasicBlock B 
) const [inline]

Return the nearest common dominator of A and B.

Definition at line 438 of file Dominators.h.

References A, B, llvm::ETNode::getData(), getNode(), and llvm::ETNode::NCA().

ETNode* llvm::ETForestBase::operator[] ( BasicBlock BB  )  const [inline, protected]

Definition at line 479 of file Dominators.h.

References BB, and getNode().

void ETForestBase::print ( std::ostream &  OS,
const Module = 0 
) const [virtual]

print - Convert to human readable form

Reimplemented from llvm::Pass.

Definition at line 911 of file Dominators.cpp.

References DFSInfoValid, E, F, getNode(), llvm::DominatorBase::getRoots(), and llvm::WriteAsOperand().

bool llvm::ETForestBase::properlyDominates ( BasicBlock A,
BasicBlock B 
) [inline]

properlyDominates - Return true if A dominates B and A != B.

Definition at line 433 of file Dominators.h.

References A, B, and dominates().

virtual void llvm::ETForestBase::releaseMemory (  )  [inline, virtual]

releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.

Optionally implement this function to release pass memory when it is no longer used.

Reimplemented from llvm::Pass.

Definition at line 402 of file Dominators.h.

References reset().

void ETForestBase::reset (  )  [protected]

Definition at line 810 of file Dominators.cpp.

References E, and Nodes.

Referenced by releaseMemory(), llvm::PostETForest::runOnFunction(), and llvm::ETForest::runOnFunction().

void ETForestBase::setImmediateDominator ( BasicBlock BB,
BasicBlock NewIDom 
)

setImmediateDominator - Update the immediate dominator information to change the current immediate dominator for the specified block to another block. This method requires that BB for NewIDom already have an ETNode, otherwise just use addNewBlock.

Definition at line 897 of file Dominators.cpp.

References BB, DFSInfoValid, getNode(), and Node.

void ETForestBase::updateDFSNumbers (  ) 

Definition at line 816 of file Dominators.cpp.

References BB, llvm::df_begin(), llvm::df_end(), DFSInfoValid, E, getNode(), llvm::DominatorBase::Roots, and SlowQueries.

Referenced by llvm::ETForest::calculate(), and dominates().


Member Data Documentation

bool llvm::ETForestBase::DFSInfoValid [protected]

Definition at line 485 of file Dominators.h.

Referenced by addNewBlock(), llvm::PostETForest::calculate(), dominates(), print(), setImmediateDominator(), and updateDFSNumbers().

ETMapType llvm::ETForestBase::Nodes [protected]

Definition at line 484 of file Dominators.h.

Referenced by addNewBlock(), llvm::PostETForest::calculate(), llvm::ETForest::calculate(), getNode(), llvm::PostETForest::getNodeForBlock(), llvm::ETForest::getNodeForBlock(), and reset().

unsigned int llvm::ETForestBase::SlowQueries [protected]

Definition at line 486 of file Dominators.h.

Referenced by dominates(), and updateDFSNumbers().


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