Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

FlowGraph Class Reference

#include <Function.h>

List of all members.

Public Member Functions

 FlowGraph (Function *f)
 ~FlowGraph ()
RawSectiongetRawSection ()
void print ()
uint32_t getIndex ()
FunctiongetFunction ()
void assignSequenceNumbers ()
uint32_t initializeAllBlocks (BasicBlock **blockArr, BasicBlock *traceBlock, uint32_t arrCount)
XCoffFilegetXCoffFile ()
void findMemoryFloatOps ()
BasicBlock ** getAllBlocks ()
uint32_t getAllBlocks (BasicBlock **arr)
BitSet< BasicBlock * > * newBitSet ()
BasicBlockgetBlock (uint32_t idx)
uint32_t getNumOfBasicBlocks ()
uint32_t getNumOfMemoryOps ()
uint32_t getNumOfFloatPOps ()
BasicBlockgetEntryBlock ()
LoopgetLoop (uint32_t idx)
uint32_t getNumberOfLoops ()
void buildLoops ()
void printInnerLoops ()
void depthFirstSearch (BasicBlock *root, BitSet< BasicBlock * > *visitedSet, bool set, BitSet< BasicBlock * > *completedSet=NULL, LinkedList< BasicBlock * > *backEdges=NULL)
void setImmDominatorBlocks (BasicBlock *root=NULL)

Protected Attributes

Functionfunction
uint32_t numOfBasicBlocks
BasicBlock ** basicBlocks
uint32_t numberOfLoops
Loop ** loops


Constructor & Destructor Documentation

FlowGraph::FlowGraph Function f  )  [inline]
 

Definition at line 155 of file Function.h.

References basicBlocks, function, loops, numberOfLoops, and numOfBasicBlocks.

FlowGraph::~FlowGraph  )  [inline]
 

Definition at line 156 of file Function.h.


Member Function Documentation

void FlowGraph::assignSequenceNumbers  ) 
 

void FlowGraph::buildLoops  ) 
 

Definition at line 53 of file Function.C.

References ASSERT, BitSet< T >::clear(), Stack< T >::clear(), compareLoopHeaderVaddr(), BitSet< T >::contains(), DEBUG_MORE, depthFirstSearch(), Stack< T >::empty(), LinkedList< T >::empty(), function, getAllBlocks(), BasicBlock::getIndex(), getIndex(), Function::getIndex(), BasicBlock::getNumOfSources(), BasicBlock::getSourceBlock(), LinkedList< T >::insert(), BitSet< T >::insert(), BasicBlock::isDominatedBy(), loops, newBitSet(), numberOfLoops, numOfBasicBlocks, Stack< T >::pop(), Loop::print(), PRINT_DEBUG, printInnerLoops(), Stack< T >::push(), Loop::setIndex(), LinkedList< T >::shift(), and LinkedList< T >::size().

Referenced by Function::buildLoops().

void FlowGraph::depthFirstSearch BasicBlock root,
BitSet< BasicBlock * > *  visitedSet,
bool  set,
BitSet< BasicBlock * > *  completedSet = NULL,
LinkedList< BasicBlock * > *  backEdges = NULL
 

Definition at line 915 of file Function.C.

References BitSet< T >::contains(), BasicBlock::getIndex(), BasicBlock::getNumOfTargets(), BasicBlock::getTargetBlock(), LinkedList< T >::insert(), BitSet< T >::insert(), and BitSet< T >::remove().

Referenced by buildLoops(), and Function::generateCFG().

void FlowGraph::findMemoryFloatOps  ) 
 

Definition at line 363 of file Function.C.

References basicBlocks, BasicBlock::findMemoryFloatOps(), and numOfBasicBlocks.

Referenced by Function::findMemoryFloatOps().

uint32_t FlowGraph::getAllBlocks BasicBlock **  arr  ) 
 

Definition at line 321 of file Function.C.

References basicBlocks, and numOfBasicBlocks.

BasicBlock** FlowGraph::getAllBlocks  )  [inline]
 

Definition at line 170 of file Function.h.

References basicBlocks.

Referenced by buildLoops(), TextSection::getAllBlocks(), and setImmDominatorBlocks().

BasicBlock* FlowGraph::getBlock uint32_t  idx  )  [inline]
 

Definition at line 175 of file Function.h.

References basicBlocks, and numOfBasicBlocks.

Referenced by Function::generateCFG(), Loop::getAllBlocks(), and Function::getBlock().

BasicBlock * FlowGraph::getEntryBlock  ) 
 

Definition at line 150 of file Function.C.

References ASSERT, basicBlocks, BasicBlock::isEntry(), and numOfBasicBlocks.

Function* FlowGraph::getFunction  )  [inline]
 

Definition at line 161 of file Function.h.

References function.

Referenced by CountAllBlocks::findTerminationBlock(), CommonMethods::findTerminationBlock(), MemoryOperation::MemoryOperation(), CommonMethods::printInstrumentationPoints(), and BasicBlock::setIndex().

uint32_t FlowGraph::getIndex  ) 
 

Definition at line 317 of file Function.C.

References function, and Function::getIndex().

Referenced by buildLoops(), Loop::print(), and print().

Loop* FlowGraph::getLoop uint32_t  idx  )  [inline]
 

Definition at line 181 of file Function.h.

References ASSERT, loops, and numberOfLoops.

Referenced by CommonMethods::printInstrumentationPoints(), and CacheSimulator::selectInstrumentationPoints().

uint32_t FlowGraph::getNumberOfLoops  )  [inline]
 

Definition at line 182 of file Function.h.

References numberOfLoops.

Referenced by CommonMethods::printInstrumentationPoints(), and CacheSimulator::selectInstrumentationPoints().

uint32_t FlowGraph::getNumOfBasicBlocks  )  [inline]
 

Definition at line 177 of file Function.h.

References numOfBasicBlocks.

Referenced by Loop::getAllBlocks(), TextSection::getNumberOfBlocks(), Loop::isIdenticalLoop(), Loop::isInnerLoop(), Loop::print(), and setImmDominatorBlocks().

uint32_t FlowGraph::getNumOfFloatPOps  ) 
 

Definition at line 999 of file Function.C.

References basicBlocks, BasicBlock::getNumOfFloatPOps(), and numOfBasicBlocks.

Referenced by TextSection::getNumberOfFloatPOps().

uint32_t FlowGraph::getNumOfMemoryOps  ) 
 

Definition at line 990 of file Function.C.

References basicBlocks, BasicBlock::getNumOfMemoryOps(), and numOfBasicBlocks.

Referenced by TextSection::getNumberOfMemoryOps().

RawSection * FlowGraph::getRawSection  ) 
 

Definition at line 313 of file Function.C.

References function, and Function::getRawSection().

Referenced by BasicBlock::getRawSection(), MemoryOperation::MemoryOperation(), and BasicBlock::setIndex().

XCoffFile * FlowGraph::getXCoffFile  ) 
 

Definition at line 982 of file Function.C.

References function, and Function::getXCoffFile().

Referenced by BasicBlock::getXCoffFile().

uint32_t FlowGraph::initializeAllBlocks BasicBlock **  blockArr,
BasicBlock traceBlock,
uint32_t  arrCount
 

Definition at line 327 of file Function.C.

References ASSERT, basicBlocks, numOfBasicBlocks, and BasicBlock::setIndex().

Referenced by Function::generateCFG().

BitSet< BasicBlock * > * FlowGraph::newBitSet  ) 
 

Definition at line 393 of file Function.C.

References basicBlocks, and numOfBasicBlocks.

Referenced by buildLoops(), and Function::generateCFG().

void FlowGraph::print  ) 
 

Definition at line 373 of file Function.C.

References basicBlocks, function, Function::getHashCode(), getIndex(), HashCode::getValue(), loops, numberOfLoops, numOfBasicBlocks, Loop::print(), BasicBlock::print(), and PRINT_INFOR.

Referenced by Function::print().

void FlowGraph::printInnerLoops  ) 
 

Definition at line 25 of file Function.C.

References ASSERT, Loop::isInnerLoop(), loops, numberOfLoops, and PRINT_INFOR.

Referenced by buildLoops().

void FlowGraph::setImmDominatorBlocks BasicBlock root = NULL  ) 
 

Definition at line 904 of file Function.C.

References ASSERT, getAllBlocks(), getNumOfBasicBlocks(), LengauerTarjan::immediateDominators(), and BasicBlock::isEntry().

Referenced by Function::generateCFG().


Member Data Documentation

BasicBlock** FlowGraph::basicBlocks [protected]
 

Definition at line 149 of file Function.h.

Referenced by findMemoryFloatOps(), FlowGraph(), getAllBlocks(), getBlock(), getEntryBlock(), getNumOfFloatPOps(), getNumOfMemoryOps(), initializeAllBlocks(), newBitSet(), and print().

Function* FlowGraph::function [protected]
 

Definition at line 146 of file Function.h.

Referenced by buildLoops(), FlowGraph(), getFunction(), getIndex(), getRawSection(), getXCoffFile(), and print().

Loop** FlowGraph::loops [protected]
 

Definition at line 152 of file Function.h.

Referenced by buildLoops(), FlowGraph(), getLoop(), print(), and printInnerLoops().

uint32_t FlowGraph::numberOfLoops [protected]
 

sorted according to the base address,index is basic block id*

Definition at line 151 of file Function.h.

Referenced by buildLoops(), FlowGraph(), getLoop(), getNumberOfLoops(), print(), and printInnerLoops().

uint32_t FlowGraph::numOfBasicBlocks [protected]
 

Definition at line 148 of file Function.h.

Referenced by buildLoops(), findMemoryFloatOps(), FlowGraph(), getAllBlocks(), getBlock(), getEntryBlock(), getNumOfBasicBlocks(), getNumOfFloatPOps(), getNumOfMemoryOps(), initializeAllBlocks(), newBitSet(), and print().


The documentation for this class was generated from the following files:
Generated on Mon Jan 28 11:08:38 2008 for PMaCInstrumentor by doxygen 1.3.5