#include <include/proc.h>
Inheritance diagram for Proc:
Definition at line 62 of file proc.h.
Public Member Functions | |
void | addCaller (CallStatement *caller) |
Add to the set of callers. | |
void | addCallers (std::set< UserProc * > &callers) |
Add to a set of caller Procs. | |
void | clearVisited () |
std::set< CallStatement * > & | getCallers () |
Get the callers Note: the callers will be in a random order (determined by memory allocation). | |
Cluster * | getCluster () |
Proc * | getFirstCaller () |
Get/Set the first procedure that calls this procedure (or null for main/start). | |
const char * | getName () |
Gets name of this procedure. | |
ADDRESS | getNativeAddress () |
Get the native address. | |
std::list< Type > * | getParamTypeList (const std::list< Exp * > &actuals) |
Get a list of types to cast a given list of actual parameters to. | |
virtual Exp * | getPremised (Exp *left)=0 |
Prog * | getProg () |
Get the program this procedure belongs to. | |
virtual Exp * | getProven (Exp *left)=0 |
Signature * | getSignature () |
Returns a pointer to the Signature. | |
virtual bool | isLib () |
Return true if this is a library proc. | |
virtual bool | isNoReturn ()=0 |
Return true if this procedure doesn't return. | |
virtual bool | isPreserved (Exp *e)=0 |
Return whether e is preserved by this proc. | |
bool | isVisited () |
void | matchParams (std::list< Exp * > &actuals, UserProc &caller) |
Modify actuals so that it is now the list of locations that must be passed to this procedure. | |
virtual void | printCallGraphXML (std::ostream &os, int depth, bool recurse=true) |
void | printDetailsXML () |
Proc (Prog *prog, ADDRESS uNative, Signature *sig) | |
Constructor with name, native address and optional bLib. | |
void | removeParameter (Exp *e) |
virtual void | removeReturn (Exp *e) |
virtual void | renameParam (const char *oldName, const char *newName) |
void | setCluster (Cluster *c) |
void | setFirstCaller (Proc *p) |
void | setName (const char *nam) |
Gets sets the name of this procedure. | |
void | setNativeAddress (ADDRESS a) |
Set the native address. | |
void | setProg (Prog *p) |
void | setProvenTrue (Exp *fact) |
Set an equation as proven. Useful for some sorts of testing. | |
void | setSignature (Signature *sig) |
virtual | ~Proc () |
Protected Member Functions | |
Proc () | |
Protected Attributes | |
ADDRESS | address |
Persistent state Procedure's address. | |
std::set< CallStatement * > | callerSet |
Set of callers (CallStatements that call this procedure). | |
Cluster * | cluster |
Cluster this procedure is contained within. | |
Proc * | m_firstCaller |
first procedure to call this procedure. | |
ADDRESS | m_firstCallerAddr |
can only be used once. | |
Prog * | prog |
Program containing this procedure. | |
std::map< Exp *, Exp *, lessExpStar > | provenTrue |
Proof the form r28 = r28 + 4 is stored as map from "r28" to "r28+4" (NOTE: no subscripts). | |
std::map< Exp *, Exp *, lessExpStar > | recurPremises |
Signature * | signature |
The formal signature of this procedure. | |
bool | visited |
For printCallGraphXML. | |
Friends | |
std::ostream & | operator<< (std::ostream &os, Proc &proc) |
OutPut operator for a Proc object. | |
class | XMLProgParser |
|
Constructor with name, native address and optional bLib.
Definition at line 89 of file proc.cpp. References cluster, Prog::getDefaultCluster(), Signature::getName(), Prog::getRootCluster(), and prog. |
|
|
|
|
|
Add to the set of callers.
Definition at line 202 of file proc.h. References callerSet. Referenced by CallStatement::setSigArguments(). |
|
Add to a set of caller Procs.
Definition at line 3720 of file proc.cpp. References callerSet. |
|
Definition at line 216 of file proc.h. References visited. |
|
Get the callers Note: the callers will be in a random order (determined by memory allocation).
Definition at line 197 of file proc.h. References callerSet. |
|
Definition at line 219 of file proc.h. References cluster. Referenced by Prog::generateRTL(), Prog::getStmtAtLex(), and XMLProgParser::persistToXML(). |
|
Get/Set the first procedure that calls this procedure (or null for main/start).
Definition at line 361 of file proc.cpp. References Prog::findProc(), m_firstCaller, m_firstCallerAddr, NO_ADDRESS, NULL, and prog. |
|
|
Get the native address.
Definition at line 127 of file proc.cpp. References address. Referenced by CHLLCode::AddProcStart(), Prog::decodeEverythingUndecoded(), FrontEnd::decodeOnly(), Prog::findContainingProc(), Prog::printCallGraph(), Prog::reDecode(), Prog::remProc(), and ProcTest::testName(). |
|
Get a list of types to cast a given list of actual parameters to.
|
|
|
|
|
Implemented in LibProc, and UserProc. Referenced by CallStatement::getProven(). |
|
|
|
Return true if this procedure doesn't return.
Implemented in LibProc, and UserProc. Referenced by UserProc::initStatements(), and UserProc::isNoReturn(). |
|
Return whether e is preserved by this proc.
|
|
Definition at line 217 of file proc.h. References visited. |
|
Modify actuals so that it is now the list of locations that must be passed to this procedure. The modification will be to either add dummy locations to actuals, delete from actuals, or leave it unchanged. Add "dummy" params: this will be required when there are less live outs at a call site than the number of parameters expected by the procedure called. This will be a result of one of two things: i) a value returned by a preceeding call is used as a parameter and as such is not detected as defined by the procedure. E.g.: foo(bar(x)); Here, the result of bar(x) is used as the first and only parameter to foo. On some architectures (such as SPARC), the location used as the first parameter (e.g. o0) is also the location in which a value is returned. So, the call to bar defines this location implicitly as shown in the following SPARC assembly that may be generated by from the above code: mov x, o0 call bar nop call foo As can be seen, there is no definition of o0 after the call to bar and before the call to foo. Adding the integer return location is therefore a good guess for the dummy location to add (but may occasionally be wrong). ii) uninitialised variables are used as parameters to a call Note that both of these situations can only occur on architectures such as SPARC that use registers for parameter passing. Stack parameters must always be pushed so that the callee doesn't access the caller's non-parameter portion of stack. This used to be a virtual function, implemented differenty for LibProcs and for UserProcs. But in fact, both need the exact same treatment; the only difference is how the local member "parameters" is set (from common.hs in the case of LibProc objects, or from analysis in the case of UserProcs). |
|
Reimplemented in UserProc. |
|
Definition at line 245 of file proc.cpp. References DUMP_XML, Boomerang::get(), Type::getCtype(), getName(), Signature::getNumParams(), Signature::getNumReturns(), Signature::getParamExp(), Signature::getParamName(), Signature::getParamType(), Signature::getReturnExp(), Signature::getReturnType(), and signature. Referenced by UserProc::printXML(). |
|
Definition at line 2333 of file proc.cpp. References callerSet, Signature::findParam(), LOG, Signature::removeParameter(), and signature. Referenced by UserProc::addParameter(). |
|
Reimplemented in UserProc. Definition at line 2345 of file proc.cpp. References Signature::removeReturn(), and signature. |
|
Reimplemented in UserProc. Definition at line 172 of file proc.cpp. References Signature::renameParam(), and signature. Referenced by UserProc::renameParam(). |
|
Definition at line 220 of file proc.h. References cluster. Referenced by Boomerang::objcDecode(). |
|
Definition at line 102 of file proc.h. References m_firstCaller, and NULL. |
|
Gets sets the name of this procedure.
Definition at line 115 of file proc.cpp. References Signature::setName(), and signature. Referenced by Decompiler::renameProc(). |
|
Set the native address.
Definition at line 131 of file proc.cpp. References address. |
|
Definition at line 96 of file proc.h. References prog. |
|
Set an equation as proven. Useful for some sorts of testing.
Definition at line 5301 of file proc.cpp. References Exp::getSubExp1(), Exp::getSubExp2(), Exp::isEquality(), and provenTrue. |
|
Definition at line 108 of file proc.h. References signature. Referenced by Prog::newProc(). |
|
OutPut operator for a Proc object.
|
|
|
|
Persistent state Procedure's address.
Definition at line 238 of file proc.h. Referenced by getNativeAddress(), XMLProgParser::persistToXML(), UserProc::setEntryBB(), and setNativeAddress(). |
|
Set of callers (CallStatements that call this procedure).
Definition at line 252 of file proc.h. Referenced by addCaller(), addCallers(), getCallers(), XMLProgParser::persistToXML(), and removeParameter(). |
|
Cluster this procedure is contained within.
Definition at line 253 of file proc.h. Referenced by getCluster(), XMLProgParser::persistToXML(), UserProc::print(), Proc(), and setCluster(). |
|
first procedure to call this procedure.
Definition at line 239 of file proc.h. Referenced by getFirstCaller(), XMLProgParser::persistToXML(), and setFirstCaller(). |
|
can only be used once.
Definition at line 240 of file proc.h. Referenced by getFirstCaller(), and XMLProgParser::persistToXML(). |
|
Program containing this procedure.
Definition at line 226 of file proc.h. Referenced by UserProc::assignProcsToCalls(), UserProc::decompile(), UserProc::ellipsisProcessing(), UserProc::filterParams(), UserProc::findSpPreservation(), getFirstCaller(), getProg(), UserProc::getRegName(), LibProc::LibProc(), UserProc::mapExpressionsToLocals(), UserProc::printXML(), Proc(), UserProc::processDecodedICTs(), UserProc::processFloatConstants(), UserProc::removeSpAssignsIfPossible(), and setProg(). |
|
Proof the form r28 = r28 + 4 is stored as map from "r28" to "r28+4" (NOTE: no subscripts).
Definition at line 245 of file proc.h. Referenced by UserProc::getProven(), UserProc::isPreserved(), XMLProgParser::persistToXML(), UserProc::prove(), UserProc::removeStatement(), and setProvenTrue(). |
|
Definition at line 250 of file proc.h. Referenced by UserProc::getPremised(), UserProc::killPremise(), and UserProc::setPremise(). |
|
|
For printCallGraphXML.
Definition at line 224 of file proc.h. Referenced by clearVisited(), isVisited(), UserProc::printCallGraphXML(), printCallGraphXML(), and UserProc::removeRedundantParameters(). |