RTL Class Reference

#include <include/rtl.h>

List of all members.


Detailed Description

Definition at line 61 of file rtl.h.

Public Types

typedef std::list< Statement
* >::iterator 
iterator
typedef std::list< Statement
* >::reverse_iterator 
reverse_iterator

Public Member Functions

virtual bool accept (StmtVisitor *visitor)
void allSimplify ()
void appendListStmt (std::list< Statement * > &le)
void appendRTL (RTL &rtl)
void appendStmt (Statement *s)
bool areFlagsAffected ()
void clear ()
virtual RTL * clone ()
void deepCopyList (std::list< Statement * > &dest)
void deleteLastStmt ()
void deleteStmt (unsigned int)
void dump ()
Statement * elementAt (unsigned i)
void forwardSubs ()
virtual void generateCode (HLLCode *hll, BasicBlock *pbb, int indLevel)
ADDRESS getAddress ()
Statement * getHlStmt ()
std::list< Statement * > & getList ()
int getNumStmt ()
Type * getType ()
void insertAfterTemps (Exp *ssLhs, Exp *ssRhs, Type *type=NULL)
void insertAssign (Exp *ssLhs, Exp *ssRhs, bool prep, Type *type=NULL)
void insertStmt (Statement *s, iterator it)
void insertStmt (Statement *s, unsigned i)
bool isBranch ()
bool isCall ()
bool isCompare (int &iReg, Exp *&pTerm)
bool isGoto ()
bool isHiImmedLoad (ADDRESS &uHiHalf)
bool isLoImmedLoad (ADDRESS &uLoHalf, bool &bTrans, int &iSrc)
RTL & operator= (RTL &other)
void prependStmt (Statement *s)
virtual void print (std::ostream &os=std::cout, bool html=false)
char * prints ()
void replaceLastStmt (Statement *repl)
 RTL (const RTL &other)
 RTL (ADDRESS instNativeAddr, std::list< Statement * > *listStmt=NULL)
 RTL ()
virtual bool searchAll (Exp *search, std::list< Exp * > &result)
virtual bool searchAndReplace (Exp *search, Exp *replace)
void setAddress (ADDRESS a)
int setConscripts (int n, bool bClear)
virtual void simplify ()
void updateAddress (ADDRESS addr)
void updateStmt (Statement *s, unsigned i)
virtual ~RTL ()

Private Attributes

ADDRESS nativeAddr
std::list< Statement * > stmtList

Friends

class XMLProgParser


Member Typedef Documentation

typedef std::list<Statement*>::iterator RTL::iterator
 

Definition at line 70 of file rtl.h.

typedef std::list<Statement*>::reverse_iterator RTL::reverse_iterator
 

Definition at line 71 of file rtl.h.


Constructor & Destructor Documentation

RTL::RTL (   ) 
 

Definition at line 65 of file rtl.cpp.

RTL::RTL (  ADDRESS  instNativeAddr,
std::list< Statement * > *  listStmt = NULL
) 
 

Definition at line 76 of file rtl.cpp.

References stmtList.

RTL::RTL (  const RTL &  other  ) 
 

Definition at line 89 of file rtl.cpp.

References stmtList.

RTL::~RTL (   )  [virtual]
 

Definition at line 102 of file rtl.cpp.


Member Function Documentation

bool RTL::accept (  StmtVisitor *  visitor  )  [virtual]
 

Definition at line 142 of file rtl.cpp.

References stmtList, and StmtVisitor::visit().

Referenced by setConscripts(), and RtlTest::testVisitor().

void RTL::allSimplify (   ) 
 

void RTL::appendListStmt (  std::list< Statement * > &  le  ) 
 

Definition at line 204 of file rtl.cpp.

References stmtList.

Referenced by appendRTL().

void RTL::appendRTL (  RTL &  rtl  ) 
 

Definition at line 218 of file rtl.cpp.

References appendListStmt(), and stmtList.

Referenced by TableEntry::appendRTL().

void RTL::appendStmt (  Statement *  s  ) 
 

Definition at line 175 of file rtl.cpp.

References stmtList.

Referenced by NJMCDecoder::computedCall(), NJMCDecoder::computedJump(), SparcDecoder::createBranchRtl(), FrontEnd::createReturnBlock(), PentiumFrontEnd::decodeInstruction(), ST20Decoder::decodeInstruction(), SparcDecoder::decodeInstruction(), PPCDecoder::decodeInstruction(), PentiumDecoder::decodeInstruction(), SparcFrontEnd::emitCopyPC(), PentiumFrontEnd::emitSet(), PentiumFrontEnd::helperFunc(), insertAssign(), RtlTest::testAppend(), and NJMCDecoder::unconditionalJump().

bool RTL::areFlagsAffected (   ) 
 

Definition at line 546 of file rtl.cpp.

References Statement::isFlagAssgn(), and stmtList.

Referenced by SparcFrontEnd::case_SCD().

void RTL::clear (   ) 
 

Definition at line 442 of file rtl.cpp.

References stmtList.

Referenced by FrontEnd::createReturnBlock().

RTL * RTL::clone (   )  [virtual]
 

Definition at line 129 of file rtl.cpp.

References stmtList.

Referenced by RtlTest::testClone().

void RTL::deepCopyList (  std::list< Statement * > &  dest  ) 
 

Definition at line 158 of file rtl.cpp.

References stmtList.

Referenced by RTLInstDict::instantiateRTL().

void RTL::deleteLastStmt (   ) 
 

Definition at line 284 of file rtl.cpp.

References stmtList.

Referenced by FrontEnd::createReturnBlock().

void RTL::deleteStmt (  unsigned  int  ) 
 

Definition at line 272 of file rtl.cpp.

References stmtList.

void RTL::dump (   ) 
 

Definition at line 363 of file rtl.cpp.

References print().

Statement * RTL::elementAt (  unsigned  i  ) 
 

Definition at line 314 of file rtl.cpp.

References NULL, and stmtList.

Referenced by isCompare(), PentiumFrontEnd::isDecAh(), and SparcFrontEnd::optimise_CallReturn().

void RTL::forwardSubs (   ) 
 

void RTL::generateCode (  HLLCode *  hll,
BasicBlock *  pbb,
int  indLevel
)  [virtual]
 

Definition at line 558 of file rtl.cpp.

References stmtList.

ADDRESS RTL::getAddress (   )  [inline]
 

Definition at line 83 of file rtl.h.

References nativeAddr.

Referenced by FrontEnd::appendSyntheticReturn(), FrontEnd::createReturnBlock(), SparcFrontEnd::optimise_CallReturn(), and simplify().

Statement * RTL::getHlStmt (   ) 
 

Definition at line 660 of file rtl.cpp.

References STMT_ASSIGN, and stmtList.

Referenced by BasicBlock::generateCode(), BasicBlock::getCond(), BasicBlock::getDest(), and BasicBlock::processSwitch().

std::list<Statement*>& RTL::getList (   )  [inline]
 

Definition at line 108 of file rtl.h.

References stmtList.

Referenced by SparcFrontEnd::case_CALL(), SparcFrontEnd::case_DD(), SparcFrontEnd::case_SCD(), SparcFrontEnd::case_SCDAN(), SparcFrontEnd::case_SD(), FrontEnd::createReturnBlock(), SparcDecoder::decodeInstruction(), BasicBlock::getCallDest(), BasicBlock::getCallDestProc(), BasicBlock::getLiveOut(), BasicBlock::isJmpZ(), SparcFrontEnd::processProc(), BasicBlock::setCond(), toBranches(), and BasicBlock::undoComputedBB().

int RTL::getNumStmt (   ) 
 

Definition at line 302 of file rtl.cpp.

References stmtList.

Referenced by FlagDef::appendDotFile(), isCompare(), PentiumFrontEnd::isDecAh(), SparcFrontEnd::optimise_CallReturn(), and BasicBlock::simplify().

Type * RTL::getType (   ) 
 

Definition at line 529 of file rtl.cpp.

References stmtList.

void RTL::insertAfterTemps (  Exp *  ssLhs,
Exp *  ssRhs,
Type *  type = NULL
) 
 

Definition at line 490 of file rtl.cpp.

References Exp::isTemp(), and stmtList.

void RTL::insertAssign (  Exp *  ssLhs,
Exp *  ssRhs,
bool  prep,
Type *  type = NULL
) 
 

Definition at line 462 of file rtl.cpp.

References appendStmt(), and prependStmt().

void RTL::insertStmt (  Statement *  s,
iterator  it
) 
 

Definition at line 242 of file rtl.cpp.

References stmtList.

void RTL::insertStmt (  Statement *  s,
unsigned  i
) 
 

Definition at line 230 of file rtl.cpp.

References stmtList.

bool RTL::isBranch (   ) 
 

Definition at line 647 of file rtl.cpp.

References Statement::getKind(), STMT_BRANCH, and stmtList.

bool RTL::isCall (   ) 
 

Definition at line 653 of file rtl.cpp.

References Statement::getKind(), STMT_CALL, and stmtList.

Referenced by SparcFrontEnd::case_SCD().

bool RTL::isCompare (  int &  iReg,
Exp *&  pTerm
) 
 

Definition at line 610 of file rtl.cpp.

References elementAt(), Statement::getKind(), getNumStmt(), Exp::getOper(), Exp::getSubExp2(), Statement::isFlagAssgn(), Exp::isRegOf(), opMinus, and STMT_ASSIGN.

Referenced by RtlTest::testIsCompare().

bool RTL::isGoto (   ) 
 

Definition at line 641 of file rtl.cpp.

References Statement::getKind(), STMT_GOTO, and stmtList.

bool RTL::isHiImmedLoad (  ADDRESS &  uHiHalf  ) 
 

bool RTL::isLoImmedLoad (  ADDRESS &  uLoHalf,
bool &  bTrans,
int &  iSrc
) 
 

RTL & RTL::operator= (  RTL &  other  ) 
 

Definition at line 110 of file rtl.cpp.

References nativeAddr, and stmtList.

void RTL::prependStmt (  Statement *  s  ) 
 

Definition at line 193 of file rtl.cpp.

References stmtList.

Referenced by insertAssign().

void RTL::print (  std::ostream &  os = std::cout,
bool  html = false
)  [virtual]
 

Definition at line 329 of file rtl.cpp.

References nativeAddr, and stmtList.

Referenced by SparcFrontEnd::case_CALL(), dump(), operator<<(), RTLInstDict::print(), prints(), FrontSparcTest::test1(), FrontPentTest::test1(), FrontSparcTest::test2(), FrontPentTest::test2(), FrontSparcTest::test3(), FrontPentTest::test3(), RtlTest::testAppend(), FrontSparcTest::testBranch(), FrontPentTest::testBranch(), RtlTest::testClone(), and RtlTest::testSetConscripts().

char * RTL::prints (   ) 
 

Definition at line 369 of file rtl.cpp.

References debug_buffer, DEBUG_BUFSIZE, and print().

void RTL::replaceLastStmt (  Statement *  repl  ) 
 

Definition at line 289 of file rtl.cpp.

References stmtList.

bool RTL::searchAll (  Exp *  search,
std::list< Exp * > &  result
)  [virtual]
 

Definition at line 423 of file rtl.cpp.

References stmtList.

bool RTL::searchAndReplace (  Exp *  search,
Exp *  replace
)  [virtual]
 

Definition at line 408 of file rtl.cpp.

References stmtList.

void RTL::setAddress (  ADDRESS  a  )  [inline]
 

Definition at line 84 of file rtl.h.

References nativeAddr.

int RTL::setConscripts (  int  n,
bool  bClear
) 
 

Definition at line 669 of file rtl.cpp.

References accept(), and StmtConscriptSetter::getLast().

Referenced by RtlTest::testSetConscripts().

void RTL::simplify (   )  [virtual]
 

Definition at line 565 of file rtl.cpp.

References getAddress(), LOG, opIntConst, stmtList, and VERBOSE.

void RTL::updateAddress (  ADDRESS  addr  ) 
 

Definition at line 397 of file rtl.cpp.

References nativeAddr.

Referenced by SparcFrontEnd::case_CALL(), SparcFrontEnd::case_DD(), case_DD_NCT(), SparcFrontEnd::case_SCD(), case_SCD_NCT(), SparcFrontEnd::case_SCDAN(), case_SCDAN_NCT(), case_SD_NCT(), and SparcFrontEnd::emitNop().

void RTL::updateStmt (  Statement *  s,
unsigned  i
) 
 

Definition at line 253 of file rtl.cpp.

References stmtList.


Friends And Related Function Documentation

friend class XMLProgParser [friend]
 

Definition at line 180 of file rtl.h.


Member Data Documentation

ADDRESS RTL::nativeAddr [private]
 

Definition at line 62 of file rtl.h.

Referenced by getAddress(), operator=(), XMLProgParser::persistToXML(), print(), setAddress(), and updateAddress().

std::list<Statement*> RTL::stmtList [private]
 

Definition at line 63 of file rtl.h.

Referenced by accept(), appendListStmt(), appendRTL(), appendStmt(), areFlagsAffected(), clear(), clone(), deepCopyList(), deleteLastStmt(), deleteStmt(), elementAt(), generateCode(), getHlStmt(), getList(), getNumStmt(), getType(), insertAfterTemps(), insertStmt(), isBranch(), isCall(), isGoto(), operator=(), XMLProgParser::persistToXML(), prependStmt(), print(), replaceLastStmt(), RTL(), searchAll(), searchAndReplace(), simplify(), and updateStmt().


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