ReturnStatement Class Reference

#include <include/statement.h>

Inheritance diagram for ReturnStatement:

Statement List of all members.

Detailed Description

Definition at line 1223 of file statement.h.

Public Types

typedef StatementList::iterator iterator

Public Member Functions

virtual bool accept (StmtPartModifier *visitor)
virtual bool accept (StmtModifier *visitor)
virtual bool accept (StmtExpVisitor *visitor)
virtual bool accept (StmtVisitor *visitor)
void addReturn (Assignment *a)
iterator begin ()
virtual Statementclone ()
virtual bool definesLoc (Exp *loc)
virtual void dfaTypeAnalysis (bool &ch)
iterator end ()
iterator erase (iterator it)
ExpfindDefFor (Exp *e)
virtual void generateCode (HLLCode *hll, BasicBlock *pbb, int indLevel)
StatementListgetCleanReturns ()
DefCollectorgetCollector ()
virtual void getDefinitions (LocationSet &defs)
StatementListgetModifieds ()
unsigned getNumReturns ()
ADDRESS getRetAddr ()
StatementListgetReturns ()
TypegetTypeFor (Exp *e)
virtual bool isDefinition ()
virtual void print (std::ostream &os=std::cout, bool html=false)
void removeModified (Exp *loc)
void removeReturn (Exp *loc)
 ReturnStatement ()
virtual bool search (Exp *, Exp *&)
virtual bool searchAll (Exp *search, std::list< Exp * > &result)
virtual bool searchAndReplace (Exp *search, Exp *replace, bool cc=false)
void setRetAddr (ADDRESS r)
void setTypeFor (Exp *e, Type *ty)
virtual void simplify ()
ExpsubscriptWithDef (Exp *e)
void updateModifieds ()
void updateReturns ()
virtual bool usesExp (Exp *e)
virtual ~ReturnStatement ()

Protected Attributes

DefCollector col
 A DefCollector object to collect the reaching definitions.
StatementList modifieds
 A list of assignments that represents the locations modified by the enclosing procedure.
ADDRESS retAddr
StatementList returns
 A list of assignments of locations to expressions.

Friends

class XMLProgParser


Member Typedef Documentation

typedef StatementList::iterator ReturnStatement::iterator
 

Definition at line 1258 of file statement.h.


Constructor & Destructor Documentation

ReturnStatement::ReturnStatement  ) 
 

Definition at line 2796 of file statement.cpp.

References Statement::kind, and STMT_RET.

Referenced by clone().

ReturnStatement::~ReturnStatement  )  [virtual]
 

Definition at line 2806 of file statement.cpp.


Member Function Documentation

bool ReturnStatement::accept StmtPartModifier visitor  )  [virtual]
 

Implements Statement.

Definition at line 4082 of file statement.cpp.

References StatementList::begin(), StatementList::end(), modifieds, returns, and StmtPartModifier::visit().

bool ReturnStatement::accept StmtModifier visitor  )  [virtual]
 

Implements Statement.

Definition at line 3968 of file statement.cpp.

References DefCollector::begin(), col, DefCollector::end(), StmtModifier::ignoreCollector(), and StmtModifier::visit().

bool ReturnStatement::accept StmtExpVisitor visitor  )  [virtual]
 

Implements Statement.

Definition at line 3838 of file statement.cpp.

References StatementList::begin(), DefCollector::begin(), col, StatementList::end(), DefCollector::end(), StmtExpVisitor::isIgnoreCol(), modifieds, and StmtExpVisitor::visit().

bool ReturnStatement::accept StmtVisitor visitor  )  [virtual]
 

Implements Statement.

Definition at line 2832 of file statement.cpp.

References StmtVisitor::visit().

Referenced by RtlTest::testVisitor().

void ReturnStatement::addReturn Assignment a  ) 
 

Definition at line 2861 of file statement.cpp.

References StatementList::append(), and returns.

Referenced by StatementTest::testAddUsedLocsReturn(), StatementTest::testFlow(), StatementTest::testKill(), StatementTest::testSubscriptVars(), StatementTest::testUse(), StatementTest::testUseKill(), StatementTest::testUseOverBB(), and StatementTest::testUseOverKill().

iterator ReturnStatement::begin  )  [inline]
 

Definition at line 1259 of file statement.h.

References StatementList::begin(), and returns.

Referenced by search(), searchAll(), searchAndReplace(), usesExp(), UsedLocsVisitor::visit(), and StmtConscriptSetter::visit().

Statement * ReturnStatement::clone  )  [virtual]
 

Implements Statement.

Definition at line 2815 of file statement.cpp.

References StatementList::append(), StatementList::begin(), col, StatementList::end(), DefCollector::makeCloneOf(), modifieds, Statement::number, Statement::pbb, Statement::proc, retAddr, returns, and ReturnStatement().

bool ReturnStatement::definesLoc Exp loc  )  [virtual]
 

Reimplemented from Statement.

Definition at line 4243 of file statement.cpp.

References StatementList::begin(), StatementList::end(), and modifieds.

void ReturnStatement::dfaTypeAnalysis bool &  ch  )  [virtual]
 

Reimplemented from Statement.

Definition at line 759 of file dfa.cpp.

References StatementList::begin(), StatementList::end(), and modifieds.

iterator ReturnStatement::end  )  [inline]
 

Definition at line 1260 of file statement.h.

References StatementList::end(), and returns.

Referenced by search(), searchAll(), searchAndReplace(), usesExp(), UsedLocsVisitor::visit(), and StmtConscriptSetter::visit().

iterator ReturnStatement::erase iterator  it  )  [inline]
 

Definition at line 1261 of file statement.h.

References StatementList::erase(), and returns.

Exp* ReturnStatement::findDefFor Exp e  )  [inline]
 

Definition at line 1323 of file statement.h.

References col, and DefCollector::findDefFor().

void ReturnStatement::generateCode HLLCode hll,
BasicBlock pbb,
int  indLevel
[virtual]
 

Implements Statement.

Definition at line 2836 of file statement.cpp.

References HLLCode::AddReturnStatement(), and getReturns().

StatementList* ReturnStatement::getCleanReturns  ) 
 

DefCollector* ReturnStatement::getCollector  )  [inline]
 

Definition at line 1316 of file statement.h.

References col.

Referenced by UsedLocsVisitor::visit().

void ReturnStatement::getDefinitions LocationSet defs  )  [virtual]
 

Reimplemented from Statement.

Definition at line 4253 of file statement.cpp.

References StatementList::begin(), StatementList::end(), and modifieds.

StatementList& ReturnStatement::getModifieds  )  [inline]
 

Definition at line 1262 of file statement.h.

References modifieds.

Referenced by UserProc::findPreserveds(), and UserProc::getModifieds().

unsigned ReturnStatement::getNumReturns  )  [inline]
 

Definition at line 1264 of file statement.h.

References returns, and StatementList::size().

ADDRESS ReturnStatement::getRetAddr  )  [inline]
 

Definition at line 1319 of file statement.h.

References retAddr.

Referenced by UserProc::getTheReturnAddr().

StatementList& ReturnStatement::getReturns  )  [inline]
 

Definition at line 1263 of file statement.h.

References returns.

Referenced by generateCode().

Type * ReturnStatement::getTypeFor Exp e  )  [virtual]
 

Reimplemented from Statement.

Definition at line 4259 of file statement.cpp.

References StatementList::begin(), StatementList::end(), and modifieds.

virtual bool ReturnStatement::isDefinition  )  [inline, virtual]
 

Implements Statement.

Definition at line 1294 of file statement.h.

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

Implements Statement.

Definition at line 4285 of file statement.cpp.

References StatementList::begin(), StatementList::end(), Statement::number, RETSTMT_COLS, and returns.

void ReturnStatement::removeModified Exp loc  ) 
 

Definition at line 4936 of file statement.cpp.

References modifieds, StatementList::removeDefOf(), and returns.

void ReturnStatement::removeReturn Exp loc  ) 
 

Definition at line 2849 of file statement.cpp.

References StatementList::begin(), StatementList::end(), StatementList::erase(), Exp::getSubExp1(), Exp::isSubscript(), and returns.

Referenced by UserProc::removeReturn().

bool ReturnStatement::search Exp ,
Exp *& 
[virtual]
 

Implements Statement.

Definition at line 2866 of file statement.cpp.

References begin(), end(), NULL, and result.

Referenced by searchAll(), and searchAndReplace().

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

Implements Statement.

Definition at line 2889 of file statement.cpp.

References begin(), end(), and search().

bool ReturnStatement::searchAndReplace Exp search,
Exp replace,
bool  cc = false
[virtual]
 

Implements Statement.

Definition at line 2876 of file statement.cpp.

References DefCollector::begin(), begin(), col, DefCollector::end(), end(), and search().

void ReturnStatement::setRetAddr ADDRESS  r  )  [inline]
 

Definition at line 1320 of file statement.h.

References retAddr.

Referenced by UserProc::setTheReturnAddr().

void ReturnStatement::setTypeFor Exp e,
Type ty
[virtual]
 

Reimplemented from Statement.

Definition at line 4268 of file statement.cpp.

References StatementList::begin(), StatementList::end(), and modifieds.

void ReturnStatement::simplify  )  [virtual]
 

Implements Statement.

Definition at line 2840 of file statement.cpp.

References StatementList::begin(), StatementList::end(), modifieds, and returns.

Exp* ReturnStatement::subscriptWithDef Exp e  ) 
 

void ReturnStatement::updateModifieds  ) 
 

Definition at line 4368 of file statement.cpp.

References StatementList::clear(), Proc::getSignature(), modifieds, FrontEnd::noReturnCallDest(), and Statement::proc.

Referenced by UserProc::middleDecompile().

void ReturnStatement::updateReturns  ) 
 

Definition at line 4435 of file statement.cpp.

References StatementList::begin(), StatementList::clear(), StatementList::end(), UserProc::filterReturns(), Assignment::getLeft(), Proc::getSignature(), Signature::getStackRegister(), Exp::isRegN(), modifieds, Statement::proc, returns, and sp.

Referenced by UserProc::middleDecompile().

bool ReturnStatement::usesExp Exp e  )  [virtual]
 

Implements Statement.

Definition at line 2905 of file statement.cpp.

References begin(), and end().


Friends And Related Function Documentation

friend class XMLProgParser [friend]
 

Reimplemented from Statement.

Definition at line 1333 of file statement.h.


Member Data Documentation

DefCollector ReturnStatement::col [protected]
 

A DefCollector object to collect the reaching definitions.

These are not sorted or filtered. Second, some of those definitions make it to the modifieds list, which is sorted and filtered. These are the locations that are modified by the enclosing procedure. As locations are proved to be preserved (with NO modification, not even sp = sp+4), they are removed from this list. Defines in calls to the enclosing procedure are based on this list. Third, the modifications are initially copied to the returns list (also sorted and filtered, but the returns have RHS where the modifieds don't). Locations not live at any caller are removed from the returns, but not from the modifieds.

Definition at line 1240 of file statement.h.

Referenced by accept(), clone(), findDefFor(), getCollector(), and searchAndReplace().

StatementList ReturnStatement::modifieds [protected]
 

A list of assignments that represents the locations modified by the enclosing procedure.

These assignments have no RHS? These transmit type information to callers Note that these include preserved locations early on (?)

Definition at line 1246 of file statement.h.

Referenced by accept(), clone(), definesLoc(), dfaTypeAnalysis(), getDefinitions(), getModifieds(), getTypeFor(), XMLProgParser::persistToXML(), removeModified(), setTypeFor(), simplify(), updateModifieds(), and updateReturns().

ADDRESS ReturnStatement::retAddr [protected]
 

Definition at line 1226 of file statement.h.

Referenced by clone(), getRetAddr(), XMLProgParser::persistToXML(), and setRetAddr().

StatementList ReturnStatement::returns [protected]
 

A list of assignments of locations to expressions.

Initially definitions reaching the exit less preserveds; later has locations unused by any callers removed. A list is used to facilitate ordering. (A set would be ideal, but the ordering depends at runtime on the signature)

Definition at line 1252 of file statement.h.

Referenced by accept(), addReturn(), begin(), clone(), end(), erase(), getNumReturns(), getReturns(), XMLProgParser::persistToXML(), print(), removeModified(), removeReturn(), simplify(), and updateReturns().


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