BasicBlock Class Reference

#include <include/basicblock.h>

List of all members.


Detailed Description

Definition at line 129 of file basicblock.h.

Public Types

typedef std::list< Exp
* >::iterator 
elit
typedef std::list< RTL
* >::iterator 
rtlit
 Get first/next statement this BB Somewhat intricate because of the post call semantics; these funcs save a lot of duplicated, easily-bugged code.
typedef std::list< RTL
* >::reverse_iterator 
rtlrit

Public Member Functions

void addInEdge (PBB newInEdge)
 BasicBlock (const BasicBlock &bb)
 BasicBlock ()
bool calcLiveness (ConnectionGraph &ig, UserProc *proc)
bool decodeIndirectJmp (UserProc *proc)
void deleteEdge (PBB edge)
void deleteInEdge (PBB edge)
void deleteInEdge (std::vector< PBB >::iterator &it)
unsigned DFTOrder (int &first, int &last)
void dump ()
int findNumCases ()
void generateBodyCode (HLLCode &hll, bool dup=false)
void generateCode (HLLCode *hll, int indLevel, PBB latch, std::list< PBB > &followSet, std::list< PBB > &gotoSet, UserProc *proc)
ADDRESS getCallDest ()
ProcgetCallDestProc ()
ExpgetCond () throw (LastStatementNotABranchError)
PBB getCorrectOutEdge (ADDRESS a)
ExpgetDest () throw (LastStatementNotAGotoError)
ProcgetDestProc ()
StatementgetFirstStmt ()
StatementgetFirstStmt (rtlit &rit, StatementList::iterator &sit)
ADDRESS getHiAddr ()
std::vector< PBB > & getInEdges ()
int getLabel ()
std::string & getLabelStr ()
RTLgetLastRtl ()
StatementgetLastStmt ()
StatementgetLastStmt (rtlrit &rit, StatementList::reverse_iterator &sit)
void getLiveOut (LocationSet &live, LocationSet &phiLocs)
BasicBlockgetLoopBody ()
ADDRESS getLowAddr ()
StatementgetNextStmt (rtlit &rit, StatementList::iterator &sit)
int getNumInEdges ()
int getNumOutEdges ()
PBB getOutEdge (unsigned int i)
std::vector< PBB > & getOutEdges ()
StatementgetPrevStmt (rtlrit &rit, StatementList::reverse_iterator &sit)
std::list< RTL * > * getRTLs ()
RTLgetRTLWithStatement (Statement *stmt)
void getStatements (StatementList &stmts)
char * getStmtNumber ()
 Get the statement number for the first BB as a character array.
BBTYPE getType ()
bool isBackEdge (int inEdge)
bool isCaseOption ()
bool isJmpZ (PBB dest)
bool isJumpReqd ()
bool isLabelNeeded ()
bool isPostCall ()
bool isTraversed ()
void prependStmt (Statement *s, UserProc *proc)
void print (std::ostream &os, bool html=false)
char * prints ()
void printToLog ()
void processSwitch (UserProc *proc)
void resetDFASets ()
unsigned RevDFTOrder (int &first, int &last)
void setCond (Exp *e) throw (LastStatementNotABranchError)
void setInEdge (int i, PBB newIn)
void setJumpReqd ()
void setLabelNeeded (bool b)
void setLabelStr (std::string &s)
void setOutEdge (int i, PBB newInEdge)
void setTraversed (bool bTraversed)
void simplify ()
bool undoComputedBB (Statement *stmt)
void updateType (BBTYPE bbType, int iNumOutEdges)
int whichPred (PBB pred)
 ~BasicBlock ()

Static Public Member Functions

static void doAvail (StatementSet &s, PBB inEdge)
static bool lessAddress (PBB bb1, PBB bb2)
static bool lessFirstDFT (PBB bb1, PBB bb2)
static bool lessLastDFT (PBB bb1, PBB bb2)

Public Attributes

PBB m_caseHead
PBB m_condFollow
int m_DFTfirst
int m_DFTlast
int m_DFTrevfirst
int m_DFTrevlast
PBB m_latchNode
SBBTYPE m_loopCondType
PBB m_loopFollow
PBB m_loopHead
SBBTYPE m_structType
bool overlappedRegProcessingDone

Protected Member Functions

void addLiveIn (Exp *e)
void addOutEdge (PBB bb)
void addRTL (RTL *rtl)
bool allParentsGenerated ()
void emitGotoAndLabel (HLLCode *hll, int indLevel, PBB dest)
PBB getCaseHead ()
PBB getCondFollow ()
condType getCondType ()
PBB getLatchNode ()
PBB getLoopFollow ()
PBB getLoopHead ()
loopType getLoopType ()
structType getStructType ()
unstructType getUnstructType ()
bool hasBackEdge ()
bool hasBackEdgeTo (BasicBlock *dest)
char * indent (int indLevel, int extra=0)
bool inLoop (PBB header, PBB latch)
bool isAncestorOf (BasicBlock *other)
bool isIn (std::list< PBB > &set, PBB bb)
bool isLatchNode ()
void setCaseHead (PBB head, PBB follow)
void setCondFollow (PBB other)
void setCondType (condType l)
void setLatchNode (PBB latch)
void setLoopFollow (PBB other)
void setLoopHead (PBB head)
void setLoopStamps (int &time, std::vector< PBB > &order)
void setLoopType (loopType l)
void setRevLoopStamps (int &time)
void setRevOrder (std::vector< PBB > &order)
void setStructType (structType s)
void setUnstructType (unstructType us)
void WriteBB (HLLCode *hll, int indLevel)

Protected Attributes

PBB caseHead
PBB condFollow
condType cType
bool hllLabel
PBB immPDom
int indentLevel
int inEdgesVisited
char * labelStr
PBB latchNode
LocationSet liveIn
PBB loopFollow
PBB loopHead
int loopStamps [2]
loopType lType
bool m_bIncomplete
bool m_bJumpReqd
int m_iLabelNum
std::vector< PBBm_InEdges
int m_iNumInEdges
int m_iNumOutEdges
bool m_iTraversed
bool m_labelneeded
std::string m_labelStr
BBTYPE m_nodeType
std::vector< PBBm_OutEdges
std::list< RTL * > * m_pRtls
int numForwardInEdges
int ord
int revLoopStamps [2]
int revOrd
structType sType
travType traversed
unstructType usType

Private Member Functions

 BasicBlock (std::list< RTL * > *pRtls, BBTYPE bbType, int iNumOutEdges)
void setRTLs (std::list< RTL * > *rtls)

Friends

class Cfg
class XMLProgParser

Classes

class  LastStatementNotABranchError
class  LastStatementNotAGotoError


Member Typedef Documentation

typedef std::list<Exp*>::iterator BasicBlock::elit
 

Definition at line 412 of file basicblock.h.

typedef std::list<RTL*>::iterator BasicBlock::rtlit
 

Get first/next statement this BB Somewhat intricate because of the post call semantics; these funcs save a lot of duplicated, easily-bugged code.

Definition at line 410 of file basicblock.h.

typedef std::list<RTL*>::reverse_iterator BasicBlock::rtlrit
 

Definition at line 411 of file basicblock.h.


Constructor & Destructor Documentation

BasicBlock::BasicBlock  ) 
 

Definition at line 64 of file basicblock.cpp.

BasicBlock::~BasicBlock  ) 
 

Definition at line 95 of file basicblock.cpp.

References m_pRtls, and NULL.

BasicBlock::BasicBlock const BasicBlock bb  ) 
 

Definition at line 120 of file basicblock.cpp.

References m_pRtls, and setRTLs().

BasicBlock::BasicBlock std::list< RTL * > *  pRtls,
BBTYPE  bbType,
int  iNumOutEdges
[private]
 

Definition at line 154 of file basicblock.cpp.

References m_OutEdges, and setRTLs().


Member Function Documentation

void BasicBlock::addInEdge PBB  newInEdge  ) 
 

Definition at line 521 of file basicblock.cpp.

References m_InEdges, and m_iNumInEdges.

Referenced by FrontEnd::appendSyntheticReturn(), BranchStatement::setFallBB(), BranchStatement::setTakenBB(), StatementTest::testEndlessLoop(), StatementTest::testFlow(), StatementTest::testKill(), StatementTest::testRecursion(), StatementTest::testUse(), StatementTest::testUseKill(), StatementTest::testUseOverBB(), and StatementTest::testUseOverKill().

void BasicBlock::addLiveIn Exp e  )  [inline, protected]
 

Definition at line 550 of file basicblock.h.

References LocationSet::insert(), and liveIn.

void BasicBlock::addOutEdge PBB  bb  )  [inline, protected]
 

Definition at line 544 of file basicblock.h.

References m_OutEdges.

void BasicBlock::addRTL RTL rtl  )  [inline, protected]
 

Definition at line 545 of file basicblock.h.

References m_pRtls, and NULL.

bool BasicBlock::allParentsGenerated  )  [protected]
 

Definition at line 986 of file basicblock.cpp.

References DFS_CODEGEN, hasBackEdgeTo(), m_InEdges, and traversed.

Referenced by generateCode().

bool BasicBlock::calcLiveness ConnectionGraph ig,
UserProc proc
 

Definition at line 1644 of file basicblock.cpp.

References LocationSet::addSubscript(), checkForOverlap(), DEBUG_LIVENESS, getLiveOut(), LOG, m_pRtls, LocationSet::makeDiff(), and LocationSet::prints().

Referenced by Cfg::findInterferences().

bool BasicBlock::decodeIndirectJmp UserProc proc  ) 
 

Definition at line 2005 of file basicblock.cpp.

References PhiAssign::begin(), StatementSet::begin(), PhiAssign::end(), StatementSet::exists(), getFirstStmt(), getNextStmt(), Statement::getNumber(), StatementSet::insert(), Statement::isPhi(), NULL, and StatementSet::remove().

void BasicBlock::deleteEdge PBB  edge  ) 
 

Definition at line 551 of file basicblock.cpp.

References deleteInEdge(), m_iNumOutEdges, and m_OutEdges.

void BasicBlock::deleteInEdge PBB  edge  ) 
 

Definition at line 541 of file basicblock.cpp.

References deleteInEdge(), and m_InEdges.

void BasicBlock::deleteInEdge std::vector< PBB >::iterator &  it  ) 
 

Definition at line 536 of file basicblock.cpp.

References m_InEdges, and m_iNumInEdges.

Referenced by deleteEdge(), and deleteInEdge().

unsigned BasicBlock::DFTOrder int &  first,
int &  last
 

Definition at line 571 of file basicblock.cpp.

References child(), m_DFTfirst, m_iTraversed, and m_OutEdges.

Referenced by Cfg::establishDFTOrder().

static void BasicBlock::doAvail StatementSet s,
PBB  inEdge
[static]
 

void BasicBlock::dump  ) 
 

Definition at line 297 of file basicblock.cpp.

References print().

void BasicBlock::emitGotoAndLabel HLLCode hll,
int  indLevel,
PBB  dest
[protected]
 

Definition at line 999 of file basicblock.cpp.

References HLLCode::AddBreak(), HLLCode::AddContinue(), HLLCode::AddGoto(), hllLabel, loopFollow, loopHead, and ord.

Referenced by generateCode().

int BasicBlock::findNumCases  ) 
 

Definition at line 1960 of file basicblock.cpp.

References Exp::getArity(), Exp::getOper(), Exp::isIntConst(), m_InEdges, opGtr, opGtrEq, opGtrEqUns, opGtrUns, opLess, opLessEq, opLessEqUns, opLessUns, and TWOWAY.

void BasicBlock::generateBodyCode HLLCode hll,
bool  dup = false
 

void BasicBlock::generateCode HLLCode hll,
int  indLevel,
PBB  latch,
std::list< PBB > &  followSet,
std::list< PBB > &  gotoSet,
UserProc proc
 

Definition at line 1037 of file basicblock.cpp.

References HLLCode::AddCaseCondEnd(), HLLCode::AddCaseCondHeader(), HLLCode::AddCaseCondOption(), HLLCode::AddEndlessLoopEnd(), HLLCode::AddEndlessLoopHeader(), HLLCode::AddIfCondEnd(), HLLCode::AddIfCondHeader(), HLLCode::AddIfElseCondHeader(), HLLCode::AddIfElseCondOption(), HLLCode::AddLineComment(), HLLCode::AddPosttestedLoopEnd(), HLLCode::AddPosttestedLoopHeader(), HLLCode::AddPretestedLoopHeader(), allParentsGenerated(), BELSE, BTHEN, Case, SWITCH_INFO::chForm, child(), Exp::clone(), COMPJUMP, Cond, condFollow, cType, DFS_CODEGEN, emitGotoAndLabel(), Endless, generateCode(), getCond(), RTL::getHlStmt(), Proc::getName(), CaseStatement::getSwitchInfo(), getType(), hllLabel, IfElse, IfThen, IfThenElse, SWITCH_INFO::iLower, indentLevel, isIn(), isLatchNode(), JumpInOutLoop, JumpIntoCase, latchNode, Loop, LoopCond, loopFollow, loopHead, lType, m_nodeType, m_OutEdges, m_pRtls, NULL, opNot, PostTested, PreTested, print(), SWITCH_INFO::pSwitchVar, RET, Seq, Exp::simplify(), Structured, sType, traversed, UNTRAVERSED, usType, SWITCH_INFO::uTable, and WriteBB().

Referenced by generateCode().

ADDRESS BasicBlock::getCallDest  ) 
 

Definition at line 662 of file basicblock.cpp.

References CALL, RTL::getList(), m_nodeType, m_pRtls, and STMT_CALL.

Proc * BasicBlock::getCallDestProc  ) 
 

Definition at line 677 of file basicblock.cpp.

References CALL, RTL::getList(), m_nodeType, m_pRtls, and STMT_CALL.

PBB BasicBlock::getCaseHead  )  [inline, protected]
 

Definition at line 466 of file basicblock.h.

References caseHead.

Exp * BasicBlock::getCond  )  throw (LastStatementNotABranchError)
 

Definition at line 800 of file basicblock.cpp.

References BranchStatement::getCondExpr(), RTL::getHlStmt(), Statement::getKind(), LOG, m_pRtls, STMT_BRANCH, and VERBOSE.

Referenced by generateCode().

PBB BasicBlock::getCondFollow  )  [inline, protected]
 

Definition at line 485 of file basicblock.h.

References condFollow.

Referenced by Cfg::findLoopFollow().

condType BasicBlock::getCondType  )  [protected]
 

Definition at line 1564 of file basicblock.cpp.

References Cond, cType, LoopCond, and sType.

PBB BasicBlock::getCorrectOutEdge ADDRESS  a  ) 
 

Definition at line 505 of file basicblock.cpp.

References m_OutEdges.

Exp * BasicBlock::getDest  )  throw (LastStatementNotAGotoError)
 

Definition at line 814 of file basicblock.cpp.

References GotoStatement::getDest(), RTL::getHlStmt(), CaseStatement::getSwitchInfo(), LOG, m_pRtls, SWITCH_INFO::pSwitchVar, and VERBOSE.

Referenced by SparcFrontEnd::case_DD().

Proc * BasicBlock::getDestProc  ) 
 

Definition at line 1420 of file basicblock.cpp.

References CallStatement::getDestProc(), Statement::getKind(), m_pRtls, NULL, and STMT_CALL.

Statement * BasicBlock::getFirstStmt  ) 
 

Definition at line 745 of file basicblock.cpp.

References m_pRtls, and NULL.

Referenced by decodeIndirectJmp(), and getStmtNumber().

Statement * BasicBlock::getFirstStmt rtlit rit,
StatementList::iterator sit
 

Definition at line 695 of file basicblock.cpp.

References m_pRtls, and NULL.

Referenced by FrontEnd::createReturnBlock(), DataFlow::findLiveAtDomPhi(), DataFlow::placePhiFunctions(), UserProc::rangeAnalysis(), DataFlow::renameBlockVars(), and Statement::updateRanges().

ADDRESS BasicBlock::getHiAddr  ) 
 

Definition at line 405 of file basicblock.cpp.

References m_pRtls, and NULL.

Referenced by Cfg::label(), print(), and UserProc::processDecodedICTs().

std::vector< PBB > & BasicBlock::getInEdges  ) 
 

Definition at line 439 of file basicblock.cpp.

References m_InEdges.

Referenced by dumpBB(), UserProc::isNoReturn(), JunctionStatement::rangeAnalysis(), and updateWorkListRev().

int BasicBlock::getLabel  ) 
 

Definition at line 188 of file basicblock.cpp.

References m_iLabelNum.

std::string& BasicBlock::getLabelStr  )  [inline]
 

Definition at line 162 of file basicblock.h.

References m_labelStr.

RTL* BasicBlock::getLastRtl  )  [inline]
 

Definition at line 419 of file basicblock.h.

Referenced by UserProc::processDecodedICTs().

Statement * BasicBlock::getLastStmt  ) 
 

Definition at line 759 of file basicblock.cpp.

References m_pRtls, and NULL.

Statement * BasicBlock::getLastStmt rtlrit rit,
StatementList::reverse_iterator sit
 

Definition at line 732 of file basicblock.cpp.

References m_pRtls, and NULL.

Referenced by UserProc::markAsNonChildless(), UserProc::processDecodedICTs(), and UserProc::updateForUseChange().

PBB BasicBlock::getLatchNode  )  [inline, protected]
 

Definition at line 465 of file basicblock.h.

References latchNode.

Referenced by Cfg::determineLoopType(), Cfg::findLoopFollow(), and Cfg::tagNodesInLoop().

void BasicBlock::getLiveOut LocationSet live,
LocationSet phiLocs
 

Definition at line 1706 of file basicblock.cpp.

References LocationSet::clear(), Exp::clone(), DEBUG_LIVENESS, Assignment::getLeft(), RTL::getList(), getLowAddr(), PhiAssign::getStmtAt(), LocationSet::insert(), LOG, m_OutEdges, LocationSet::makeUnion(), and NULL.

Referenced by calcLiveness().

BasicBlock * BasicBlock::getLoopBody  ) 
 

Definition at line 880 of file basicblock.cpp.

References ENDLESSLOOP, m_iNumOutEdges, m_loopFollow, m_OutEdges, m_structType, POSTTESTLOOP, and PRETESTLOOP.

PBB BasicBlock::getLoopFollow  )  [inline, protected]
 

Definition at line 482 of file basicblock.h.

References loopFollow.

PBB BasicBlock::getLoopHead  )  [inline, protected]
 

Definition at line 462 of file basicblock.h.

References loopHead.

Referenced by Cfg::findLoopFollow().

loopType BasicBlock::getLoopType  )  [protected]
 

Definition at line 1554 of file basicblock.cpp.

References Loop, LoopCond, lType, and sType.

Referenced by Cfg::findLoopFollow().

ADDRESS BasicBlock::getLowAddr  ) 
 

Definition at line 382 of file basicblock.cpp.

References m_pRtls, and NULL.

Referenced by Cfg::commonPDom(), UserProc::decompile(), getLiveOut(), BranchStatement::getRangesForOutEdgeTo(), Cfg::label(), lessAddress(), print(), BlockSyntaxNode::printAST(), UserProc::setEntryBB(), CfgTest::testDominators(), CfgTest::testSemiDominators(), Statement::updateRanges(), Cfg::wellFormCfg(), and WriteBB().

Statement * BasicBlock::getNextStmt rtlit rit,
StatementList::iterator sit
 

Definition at line 708 of file basicblock.cpp.

References m_pRtls, and NULL.

Referenced by decodeIndirectJmp(), DataFlow::findLiveAtDomPhi(), DataFlow::placePhiFunctions(), and DataFlow::renameBlockVars().

int BasicBlock::getNumInEdges  )  [inline]
 

Definition at line 224 of file basicblock.h.

References m_iNumInEdges.

Referenced by Statement::getInputRanges(), UserProc::initStatements(), UserProc::isNoReturn(), and JunctionStatement::rangeAnalysis().

int BasicBlock::getNumOutEdges  )  [inline]
 

Definition at line 246 of file basicblock.h.

References m_iNumOutEdges.

Referenced by BlockSyntaxNode::getNumOutEdges(), and Statement::updateRanges().

PBB BasicBlock::getOutEdge unsigned int  i  ) 
 

Definition at line 491 of file basicblock.cpp.

References m_OutEdges.

Referenced by PostTestedLoopSyntaxNode::getOutEdge(), PretestedLoopSyntaxNode::getOutEdge(), IfThenSyntaxNode::getOutEdge(), BlockSyntaxNode::getOutEdge(), isCaseOption(), IfThenSyntaxNode::printAST(), and Statement::updateRanges().

std::vector< PBB > & BasicBlock::getOutEdges  ) 
 

Definition at line 449 of file basicblock.cpp.

References m_OutEdges.

Referenced by DataFlow::computeDF(), DataFlow::DFS(), Cfg::findImmedPDom(), Cfg::findLoopFollow(), isCaseOption(), and Cfg::joinBB().

Statement * BasicBlock::getPrevStmt rtlrit rit,
StatementList::reverse_iterator sit
 

Definition at line 720 of file basicblock.cpp.

References m_pRtls, and NULL.

std::list< RTL * > * BasicBlock::getRTLs  ) 
 

Definition at line 416 of file basicblock.cpp.

References m_pRtls.

Referenced by UserProc::assignProcsToCalls(), UserProc::decompile(), UserProc::finalSimplify(), getStatements(), UserProc::insertAssignAfter(), UserProc::insertStatementAfter(), PentiumFrontEnd::processFloatCode(), PentiumFrontEnd::processStringInst(), and UserProc::setImplicitRef().

RTL * BasicBlock::getRTLWithStatement Statement stmt  ) 
 

Definition at line 420 of file basicblock.cpp.

References m_pRtls, and NULL.

void BasicBlock::getStatements StatementList stmts  ) 
 

Definition at line 774 of file basicblock.cpp.

References StatementList::append(), getRTLs(), and NULL.

char * BasicBlock::getStmtNumber  ) 
 

Get the statement number for the first BB as a character array.

If not possible (e.g. because the BB has no statements), return a unique string (e.g. bb8048c10)

Definition at line 1586 of file basicblock.cpp.

References getFirstStmt(), and Statement::getNumber().

structType BasicBlock::getStructType  )  [inline, protected]
 

Definition at line 469 of file basicblock.h.

References sType.

Referenced by Cfg::findLoopFollow().

BBTYPE BasicBlock::getType  ) 
 

Definition at line 240 of file basicblock.cpp.

References m_nodeType.

Referenced by UserProc::decompile(), Cfg::determineLoopType(), generateCode(), SyntaxNode::isBranch(), SyntaxNode::isGoto(), BlockSyntaxNode::printAST(), setCaseHead(), and setStructType().

unstructType BasicBlock::getUnstructType  )  [protected]
 

Definition at line 1539 of file basicblock.cpp.

References Case, Cond, cType, LoopCond, sType, and usType.

bool BasicBlock::hasBackEdge  )  [inline, protected]
 

Definition at line 491 of file basicblock.h.

References hasBackEdgeTo(), and m_OutEdges.

bool BasicBlock::hasBackEdgeTo BasicBlock dest  )  [protected]
 

Definition at line 979 of file basicblock.cpp.

References isAncestorOf().

Referenced by allParentsGenerated(), hasBackEdge(), and setCaseHead().

char* BasicBlock::indent int  indLevel,
int  extra = 0
[protected]
 

bool BasicBlock::inLoop PBB  header,
PBB  latch
[protected]
 

Definition at line 1569 of file basicblock.cpp.

References latchNode, loopStamps, and revLoopStamps.

bool BasicBlock::isAncestorOf BasicBlock other  )  [protected]
 

Definition at line 888 of file basicblock.cpp.

References loopStamps, and revLoopStamps.

Referenced by hasBackEdgeTo().

bool BasicBlock::isBackEdge int  inEdge  ) 
 

Definition at line 361 of file basicblock.cpp.

References m_DFTfirst, m_DFTlast, and m_InEdges.

bool BasicBlock::isCaseOption  ) 
 

Definition at line 192 of file basicblock.cpp.

References caseHead, getOutEdge(), and getOutEdges().

bool BasicBlock::isIn std::list< PBB > &  set,
PBB  bb
[inline, protected]
 

Definition at line 507 of file basicblock.h.

Referenced by generateCode().

bool BasicBlock::isJmpZ PBB  dest  ) 
 

Definition at line 854 of file basicblock.cpp.

References BRANCH_JE, BRANCH_JNE, RTL::getList(), m_OutEdges, m_pRtls, and STMT_BRANCH.

bool BasicBlock::isJumpReqd  ) 
 

Definition at line 275 of file basicblock.cpp.

References m_bJumpReqd.

bool BasicBlock::isLabelNeeded  )  [inline]
 

Definition at line 164 of file basicblock.h.

References m_labelneeded.

bool BasicBlock::isLatchNode  )  [inline, protected]
 

Definition at line 464 of file basicblock.h.

References latchNode, and loopHead.

Referenced by generateCode().

bool BasicBlock::isPostCall  ) 
 

bool BasicBlock::isTraversed  ) 
 

Definition at line 206 of file basicblock.cpp.

References m_iTraversed.

bool BasicBlock::lessAddress PBB  bb1,
PBB  bb2
[static]
 

Definition at line 626 of file basicblock.cpp.

References getLowAddr().

Referenced by Cfg::sortByAddress().

bool BasicBlock::lessFirstDFT PBB  bb1,
PBB  bb2
[static]
 

Definition at line 638 of file basicblock.cpp.

References m_DFTfirst.

Referenced by Cfg::sortByFirstDFT().

bool BasicBlock::lessLastDFT PBB  bb1,
PBB  bb2
[static]
 

Definition at line 651 of file basicblock.cpp.

References m_DFTlast.

Referenced by Cfg::sortByLastDFT().

void BasicBlock::prependStmt Statement s,
UserProc proc
 

Definition at line 1599 of file basicblock.cpp.

References m_pRtls, Statement::setBB(), and Statement::setProc().

Referenced by Cfg::findImplicitAssign().

void BasicBlock::print std::ostream &  os,
bool  html = false
 

Definition at line 308 of file basicblock.cpp.

References CALL, COMPCALL, COMPJUMP, FALL, getHiAddr(), getLowAddr(), INVALID, m_iLabelNum, m_InEdges, m_nodeType, m_OutEdges, m_pRtls, NWAY, ONEWAY, RET, and TWOWAY.

Referenced by dump(), generateCode(), printBB(), prints(), printToLog(), and FrontSparcTest::testDelaySlot().

char * BasicBlock::prints  ) 
 

Definition at line 287 of file basicblock.cpp.

References debug_buffer, DEBUG_BUFSIZE, and print().

Referenced by Cfg::splitForBranch().

void BasicBlock::printToLog  ) 
 

Definition at line 355 of file basicblock.cpp.

References LOG, and print().

void BasicBlock::processSwitch UserProc proc  ) 
 

Definition at line 2302 of file basicblock.cpp.

References SWITCH_INFO::chForm, Boomerang::get(), UserProc::getCFG(), RTL::getHlStmt(), Proc::getProg(), CaseStatement::getSwitchInfo(), SWITCH_INFO::iLower, SWITCH_INFO::iNumTable, SWITCH_INFO::iUpper, LOG, m_pRtls, NWAY, Prog::readNative4(), updateType(), and SWITCH_INFO::uTable.

Referenced by SparcFrontEnd::case_DD().

void BasicBlock::resetDFASets  ) 
 

unsigned BasicBlock::RevDFTOrder int &  first,
int &  last
 

Definition at line 598 of file basicblock.cpp.

References m_DFTrevfirst, m_InEdges, and m_iTraversed.

Referenced by Cfg::establishRevDFTOrder().

void BasicBlock::setCaseHead PBB  head,
PBB  follow
[protected]
 

Definition at line 1490 of file basicblock.cpp.

References caseHead, condFollow, DFS_CASE, getType(), hasBackEdgeTo(), m_OutEdges, NWAY, setCaseHead(), and traversed.

Referenced by setCaseHead().

void BasicBlock::setCond Exp e  )  throw (LastStatementNotABranchError)
 

Definition at line 836 of file basicblock.cpp.

References RTL::getList(), and STMT_BRANCH.

void BasicBlock::setCondFollow PBB  other  )  [inline, protected]
 

Definition at line 484 of file basicblock.h.

References condFollow.

void BasicBlock::setCondType condType  l  )  [protected]
 

Definition at line 1559 of file basicblock.cpp.

References Cond, cType, LoopCond, and sType.

void BasicBlock::setInEdge int  i,
PBB  newIn
 

Definition at line 461 of file basicblock.cpp.

References m_InEdges.

void BasicBlock::setJumpReqd  ) 
 

Definition at line 265 of file basicblock.cpp.

References m_bJumpReqd.

Referenced by SparcFrontEnd::case_SCDAN(), and case_SCDAN_NCT().

void BasicBlock::setLabelNeeded bool  b  )  [inline]
 

Definition at line 165 of file basicblock.h.

References m_labelneeded.

void BasicBlock::setLabelStr std::string &  s  )  [inline]
 

Definition at line 163 of file basicblock.h.

References m_labelStr.

void BasicBlock::setLatchNode PBB  latch  )  [inline, protected]
 

Definition at line 463 of file basicblock.h.

References latchNode.

void BasicBlock::setLoopFollow PBB  other  )  [inline, protected]
 

Definition at line 481 of file basicblock.h.

References loopFollow.

Referenced by Cfg::findLoopFollow().

void BasicBlock::setLoopHead PBB  head  )  [inline, protected]
 

Definition at line 461 of file basicblock.h.

References loopHead.

void BasicBlock::setLoopStamps int &  time,
std::vector< PBB > &  order
[protected]
 

Definition at line 1432 of file basicblock.cpp.

References DFS_LNUM, loopStamps, m_OutEdges, and traversed.

Referenced by Cfg::setTimeStamps().

void BasicBlock::setLoopType loopType  l  )  [protected]
 

Definition at line 1544 of file basicblock.cpp.

References latchNode, Loop, LoopCond, lType, PostTested, PreTested, and sType.

Referenced by Cfg::determineLoopType().

void BasicBlock::setOutEdge int  i,
PBB  newInEdge
 

Definition at line 474 of file basicblock.cpp.

References m_OutEdges.

Referenced by FrontEnd::appendSyntheticReturn(), StatementTest::testEndlessLoop(), StatementTest::testFlow(), StatementTest::testKill(), StatementTest::testRecursion(), StatementTest::testUse(), StatementTest::testUseKill(), StatementTest::testUseOverBB(), and StatementTest::testUseOverKill().

void BasicBlock::setRevLoopStamps int &  time  )  [protected]
 

Definition at line 1457 of file basicblock.cpp.

References DFS_RNUM, m_OutEdges, revLoopStamps, and traversed.

Referenced by Cfg::setTimeStamps().

void BasicBlock::setRevOrder std::vector< PBB > &  order  )  [protected]
 

Definition at line 1474 of file basicblock.cpp.

References DFS_PDOM, m_InEdges, revOrd, and traversed.

Referenced by Cfg::setTimeStamps().

void BasicBlock::setRTLs std::list< RTL * > *  rtls  )  [private]
 

Definition at line 227 of file basicblock.cpp.

References m_pRtls.

Referenced by BasicBlock(), and Cfg::newBB().

void BasicBlock::setStructType structType  s  )  [protected]
 

Definition at line 1517 of file basicblock.cpp.

References BELSE, BTHEN, Case, Cond, condFollow, cType, getType(), IfElse, IfThen, IfThenElse, m_OutEdges, NWAY, and sType.

Referenced by Cfg::determineLoopType().

void BasicBlock::setTraversed bool  bTraversed  ) 
 

Definition at line 216 of file basicblock.cpp.

References m_iTraversed.

void BasicBlock::setUnstructType unstructType  us  )  [protected]
 

Definition at line 1534 of file basicblock.cpp.

References Case, Cond, cType, LoopCond, sType, and usType.

void BasicBlock::simplify  ) 
 

Definition at line 898 of file basicblock.cpp.

References FALL, RTL::getNumStmt(), m_nodeType, m_pRtls, NULL, ONEWAY, and TWOWAY.

Referenced by UserProc::finalSimplify().

bool BasicBlock::undoComputedBB Statement stmt  ) 
 

Definition at line 2388 of file basicblock.cpp.

References CALL, RTL::getList(), LOG, m_nodeType, and m_pRtls.

void BasicBlock::updateType BBTYPE  bbType,
int  iNumOutEdges
 

Definition at line 252 of file basicblock.cpp.

References m_iNumOutEdges, and m_nodeType.

Referenced by processSwitch().

int BasicBlock::whichPred PBB  pred  ) 
 

Definition at line 1738 of file basicblock.cpp.

References m_InEdges.

void BasicBlock::WriteBB HLLCode hll,
int  indLevel
[protected]
 

Definition at line 1014 of file basicblock.cpp.

References HLLCode::AddLabel(), DEBUG_GEN, getLowAddr(), LOG, m_pRtls, and ord.

Referenced by generateCode().


Friends And Related Function Documentation

friend class Cfg [friend]
 

Definition at line 133 of file basicblock.h.

friend class XMLProgParser [friend]
 

Definition at line 543 of file basicblock.h.


Member Data Documentation

PBB BasicBlock::caseHead [protected]
 

Definition at line 446 of file basicblock.h.

Referenced by getCaseHead(), isCaseOption(), XMLProgParser::persistToXML(), and setCaseHead().

PBB BasicBlock::condFollow [protected]
 

Definition at line 447 of file basicblock.h.

Referenced by generateCode(), getCondFollow(), XMLProgParser::persistToXML(), setCaseHead(), setCondFollow(), and setStructType().

condType BasicBlock::cType [protected]
 

Definition at line 455 of file basicblock.h.

Referenced by generateCode(), getCondType(), getUnstructType(), XMLProgParser::persistToXML(), setCondType(), setStructType(), and setUnstructType().

bool BasicBlock::hllLabel [protected]
 

Definition at line 439 of file basicblock.h.

Referenced by emitGotoAndLabel(), generateCode(), and XMLProgParser::persistToXML().

PBB BasicBlock::immPDom [protected]
 

Definition at line 444 of file basicblock.h.

Referenced by Cfg::commonPDom(), Cfg::findImmedPDom(), and XMLProgParser::persistToXML().

int BasicBlock::indentLevel [protected]
 

Definition at line 441 of file basicblock.h.

Referenced by generateCode(), and XMLProgParser::persistToXML().

int BasicBlock::inEdgesVisited [protected]
 

Definition at line 435 of file basicblock.h.

Referenced by XMLProgParser::persistToXML().

char* BasicBlock::labelStr [protected]
 

Definition at line 440 of file basicblock.h.

Referenced by XMLProgParser::persistToXML().

PBB BasicBlock::latchNode [protected]
 

Definition at line 449 of file basicblock.h.

Referenced by generateCode(), getLatchNode(), inLoop(), isLatchNode(), XMLProgParser::persistToXML(), setLatchNode(), and setLoopType().

LocationSet BasicBlock::liveIn [protected]
 

Definition at line 397 of file basicblock.h.

Referenced by addLiveIn(), and XMLProgParser::persistToXML().

PBB BasicBlock::loopFollow [protected]
 

Definition at line 448 of file basicblock.h.

Referenced by emitGotoAndLabel(), generateCode(), getLoopFollow(), XMLProgParser::persistToXML(), and setLoopFollow().

PBB BasicBlock::loopHead [protected]
 

Definition at line 445 of file basicblock.h.

Referenced by emitGotoAndLabel(), generateCode(), getLoopHead(), isLatchNode(), XMLProgParser::persistToXML(), and setLoopHead().

int BasicBlock::loopStamps[2] [protected]
 

Definition at line 437 of file basicblock.h.

Referenced by inLoop(), isAncestorOf(), XMLProgParser::persistToXML(), and setLoopStamps().

loopType BasicBlock::lType [protected]
 

Definition at line 454 of file basicblock.h.

Referenced by generateCode(), getLoopType(), XMLProgParser::persistToXML(), and setLoopType().

bool BasicBlock::m_bIncomplete [protected]
 

Definition at line 384 of file basicblock.h.

Referenced by Cfg::isIncomplete(), Cfg::isOrphan(), Cfg::label(), Cfg::newBB(), and XMLProgParser::persistToXML().

bool BasicBlock::m_bJumpReqd [protected]
 

Definition at line 385 of file basicblock.h.

Referenced by Cfg::addNewOutEdge(), Cfg::compressCfg(), isJumpReqd(), XMLProgParser::persistToXML(), and setJumpReqd().

PBB BasicBlock::m_caseHead
 

Definition at line 372 of file basicblock.h.

Referenced by XMLProgParser::persistToXML().

PBB BasicBlock::m_condFollow
 

Definition at line 373 of file basicblock.h.

Referenced by XMLProgParser::persistToXML().

int BasicBlock::m_DFTfirst
 

Definition at line 345 of file basicblock.h.

Referenced by DFTOrder(), isBackEdge(), lessFirstDFT(), and XMLProgParser::persistToXML().

int BasicBlock::m_DFTlast
 

Definition at line 346 of file basicblock.h.

Referenced by isBackEdge(), lessLastDFT(), and XMLProgParser::persistToXML().

int BasicBlock::m_DFTrevfirst
 

Definition at line 347 of file basicblock.h.

Referenced by XMLProgParser::persistToXML(), and RevDFTOrder().

int BasicBlock::m_DFTrevlast
 

Definition at line 348 of file basicblock.h.

Referenced by XMLProgParser::persistToXML().

int BasicBlock::m_iLabelNum [protected]
 

Definition at line 381 of file basicblock.h.

Referenced by getLabel(), XMLProgParser::persistToXML(), print(), and Cfg::setLabel().

std::vector<PBB> BasicBlock::m_InEdges [protected]
 

Definition at line 388 of file basicblock.h.

Referenced by addInEdge(), Cfg::addOutEdge(), allParentsGenerated(), Cfg::completeMerge(), deleteInEdge(), findNumCases(), getInEdges(), isBackEdge(), Cfg::mergeBBs(), XMLProgParser::persistToXML(), print(), RevDFTOrder(), setInEdge(), setRevOrder(), Cfg::wellFormCfg(), and whichPred().

int BasicBlock::m_iNumInEdges [protected]
 

Definition at line 390 of file basicblock.h.

Referenced by addInEdge(), Cfg::addOutEdge(), Cfg::completeMerge(), deleteInEdge(), getNumInEdges(), and Cfg::mergeBBs().

int BasicBlock::m_iNumOutEdges [protected]
 

Definition at line 391 of file basicblock.h.

Referenced by Cfg::addNewOutEdge(), deleteEdge(), getLoopBody(), getNumOutEdges(), Cfg::mergeBBs(), Cfg::newBB(), and updateType().

bool BasicBlock::m_iTraversed [protected]
 

Definition at line 394 of file basicblock.h.

Referenced by DFTOrder(), isTraversed(), XMLProgParser::persistToXML(), RevDFTOrder(), and setTraversed().

bool BasicBlock::m_labelneeded [protected]
 

Definition at line 383 of file basicblock.h.

Referenced by isLabelNeeded(), XMLProgParser::persistToXML(), and setLabelNeeded().

std::string BasicBlock::m_labelStr [protected]
 

Definition at line 382 of file basicblock.h.

Referenced by getLabelStr(), XMLProgParser::persistToXML(), and setLabelStr().

PBB BasicBlock::m_latchNode
 

Definition at line 375 of file basicblock.h.

Referenced by XMLProgParser::persistToXML().

SBBTYPE BasicBlock::m_loopCondType
 

Definition at line 370 of file basicblock.h.

Referenced by XMLProgParser::persistToXML().

PBB BasicBlock::m_loopFollow
 

Definition at line 374 of file basicblock.h.

Referenced by getLoopBody(), and XMLProgParser::persistToXML().

PBB BasicBlock::m_loopHead
 

Definition at line 371 of file basicblock.h.

Referenced by XMLProgParser::persistToXML().

BBTYPE BasicBlock::m_nodeType [protected]
 

Definition at line 379 of file basicblock.h.

Referenced by generateCode(), getCallDest(), getCallDestProc(), getType(), Cfg::newBB(), XMLProgParser::persistToXML(), print(), simplify(), undoComputedBB(), and updateType().

std::vector<PBB> BasicBlock::m_OutEdges [protected]
 

Definition at line 389 of file basicblock.h.

Referenced by Cfg::addNewOutEdge(), Cfg::addOutEdge(), addOutEdge(), BasicBlock(), deleteEdge(), DFTOrder(), generateCode(), getCorrectOutEdge(), getLiveOut(), getLoopBody(), getOutEdge(), getOutEdges(), hasBackEdge(), isJmpZ(), Cfg::mergeBBs(), XMLProgParser::persistToXML(), print(), setCaseHead(), setLoopStamps(), setOutEdge(), setRevLoopStamps(), setStructType(), and Cfg::wellFormCfg().

std::list<RTL*>* BasicBlock::m_pRtls [protected]
 

Definition at line 380 of file basicblock.h.

Referenced by addRTL(), BasicBlock(), calcLiveness(), Cfg::findInterferences(), generateCode(), getCallDest(), getCallDestProc(), getCond(), getDest(), getDestProc(), getFirstStmt(), getHiAddr(), getLastStmt(), getLowAddr(), getNextStmt(), getPrevStmt(), getRTLs(), getRTLWithStatement(), isJmpZ(), Cfg::isOrphan(), Cfg::joinBB(), prependStmt(), print(), processSwitch(), setRTLs(), simplify(), Cfg::splitBB(), Cfg::splitForBranch(), undoComputedBB(), WriteBB(), and ~BasicBlock().

SBBTYPE BasicBlock::m_structType
 

Definition at line 369 of file basicblock.h.

Referenced by getLoopBody(), and XMLProgParser::persistToXML().

int BasicBlock::numForwardInEdges [protected]
 

Definition at line 436 of file basicblock.h.

Referenced by XMLProgParser::persistToXML().

int BasicBlock::ord [protected]
 

Definition at line 433 of file basicblock.h.

Referenced by emitGotoAndLabel(), Cfg::findLoopFollow(), XMLProgParser::persistToXML(), Cfg::structLoops(), Cfg::tagNodesInLoop(), and WriteBB().

bool BasicBlock::overlappedRegProcessingDone
 

Definition at line 540 of file basicblock.h.

int BasicBlock::revLoopStamps[2] [protected]
 

Definition at line 437 of file basicblock.h.

Referenced by inLoop(), isAncestorOf(), XMLProgParser::persistToXML(), and setRevLoopStamps().

int BasicBlock::revOrd [protected]
 

Definition at line 434 of file basicblock.h.

Referenced by Cfg::commonPDom(), Cfg::findImmedPDom(), XMLProgParser::persistToXML(), and setRevOrder().

structType BasicBlock::sType [protected]
 

Definition at line 452 of file basicblock.h.

Referenced by generateCode(), getCondType(), getLoopType(), getStructType(), getUnstructType(), XMLProgParser::persistToXML(), setCondType(), setLoopType(), setStructType(), and setUnstructType().

travType BasicBlock::traversed [protected]
 

Definition at line 438 of file basicblock.h.

Referenced by allParentsGenerated(), generateCode(), XMLProgParser::persistToXML(), setCaseHead(), setLoopStamps(), setRevLoopStamps(), and setRevOrder().

unstructType BasicBlock::usType [protected]
 

Definition at line 453 of file basicblock.h.

Referenced by generateCode(), getUnstructType(), XMLProgParser::persistToXML(), and setUnstructType().


The documentation for this class was generated from the following files:
Generated on Tue Sep 19 21:18:40 2006 for Boomerang by  doxygen 1.4.6