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

BasicBlock Class Reference

#include <Function.h>

List of all members.

Public Member Functions

 BasicBlock (FlowGraph *cfg, uint64_t addr)
 ~BasicBlock ()
bool inRange (uint64_t addr)
AddressIterator getInstructionIterator ()
FlowGraphgetFlowGraph ()
uint32_t getIndex ()
uint64_t getBaseAddress ()
uint32_t getSizeInBytes ()
void print ()
RawSectiongetRawSection ()
void setEntry ()
void setExit ()
void setTrace ()
void setJumpTable ()
void setNoPath ()
bool isEntry ()
bool isExit ()
bool isTrace ()
bool isJumpTable ()
bool isNoPath ()
void setIndex (uint32_t idx)
void setSizeInBytes (uint32_t size)
void addEdge (BasicBlock *to)
XCoffFilegetXCoffFile ()
void findMemoryFloatOps ()
uint32_t getInstructionCount ()
HashCode getHashCode ()
void setSources (uint32_t n, BasicBlock **arr)
void setTargets (uint32_t n, BasicBlock **arr)
uint32_t getNumOfMemoryOps ()
uint32_t getNumOfFloatPOps ()
MemoryOperationgetMemoryOp (uint32_t idx)
bool findFirstInstPoint (uint64_t *addr)
uint32_t getNumOfSources ()
uint32_t getNumOfTargets ()
BasicBlockgetSourceBlock (uint32_t idx)
BasicBlockgetTargetBlock (uint32_t idx)
bool isDominatedBy (BasicBlock *bb)
BasicBlockgetImmDominator ()
void setImmDominator (BasicBlock *bb)

Protected Attributes

FlowGraphflowGraph
uint32_t index
uint64_t baseAddress
uint32_t sizeInBytes
uint32_t flags
HashCode hashCode
uint32_t numOfMemoryOps
MemoryOperation ** memoryOps
uint32_t numOfFloatPOps
uint32_t numOfSources
BasicBlock ** sources
uint32_t numOfTargets
BasicBlock ** targets
BasicBlockimmDominatedBy

Static Private Attributes

const uint32_t EntryMask = 0x1
const uint32_t ExitMask = 0x2
const uint32_t TraceMask = 0x4
const uint32_t JumpTableMask = 0x8
const uint32_t NoPathMask = 0x10


Constructor & Destructor Documentation

BasicBlock::BasicBlock FlowGraph cfg,
uint64_t  addr
[inline]
 

Definition at line 74 of file Function.h.

References baseAddress, flags, flowGraph, immDominatedBy, index, numOfFloatPOps, numOfMemoryOps, numOfSources, numOfTargets, sizeInBytes, sources, and targets.

BasicBlock::~BasicBlock  )  [inline]
 

Definition at line 80 of file Function.h.


Member Function Documentation

void BasicBlock::addEdge BasicBlock to  ) 
 

Definition at line 220 of file Function.C.

References ASSERT, isJumpTable(), isTrace(), and PRINT_DEBUG.

bool BasicBlock::findFirstInstPoint uint64_t *  addr  ) 
 

Definition at line 1008 of file Function.C.

References Instruction::definesLeaders(), getInstructionIterator(), getRawSection(), AddressIterator::hasMore(), and RawSection::readInstruction().

Referenced by CountAllBlocks::byteCountForInst(), BasicBlockTracer::byteCountForInst(), BasicBlockCounter::byteCountForInst(), CountAllBlocks::generateCodeForInst(), BasicBlockTracer::generateCodeForInst(), and BasicBlockCounter::generateCodeForInst().

void BasicBlock::findMemoryFloatOps  ) 
 

Definition at line 237 of file Function.C.

References Instruction::bits(), getBaseAddress(), getInstructionCount(), getInstructionIterator(), getRawSection(), AddressIterator::hasMore(), Instruction::isFloatPOperation(), isJumpTable(), Instruction::isMemoryOperation(), isTrace(), Instruction::isUnhandledMemoryOp(), memoryOps, numOfFloatPOps, numOfMemoryOps, PRINT_INFOR, and RawSection::readInstruction().

Referenced by FlowGraph::findMemoryFloatOps().

uint64_t BasicBlock::getBaseAddress  )  [inline]
 

Definition at line 87 of file Function.h.

References baseAddress.

Referenced by compareLoopHeaderVaddr(), findMemoryFloatOps(), Function::generateCFG(), MemoryOperation::getInsnAddr(), BasicBlockTracer::initializeReservedData(), MemoryOperation::MemoryOperation(), Loop::print(), MemoryOperation::print(), CommonMethods::printInstrumentationPoints(), and BasicBlockTracer::reserveDataForInstrumentation().

FlowGraph* BasicBlock::getFlowGraph  )  [inline]
 

Definition at line 85 of file Function.h.

References flowGraph.

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

HashCode BasicBlock::getHashCode  )  [inline]
 

Definition at line 118 of file Function.h.

References hashCode.

Referenced by BasicBlockTracer::byteCountForInst(), CountAllBlocks::generateCodeForInst(), BasicBlockTracer::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), print(), CountAllBlocks::printInstrumentationPoints(), CommonMethods::printInstrumentationPoints(), CountAllBlocks::selectInstrumentationPoints(), CacheSimulator::selectInstrumentationPoints(), BasicBlockTracer::selectInstrumentationPoints(), and BasicBlockCounter::selectInstrumentationPoints().

BasicBlock* BasicBlock::getImmDominator  )  [inline]
 

Definition at line 139 of file Function.h.

References immDominatedBy.

Referenced by isDominatedBy().

uint32_t BasicBlock::getIndex  )  [inline]
 

Definition at line 86 of file Function.h.

References index.

Referenced by FlowGraph::buildLoops(), LengauerTarjan::depthFirstSearch(), FlowGraph::depthFirstSearch(), CountAllBlocks::findTerminationBlock(), CommonMethods::findTerminationBlock(), Function::generateCFG(), LengauerTarjan::immediateDominators(), LengauerTarjan::LengauerTarjan(), MemoryOperation::MemoryOperation(), Function::parseJumpTable(), Loop::print(), print(), CommonMethods::printInstrumentationPoints(), and CacheSimulator::selectInstrumentationPoints().

uint32_t BasicBlock::getInstructionCount  )  [inline]
 

Definition at line 116 of file Function.h.

References sizeInBytes.

Referenced by findMemoryFloatOps(), print(), CountAllBlocks::printInstrumentationPoints(), and CommonMethods::printInstrumentationPoints().

AddressIterator BasicBlock::getInstructionIterator  ) 
 

Definition at line 229 of file Function.C.

References baseAddress, AddressIterator::newAddressIteratorWord(), and sizeInBytes.

Referenced by findFirstInstPoint(), findMemoryFloatOps(), CountAllBlocks::generateCodeForInst(), BasicBlockTracer::generateCodeForInst(), BasicBlockCounter::generateCodeForInst(), and print().

MemoryOperation* BasicBlock::getMemoryOp uint32_t  idx  )  [inline]
 

Definition at line 125 of file Function.h.

References memoryOps, and numOfMemoryOps.

uint32_t BasicBlock::getNumOfFloatPOps  )  [inline]
 

Definition at line 124 of file Function.h.

References numOfFloatPOps.

Referenced by BasicBlockCounter::filterBlockForInst(), FlowGraph::getNumOfFloatPOps(), CountAllBlocks::printInstrumentationPoints(), and CommonMethods::printInstrumentationPoints().

uint32_t BasicBlock::getNumOfMemoryOps  )  [inline]
 

Definition at line 123 of file Function.h.

References numOfMemoryOps.

Referenced by CacheSimulator::byteCountForInst(), CacheSimulator::filterBlockForInst(), BasicBlockCounter::filterBlockForInst(), CacheSimulator::generateCodeForInst(), FlowGraph::getNumOfMemoryOps(), CacheSimulator::initializeReservedData(), CountAllBlocks::printInstrumentationPoints(), CommonMethods::printInstrumentationPoints(), and CacheSimulator::selectInstrumentationPoints().

uint32_t BasicBlock::getNumOfSources  )  [inline]
 

Definition at line 133 of file Function.h.

References numOfSources.

Referenced by FlowGraph::buildLoops(), and LengauerTarjan::immediateDominators().

uint32_t BasicBlock::getNumOfTargets  )  [inline]
 

Definition at line 134 of file Function.h.

References numOfTargets.

Referenced by LengauerTarjan::depthFirstSearch(), and FlowGraph::depthFirstSearch().

RawSection * BasicBlock::getRawSection  ) 
 

Definition at line 233 of file Function.C.

References flowGraph, and FlowGraph::getRawSection().

Referenced by findFirstInstPoint(), findMemoryFloatOps(), and print().

uint32_t BasicBlock::getSizeInBytes  )  [inline]
 

Definition at line 88 of file Function.h.

References sizeInBytes.

Referenced by Function::generateCFG().

BasicBlock* BasicBlock::getSourceBlock uint32_t  idx  )  [inline]
 

Definition at line 135 of file Function.h.

References ASSERT, numOfSources, and sources.

Referenced by FlowGraph::buildLoops(), and LengauerTarjan::immediateDominators().

BasicBlock* BasicBlock::getTargetBlock uint32_t  idx  )  [inline]
 

Definition at line 136 of file Function.h.

References ASSERT, numOfTargets, and targets.

Referenced by LengauerTarjan::depthFirstSearch(), and FlowGraph::depthFirstSearch().

XCoffFile * BasicBlock::getXCoffFile  ) 
 

Definition at line 986 of file Function.C.

References flowGraph, and FlowGraph::getXCoffFile().

Referenced by print().

bool BasicBlock::inRange uint64_t  addr  )  [inline]
 

Definition at line 82 of file Function.h.

References baseAddress, and sizeInBytes.

bool BasicBlock::isDominatedBy BasicBlock bb  ) 
 

Definition at line 1022 of file Function.C.

References getImmDominator().

Referenced by FlowGraph::buildLoops().

bool BasicBlock::isEntry  )  [inline]
 

Definition at line 100 of file Function.h.

References EntryMask, and flags.

Referenced by FlowGraph::getEntryBlock(), and FlowGraph::setImmDominatorBlocks().

bool BasicBlock::isExit  )  [inline]
 

Definition at line 101 of file Function.h.

References ExitMask, and flags.

bool BasicBlock::isJumpTable  )  [inline]
 

Definition at line 103 of file Function.h.

References flags, and JumpTableMask.

Referenced by addEdge(), CountAllBlocks::filterBlockForInst(), CacheSimulator::filterBlockForInst(), BasicBlockTracer::filterBlockForInst(), BasicBlockCounter::filterBlockForInst(), findMemoryFloatOps(), CountAllBlocks::findTerminationBlock(), CommonMethods::findTerminationBlock(), and Function::generateCFG().

bool BasicBlock::isNoPath  )  [inline]
 

Definition at line 104 of file Function.h.

References flags, and NoPathMask.

Referenced by LengauerTarjan::depthFirstSearch(), LengauerTarjan::immediateDominators(), and LengauerTarjan::LengauerTarjan().

bool BasicBlock::isTrace  )  [inline]
 

Definition at line 102 of file Function.h.

References flags, and TraceMask.

Referenced by addEdge(), CountAllBlocks::filterBlockForInst(), CacheSimulator::filterBlockForInst(), BasicBlockTracer::filterBlockForInst(), BasicBlockCounter::filterBlockForInst(), findMemoryFloatOps(), CountAllBlocks::findTerminationBlock(), and CommonMethods::findTerminationBlock().

void BasicBlock::print  ) 
 

Definition at line 273 of file Function.C.

References baseAddress, flags, getHashCode(), getIndex(), getInstructionCount(), getInstructionIterator(), getRawSection(), getXCoffFile(), AddressIterator::hasMore(), immDominatedBy, index, memoryOps, numOfFloatPOps, numOfMemoryOps, numOfSources, numOfTargets, Instruction::print(), MemoryOperation::print(), PRINT_INFOR, RawSection::readInstruction(), sizeInBytes, sources, and targets.

Referenced by FlowGraph::print().

void BasicBlock::setEntry  )  [inline]
 

Definition at line 94 of file Function.h.

References EntryMask, and flags.

Referenced by Function::generateCFG().

void BasicBlock::setExit  )  [inline]
 

Definition at line 95 of file Function.h.

References ExitMask, and flags.

Referenced by Function::generateCFG().

void BasicBlock::setImmDominator BasicBlock bb  )  [inline]
 

Definition at line 140 of file Function.h.

References immDominatedBy.

Referenced by LengauerTarjan::immediateDominators().

void BasicBlock::setIndex uint32_t  idx  ) 
 

Definition at line 304 of file Function.C.

References ASSERT, flowGraph, FlowGraph::getFunction(), Function::getIndex(), RawSection::getIndex(), FlowGraph::getRawSection(), hashCode, index, and HashCode::isBlock().

Referenced by FlowGraph::initializeAllBlocks().

void BasicBlock::setJumpTable  )  [inline]
 

Definition at line 97 of file Function.h.

References flags, and JumpTableMask.

Referenced by Function::parseJumpTable().

void BasicBlock::setNoPath  )  [inline]
 

Definition at line 98 of file Function.h.

References flags, and NoPathMask.

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

void BasicBlock::setSizeInBytes uint32_t  size  )  [inline]
 

Definition at line 108 of file Function.h.

References sizeInBytes.

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

void BasicBlock::setSources uint32_t  n,
BasicBlock **  arr
[inline]
 

Definition at line 120 of file Function.h.

References numOfSources, and sources.

Referenced by Function::generateCFG().

void BasicBlock::setTargets uint32_t  n,
BasicBlock **  arr
[inline]
 

Definition at line 121 of file Function.h.

References numOfTargets, and targets.

Referenced by Function::generateCFG().

void BasicBlock::setTrace  )  [inline]
 

Definition at line 96 of file Function.h.

References flags, and TraceMask.

Referenced by Function::generateCFG().


Member Data Documentation

uint64_t BasicBlock::baseAddress [protected]
 

Definition at line 56 of file Function.h.

Referenced by BasicBlock(), getBaseAddress(), getInstructionIterator(), inRange(), and print().

const uint32_t BasicBlock::EntryMask = 0x1 [static, private]
 

Definition at line 45 of file Function.h.

Referenced by isEntry(), and setEntry().

const uint32_t BasicBlock::ExitMask = 0x2 [static, private]
 

Definition at line 46 of file Function.h.

Referenced by isExit(), and setExit().

uint32_t BasicBlock::flags [protected]
 

Definition at line 59 of file Function.h.

Referenced by BasicBlock(), isEntry(), isExit(), isJumpTable(), isNoPath(), isTrace(), print(), setEntry(), setExit(), setJumpTable(), setNoPath(), and setTrace().

FlowGraph* BasicBlock::flowGraph [protected]
 

Definition at line 53 of file Function.h.

Referenced by BasicBlock(), getFlowGraph(), getRawSection(), getXCoffFile(), and setIndex().

HashCode BasicBlock::hashCode [protected]
 

Definition at line 61 of file Function.h.

Referenced by getHashCode(), and setIndex().

BasicBlock* BasicBlock::immDominatedBy [protected]
 

Definition at line 72 of file Function.h.

Referenced by BasicBlock(), getImmDominator(), print(), and setImmDominator().

uint32_t BasicBlock::index [protected]
 

Definition at line 54 of file Function.h.

Referenced by BasicBlock(), getIndex(), print(), and setIndex().

const uint32_t BasicBlock::JumpTableMask = 0x8 [static, private]
 

Definition at line 48 of file Function.h.

Referenced by isJumpTable(), and setJumpTable().

MemoryOperation** BasicBlock::memoryOps [protected]
 

Definition at line 64 of file Function.h.

Referenced by findMemoryFloatOps(), getMemoryOp(), and print().

const uint32_t BasicBlock::NoPathMask = 0x10 [static, private]
 

Definition at line 49 of file Function.h.

Referenced by isNoPath(), and setNoPath().

uint32_t BasicBlock::numOfFloatPOps [protected]
 

Definition at line 65 of file Function.h.

Referenced by BasicBlock(), findMemoryFloatOps(), getNumOfFloatPOps(), and print().

uint32_t BasicBlock::numOfMemoryOps [protected]
 

Definition at line 63 of file Function.h.

Referenced by BasicBlock(), findMemoryFloatOps(), getMemoryOp(), getNumOfMemoryOps(), and print().

uint32_t BasicBlock::numOfSources [protected]
 

Definition at line 67 of file Function.h.

Referenced by BasicBlock(), getNumOfSources(), getSourceBlock(), print(), and setSources().

uint32_t BasicBlock::numOfTargets [protected]
 

Definition at line 69 of file Function.h.

Referenced by BasicBlock(), getNumOfTargets(), getTargetBlock(), print(), and setTargets().

uint32_t BasicBlock::sizeInBytes [protected]
 

Definition at line 57 of file Function.h.

Referenced by BasicBlock(), getInstructionCount(), getInstructionIterator(), getSizeInBytes(), inRange(), print(), and setSizeInBytes().

BasicBlock** BasicBlock::sources [protected]
 

Definition at line 68 of file Function.h.

Referenced by BasicBlock(), getSourceBlock(), print(), and setSources().

BasicBlock** BasicBlock::targets [protected]
 

Definition at line 70 of file Function.h.

Referenced by BasicBlock(), getTargetBlock(), print(), and setTargets().

const uint32_t BasicBlock::TraceMask = 0x4 [static, private]
 

Definition at line 47 of file Function.h.

Referenced by isTrace(), and setTrace().


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