CallStatement Class Reference

#include <include/statement.h>

Inheritance diagram for CallStatement:

GotoStatement Statement List of all members.

Detailed Description

Definition at line 1041 of file statement.h.

Public Member Functions

virtual bool accept (StmtPartModifier *visitor)
virtual bool accept (StmtModifier *visitor)
virtual bool accept (StmtExpVisitor *visitor)
virtual bool accept (StmtVisitor *visitor)
void addArgument (Exp *e, UserProc *proc)
void addDefine (ImplicitAssign *as)
ExpbypassRef (RefExp *r, bool &ch)
StatementListcalcResults ()
 CallStatement ()
void clearLiveEntry ()
void clearUseCollector ()
virtual Statementclone ()
bool convertToDirect ()
void decompile ()
virtual bool definesLoc (Exp *loc)
void dfaTypeAnalysis (bool &ch)
void eliminateDuplicateArgs ()
bool ellipsisProcessing (Prog *prog)
ExpfindDefFor (Exp *e)
int findDefine (Exp *e)
virtual void genConstraints (LocationSet &cons)
virtual void generateCode (HLLCode *hll, BasicBlock *pbb, int indLevel)
ExpgetArgumentExp (int i)
StatementListgetArguments ()
TypegetArgumentType (int i)
ReturnStatementgetCalleeReturn ()
DefCollectorgetDefCollector ()
StatementListgetDefines ()
virtual void getDefinitions (LocationSet &defs)
ProcgetDestProc ()
int getNumArguments ()
std::list< Exp * > * getPostCallExpList ()
ExpgetProven (Exp *e)
SignaturegetSignature ()
virtual TypegetTypeFor (Exp *e)
UseCollectorgetUseCollector ()
bool isChildless ()
virtual bool isDefinition ()
bool isReturnAfterCall ()
void localiseComp (Exp *e)
ExplocaliseExp (Exp *e)
virtual void print (std::ostream &os=std::cout, bool html=false)
void rangeAnalysis (std::list< Statement * > &execution_paths)
void removeAllLive ()
void removeArgument (int i)
void removeDefine (Exp *e)
void removeLiveness (Exp *e)
virtual bool search (Exp *search, Exp *&result)
virtual bool searchAll (Exp *search, std::list< Exp * > &result)
virtual bool searchAndReplace (Exp *search, Exp *replace, bool cc=false)
void setArgumentExp (int i, Exp *e)
void setArguments (StatementList &args)
void setCalleeReturn (ReturnStatement *ret)
void setDestProc (Proc *dest)
virtual void setLeftFor (Exp *forExp, Exp *newExp)
void setNumArguments (int i)
virtual void setNumber (int num)
void setPostCallExpList (std::list< Exp * > *le)
void setReturnAfterCall (bool b)
void setSigArguments ()
virtual void setTypeFor (Exp *e, Type *ty)
virtual void simplify ()
void truncateArguments ()
void updateArguments ()
void updateDefines ()
void useBeforeDefine (Exp *x)
void useColFromSsaForm (Statement *s)
virtual bool usesExp (Exp *e)
virtual ~CallStatement ()

Protected Member Functions

void appendArgument (Assignment *as)
void updateDefineWithType (int n)

Private Member Functions

void addSigParam (Type *ty, bool isScanf)
AssignmakeArgAssign (Type *ty, Exp *e)

Private Attributes

StatementList arguments
ReturnStatementcalleeReturn
DefCollector defCol
StatementList defines
ProcprocDest
bool returnAfterCall
Signaturesignature
UseCollector useCol

Friends

class XMLProgParser


Constructor & Destructor Documentation

CallStatement::CallStatement  ) 
 

Definition at line 1948 of file statement.cpp.

References Statement::kind, NULL, procDest, signature, and STMT_CALL.

Referenced by clone().

CallStatement::~CallStatement  )  [virtual]
 

Definition at line 1960 of file statement.cpp.


Member Function Documentation

bool CallStatement::accept StmtPartModifier visitor  )  [virtual]
 

Reimplemented from GotoStatement.

Definition at line 4055 of file statement.cpp.

References Exp::accept(), arguments, UseCollector::begin(), DefCollector::begin(), StatementList::begin(), defCol, UseCollector::end(), DefCollector::end(), StatementList::end(), StmtPartModifier::ignoreCollector(), StmtPartModifier::mod, GotoStatement::pDest, useCol, and StmtPartModifier::visit().

bool CallStatement::accept StmtModifier visitor  )  [virtual]
 

Reimplemented from GotoStatement.

Definition at line 3943 of file statement.cpp.

References Exp::accept(), arguments, DefCollector::begin(), StatementList::begin(), defCol, DefCollector::end(), StatementList::end(), StmtModifier::ignoreCollector(), StmtModifier::mod, GotoStatement::pDest, and StmtModifier::visit().

bool CallStatement::accept StmtExpVisitor visitor  )  [virtual]
 

Reimplemented from GotoStatement.

Definition at line 3818 of file statement.cpp.

References Exp::accept(), arguments, StatementList::begin(), defines, StatementList::end(), StmtExpVisitor::ev, GotoStatement::pDest, and StmtExpVisitor::visit().

bool CallStatement::accept StmtVisitor visitor  )  [virtual]
 

Reimplemented from GotoStatement.

Definition at line 2260 of file statement.cpp.

References StmtVisitor::visit().

Referenced by RtlTest::testVisitor().

void CallStatement::addArgument Exp e,
UserProc proc
 

void CallStatement::addDefine ImplicitAssign as  ) 
 

Definition at line 4941 of file statement.cpp.

References StatementList::append(), and defines.

Referenced by StatementTest::testAddUsedLocsCall(), and StatementTest::testSubscriptVars().

void CallStatement::addSigParam Type ty,
bool  isScanf
[private]
 

Definition at line 2774 of file statement.cpp.

References Signature::addParameter(), StatementList::append(), arguments, Type::getCtype(), Signature::getNumParams(), Signature::getParamExp(), LOG, makeArgAssign(), signature, and StatementList::size().

void CallStatement::appendArgument Assignment as  )  [inline, protected]
 

Definition at line 1213 of file statement.h.

References StatementList::append(), and arguments.

Exp * CallStatement::bypassRef RefExp r,
bool &  ch
 

Definition at line 4895 of file statement.cpp.

References Signature::findReturn(), Signature::getProven(), Proc::getSignature(), Unary::getSubExp1(), Proc::isLib(), NULL, and procDest.

Referenced by CallBypasser::postVisit().

StatementList * CallStatement::calcResults  ) 
 

Definition at line 4808 of file statement.cpp.

References StatementList::append(), UseCollector::exists(), UserProc::findLocal(), Signature::getNumReturns(), Signature::getReturnExp(), Proc::getSignature(), getTypeFor(), Proc::isLib(), Location::local(), Statement::proc, procDest, and useCol.

Referenced by generateCode().

void CallStatement::clearLiveEntry  ) 
 

void CallStatement::clearUseCollector  )  [inline]
 

Definition at line 1117 of file statement.h.

References UseCollector::clear(), and useCol.

Statement * CallStatement::clone  )  [virtual]
 

Reimplemented from GotoStatement.

Definition at line 2243 of file statement.cpp.

References StatementList::append(), arguments, StatementList::begin(), CallStatement(), Exp::clone(), defines, StatementList::end(), GotoStatement::m_isComputed, Statement::number, Statement::pbb, GotoStatement::pDest, and Statement::proc.

Referenced by rangeAnalysis().

bool CallStatement::convertToDirect  ) 
 

Definition at line 2358 of file statement.cpp.

References Unary::getSubExp1(), Exp::isSubscript(), GotoStatement::m_isComputed, and GotoStatement::pDest.

void CallStatement::decompile  ) 
 

bool CallStatement::definesLoc Exp loc  )  [virtual]
 

Reimplemented from Statement.

Definition at line 4229 of file statement.cpp.

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

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

Reimplemented from Statement.

Definition at line 727 of file dfa.cpp.

References arguments, StatementList::begin(), StatementList::end(), Signature::getParamBoundMax(), Signature::getParamName(), Proc::getSignature(), and procDest.

void CallStatement::eliminateDuplicateArgs  ) 
 

Definition at line 5010 of file statement.cpp.

References arguments, StatementList::begin(), StatementList::end(), StatementList::erase(), and LocationSet::exists().

bool CallStatement::ellipsisProcessing Prog prog  ) 
 

Definition at line 2622 of file statement.cpp.

References getArgumentExp(), getDestProc(), getNumArguments(), Unary::getSubExp1(), Exp::getSubExp1(), Signature::hasEllipsis(), Exp::isAddrOf(), Exp::isMemOf(), Exp::isSubscript(), LOG, NULL, and signature.

Exp * CallStatement::findDefFor Exp e  ) 
 

Definition at line 2001 of file statement.cpp.

References defCol, and DefCollector::findDefFor().

Referenced by Localiser::postVisit().

int CallStatement::findDefine Exp e  ) 
 

Definition at line 1964 of file statement.cpp.

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

void CallStatement::genConstraints LocationSet cons  )  [virtual]
 

Reimplemented from Statement.

Definition at line 3577 of file statement.cpp.

References arguments, StatementList::begin(), StatementList::end(), getDestProc(), PhiAssign::getRight(), Proc::getSignature(), Exp::getSubExp1(), Exp::isMemOf(), and NULL.

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

Reimplemented from GotoStatement.

Definition at line 2274 of file statement.cpp.

References HLLCode::AddIndCallStatement(), StatementList::append(), arguments, calcResults(), Type::clone(), Boomerang::get(), Signature::getArgumentExp(), getDestProc(), Proc::getName(), Signature::getNumReturns(), Signature::getParamType(), Proc::getSignature(), GotoStatement::isComputed(), LOG, NULL, Statement::number, Statement::pbb, GotoStatement::pDest, Statement::proc, procDest, Statement::setBB(), Statement::setNumber(), Statement::setProc(), Location::setProc(), and signature.

Exp * CallStatement::getArgumentExp int  i  ) 
 

Definition at line 2460 of file statement.cpp.

References arguments, StatementList::begin(), my_advance, and StatementList::size().

Referenced by ellipsisProcessing().

StatementList& CallStatement::getArguments  )  [inline]
 

Definition at line 1093 of file statement.h.

References arguments.

Referenced by UserProc::fixCallAndPhiRefs(), StmtSsaXformer::visit(), StmtSubscripter::visit(), UsedLocsVisitor::visit(), and StmtConscriptSetter::visit().

Type * CallStatement::getArgumentType int  i  ) 
 

Definition at line 2005 of file statement.cpp.

References arguments, StatementList::begin(), my_advance, and StatementList::size().

ReturnStatement* CallStatement::getCalleeReturn  )  [inline]
 

Definition at line 1104 of file statement.h.

References calleeReturn.

DefCollector* CallStatement::getDefCollector  )  [inline]
 

Definition at line 1192 of file statement.h.

References defCol.

StatementList& CallStatement::getDefines  )  [inline]
 

Definition at line 1198 of file statement.h.

References defines.

Referenced by StmtSsaXformer::visit().

void CallStatement::getDefinitions LocationSet defs  )  [virtual]
 

Reimplemented from Statement.

Definition at line 2345 of file statement.cpp.

References StatementList::begin(), defines, StatementList::end(), Boomerang::get(), LocationSet::insert(), isChildless(), and opDefineAll.

Referenced by isDefinition().

Proc * CallStatement::getDestProc  ) 
 

Definition at line 2264 of file statement.cpp.

References procDest.

Referenced by ArgSourceProvider::ArgSourceProvider(), UserProc::assignProcsToCalls(), ellipsisProcessing(), PentiumFrontEnd::extraProcessCall(), genConstraints(), generateCode(), BasicBlock::getDestProc(), UserProc::initStatements(), UserProc::isNoReturn(), and StmtSsaXformer::visit().

int CallStatement::getNumArguments  ) 
 

Definition at line 2477 of file statement.cpp.

References arguments, and StatementList::size().

Referenced by ellipsisProcessing().

std::list<Exp*>* CallStatement::getPostCallExpList  ) 
 

Exp * CallStatement::getProven Exp e  ) 
 

Definition at line 1975 of file statement.cpp.

References Proc::getProven(), NULL, and procDest.

Signature* CallStatement::getSignature  )  [inline]
 

Definition at line 1108 of file statement.h.

References signature.

Referenced by ArgSourceProvider::ArgSourceProvider().

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

Reimplemented from Statement.

Definition at line 2595 of file statement.cpp.

References defines, StatementList::findOnLeft(), TypingStatement::getType(), Exp::isPC(), and NULL.

Referenced by calcResults().

UseCollector* CallStatement::getUseCollector  )  [inline]
 

Definition at line 1193 of file statement.h.

References useCol.

bool CallStatement::isChildless  ) 
 

Definition at line 4886 of file statement.cpp.

References calleeReturn, Proc::isLib(), NULL, and procDest.

Referenced by getDefinitions().

bool CallStatement::isDefinition  )  [virtual]
 

Reimplemented from GotoStatement.

Definition at line 2899 of file statement.cpp.

References getDefinitions(), and LocationSet::size().

bool CallStatement::isReturnAfterCall  ) 
 

Definition at line 2233 of file statement.cpp.

References returnAfterCall.

Referenced by SparcFrontEnd::case_CALL(), and SparcFrontEnd::optimise_CallReturn().

void CallStatement::localiseComp Exp e  ) 
 

Definition at line 1982 of file statement.cpp.

References Exp::isMemOf(), and localiseExp().

Referenced by ArgSourceProvider::exists(), makeArgAssign(), and ArgSourceProvider::nextArgLoc().

Exp * CallStatement::localiseExp Exp e  ) 
 

Definition at line 1990 of file statement.cpp.

References Exp::accept(), Exp::clone(), defCol, and DefCollector::isInitialised().

Referenced by ArgSourceProvider::localise(), localiseComp(), and makeArgAssign().

Assign * CallStatement::makeArgAssign Type ty,
Exp e
[private]
 

Definition at line 2756 of file statement.cpp.

References Exp::clone(), UserProc::getCFG(), Cfg::implicitsDone(), localiseComp(), localiseExp(), and Statement::proc.

Referenced by addSigParam().

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

Reimplemented from GotoStatement.

Definition at line 2134 of file statement.cpp.

References StatementList::begin(), defines, StatementList::end(), Assignment::getLeft(), TypingStatement::getType(), Statement::isAssign(), Statement::number, and StatementList::size().

void CallStatement::rangeAnalysis std::list< Statement * > &  execution_paths  )  [virtual]
 

Reimplemented from Statement.

Definition at line 439 of file statement.cpp.

References UserProc::addCallee(), StatementList::append(), arguments, StatementList::clear(), Signature::clone(), clone(), GotoStatement::getDest(), Statement::getInputRanges(), Prog::getLibraryProc(), Proc::getName(), Signature::getNumParams(), Signature::getParamExp(), Proc::getProg(), Proc::getSignature(), Exp::isIntConst(), Exp::isStrConst(), LOG, GotoStatement::m_isComputed, NULL, GotoStatement::pDest, Statement::proc, procDest, Statement::setBB(), Prog::setNewProc(), Statement::setProc(), signature, RangeMap::substInto(), and UserProc::undoComputedBB().

void CallStatement::removeAllLive  )  [inline]
 

Definition at line 1196 of file statement.h.

References UseCollector::clear(), and useCol.

void CallStatement::removeArgument int  i  ) 
 

Definition at line 2504 of file statement.cpp.

References arguments, StatementList::begin(), StatementList::erase(), and my_advance.

void CallStatement::removeDefine Exp e  ) 
 

Definition at line 4874 of file statement.cpp.

References StatementList::begin(), defines, StatementList::end(), StatementList::erase(), and Assignment::getLeft().

void CallStatement::removeLiveness Exp e  )  [inline]
 

Definition at line 1195 of file statement.h.

References UseCollector::remove(), and useCol.

bool CallStatement::search Exp search,
Exp *&  result
[virtual]
 

Reimplemented from GotoStatement.

Definition at line 2068 of file statement.cpp.

References StatementList::begin(), defines, StatementList::end(), result, and GotoStatement::search().

Referenced by searchAll(), and searchAndReplace().

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

Reimplemented from GotoStatement.

Definition at line 2114 of file statement.cpp.

References StatementList::begin(), defines, StatementList::end(), search(), and GotoStatement::searchAll().

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

Reimplemented from GotoStatement.

Definition at line 2091 of file statement.cpp.

References arguments, DefCollector::begin(), StatementList::begin(), defCol, defines, DefCollector::end(), StatementList::end(), search(), and GotoStatement::searchAndReplace().

void CallStatement::setArgumentExp int  i,
Exp e
 

Definition at line 2468 of file statement.cpp.

References arguments, StatementList::begin(), Exp::clone(), my_advance, and StatementList::size().

void CallStatement::setArguments StatementList args  ) 
 

Definition at line 2018 of file statement.cpp.

References StatementList::append(), arguments, StatementList::begin(), StatementList::clear(), StatementList::end(), and Statement::proc.

Referenced by StatementTest::testAddUsedLocsCall(), RtlTest::testSetConscripts(), and StatementTest::testSubscriptVars().

void CallStatement::setCalleeReturn ReturnStatement ret  )  [inline]
 

Definition at line 1105 of file statement.h.

References calleeReturn.

Referenced by RtlTest::testSetConscripts(), and StatementTest::testSubscriptVars().

void CallStatement::setDestProc Proc dest  ) 
 

Definition at line 2268 of file statement.cpp.

References procDest.

Referenced by UserProc::assignProcsToCalls(), PentiumFrontEnd::decodeInstruction(), SparcDecoder::decodeInstruction(), PPCDecoder::decodeInstruction(), PentiumDecoder::decodeInstruction(), FrontEnd::processProc(), StatementTest::testBypass(), StatementTest::testRecursion(), RtlTest::testSetConscripts(), and StatementTest::testSubscriptVars().

void CallStatement::setLeftFor Exp forExp,
Exp newExp
[virtual]
 

Reimplemented from Statement.

Definition at line 4217 of file statement.cpp.

void CallStatement::setNumArguments int  i  ) 
 

Definition at line 2482 of file statement.cpp.

References StatementList::append(), arguments, StatementList::begin(), Type::clone(), StatementList::end(), StatementList::erase(), Signature::getArgumentExp(), Signature::getParamType(), Proc::getSignature(), my_advance, NULL, Statement::proc, procDest, Statement::setBB(), Statement::setProc(), and StatementList::size().

void CallStatement::setNumber int  num  )  [virtual]
 

Reimplemented from Statement.

Definition at line 5115 of file statement.cpp.

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

void CallStatement::setPostCallExpList std::list< Exp * > *  le  ) 
 

void CallStatement::setReturnAfterCall bool  b  ) 
 

Definition at line 2222 of file statement.cpp.

References returnAfterCall.

Referenced by FrontEnd::processProc().

void CallStatement::setSigArguments  ) 
 

Definition at line 2035 of file statement.cpp.

References Proc::addCaller(), StatementList::append(), arguments, StatementList::clear(), Type::clone(), Signature::clone(), Signature::getArgumentExp(), Signature::getNumParams(), Signature::getParamType(), Proc::getSignature(), Proc::isLib(), NULL, Statement::number, Statement::proc, procDest, Statement::setBB(), Statement::setNumber(), Statement::setParent(), Statement::setProc(), Location::setProc(), and signature.

Referenced by UserProc::initStatements().

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

Reimplemented from Statement.

Definition at line 2606 of file statement.cpp.

References defCol, defines, DefCollector::findDefFor(), StatementList::findOnLeft(), Exp::isSubscript(), NULL, TypingStatement::setType(), and Statement::setTypeFor().

void CallStatement::simplify  )  [virtual]
 

Reimplemented from GotoStatement.

Definition at line 2321 of file statement.cpp.

References arguments, StatementList::begin(), defines, StatementList::end(), and GotoStatement::simplify().

void CallStatement::truncateArguments  ) 
 

void CallStatement::updateArguments  ) 
 

Definition at line 4717 of file statement.cpp.

References StatementList::append(), arguments, DefCollector::begin(), UserProc::canRename(), StatementList::clear(), Type::clone(), Exp::clone(), ArgSourceProvider::curType(), defCol, DefCollector::end(), StatementList::existsOnLeft(), EXPERIMENTAL, UserProc::filterParams(), Proc::getSignature(), ArgSourceProvider::localise(), ArgSourceProvider::nextArgLoc(), NULL, Statement::number, Statement::proc, UserProc::propagateStatements(), Statement::setBB(), Statement::setNumber(), Statement::setParent(), and Statement::setProc().

void CallStatement::updateDefines  ) 
 

Definition at line 4503 of file statement.cpp.

References defines, Proc::getSignature(), Proc::isLib(), Statement::proc, procDest, and Signature::setLibraryDefines().

Referenced by UserProc::updateCallDefines().

void CallStatement::updateDefineWithType int  n  )  [protected]
 

void CallStatement::useBeforeDefine Exp x  )  [inline]
 

Definition at line 1194 of file statement.h.

References UseCollector::insert(), and useCol.

void CallStatement::useColFromSsaForm Statement s  )  [inline]
 

Definition at line 1204 of file statement.h.

References UseCollector::fromSSAform(), Statement::proc, and useCol.

bool CallStatement::usesExp Exp e  )  [virtual]
 

Reimplemented from GotoStatement.

Definition at line 2335 of file statement.cpp.

References arguments, StatementList::begin(), defines, StatementList::end(), and GotoStatement::usesExp().


Friends And Related Function Documentation

friend class XMLProgParser [friend]
 

Reimplemented from GotoStatement.

Definition at line 1214 of file statement.h.


Member Data Documentation

StatementList CallStatement::arguments [private]
 

Definition at line 1045 of file statement.h.

Referenced by accept(), addSigParam(), appendArgument(), clone(), dfaTypeAnalysis(), eliminateDuplicateArgs(), genConstraints(), generateCode(), getArgumentExp(), getArguments(), getArgumentType(), getNumArguments(), rangeAnalysis(), removeArgument(), searchAndReplace(), setArgumentExp(), setArguments(), setNumArguments(), setNumber(), setSigArguments(), simplify(), updateArguments(), and usesExp().

ReturnStatement* CallStatement::calleeReturn [private]
 

Definition at line 1072 of file statement.h.

Referenced by getCalleeReturn(), isChildless(), and setCalleeReturn().

DefCollector CallStatement::defCol [private]
 

Definition at line 1067 of file statement.h.

Referenced by accept(), findDefFor(), getDefCollector(), localiseExp(), searchAndReplace(), setTypeFor(), and updateArguments().

StatementList CallStatement::defines [private]
 

Definition at line 1050 of file statement.h.

Referenced by accept(), addDefine(), clone(), definesLoc(), findDefine(), getDefines(), getDefinitions(), getTypeFor(), print(), removeDefine(), search(), searchAll(), searchAndReplace(), setTypeFor(), simplify(), updateDefines(), and usesExp().

Proc* CallStatement::procDest [private]
 

Definition at line 1055 of file statement.h.

Referenced by bypassRef(), calcResults(), CallStatement(), dfaTypeAnalysis(), generateCode(), getDestProc(), getProven(), isChildless(), rangeAnalysis(), setDestProc(), setNumArguments(), setSigArguments(), and updateDefines().

bool CallStatement::returnAfterCall [private]
 

Definition at line 1042 of file statement.h.

Referenced by isReturnAfterCall(), and setReturnAfterCall().

Signature* CallStatement::signature [private]
 

Definition at line 1059 of file statement.h.

Referenced by addSigParam(), CallStatement(), ellipsisProcessing(), generateCode(), getSignature(), rangeAnalysis(), and setSigArguments().

UseCollector CallStatement::useCol [private]
 

Definition at line 1063 of file statement.h.

Referenced by accept(), calcResults(), clearUseCollector(), getUseCollector(), removeAllLive(), removeLiveness(), useBeforeDefine(), and useColFromSsaForm().


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