UserProc Class Reference

#include <include/proc.h>

Inheritance diagram for UserProc:

Proc List of all members.

Detailed Description

Definition at line 313 of file proc.h.

Public Types

typedef std::map< Statement *,
int > 
RefCounter
typedef std::multimap< Exp *,
Exp *, lessExpStar
SymbolMap
 A map between machine dependent locations and their corresponding symbolic, machine independent representations.

Public Member Functions

void addCallee (Proc *callee)
 Add to the set of callees.
void addCallees (std::list< UserProc * > &callees)
 Add to a set of callee Procs.
void addImplicitAssigns ()
void addLocal (Type *ty, const char *nam, Exp *e)
 Add a new local supplying all needed information.
void addParameter (Exp *e, Type *ty)
 Add parameter to signature.
void addParameterSymbols ()
void assignProcsToCalls ()
 find the procs the calls point to
void branchAnalysis ()
bool canProveNow ()
 returns true if the prover is working right now
bool canRename (Exp *e)
void castConst (int num, Type *ty)
 Cast the constant whose conscript is num to be type ty.
bool checkForGainfulUse (Exp *e, ProcSet &visited)
 Reurn true if location e is used gainfully in this procedure.
void checkLocalFor (RefExp *r)
void clearRanges ()
void clearUses ()
 Clear the useCollectors (in this Proc, and all calls).
void complete ()
 All the decompile stuff except propagation, DFA repair, and null/unused statement removal.
bool containsAddr (ADDRESS uAddr)
 return true if this procedure contains the given address.
void conTypeAnalysis ()
void countRefs (RefCounter &refCounts)
ProcSetdecompile (ProcList *path, int &indent)
 Begin the decompile process at this procedure.
void deleteCFG ()
 Deletes the whole CFG and all the RTLs and Exps associated with it.
void dfaTypeAnalysis ()
bool doesParamChainToCall (Exp *param, UserProc *p, ProcSet *visited)
bool doesRecurseTo (UserProc *p)
bool doRenameBlockVars (int pass, bool clearStacks=false)
void dump ()
void dumpLocals ()
void dumpLocals (std::ostream &os, bool html=false)
void dumpSymbolMap ()
 For debugging.
void dumpSymbolMapx ()
 For debugging.
void earlyDecompile ()
 Early decompile: Place phi functions, number statements, first rename, propagation: ready for preserveds.
void eliminateDuplicateArgs ()
bool ellipsisProcessing ()
 Trim parameters to procedure calls with ellipsis (.
bool existsLocal (char *name)
 True if a local exists with name name.
ExpexpFromSymbol (const char *nam)
 return a symbol's exp (note: the original exp, like r24, not local1)
bool filterParams (Exp *e)
 As above but for parameters and arguments.
bool filterReturns (Exp *e)
 Decide whether to filter out e (return true) or keep it.
void finalSimplify ()
 perform final simplifications
void findFinalParameters ()
char * findFirstSymbol (Exp *e)
void findLiveAtDomPhi (LocationSet &usedByDomPhi)
char * findLocal (Exp *e, Type *ty)
 Determine whether e is a local, either as a true opLocal (e.g.
char * findLocalFromRef (RefExp *r)
void findPhiUnites (ConnectionGraph &pu)
void findPreserveds ()
 Was trimReturns().
void findSpPreservation ()
 Preservations only for the stack pointer.
void fixCallAndPhiRefs ()
 Perform call and phi statement bypassing at all depths.
void fixCallAndPhiRefs (int d)
 Perform call and phi statement bypassing at depth d.
void fixRefs (int n, int depth, std::map< Exp *, Exp *, lessExpStar > &pres, StatementList &removes)
 Helper function for fixCallAndPhiRefs.
void fixUglyBranches ()
void fromSSAform ()
void generateCode (HLLCode *hll)
 code generation
SyntaxNodegetAST ()
 Returns an abstract syntax tree for the procedure in the internal representation.
std::list< Proc * > & getCallees ()
 Get the callees.
CfggetCFG ()
 Returns a pointer to the CFG object.
DataFlowgetDataFlow ()
 Returns a pointer to the DataFlow object.
void getDefinitions (LocationSet &defs)
PBB getEntryBB ()
 Get the BB that is the entry point (not always the first BB).
const char * getLocalName (int n)
TypegetLocalType (const char *nam)
 return a local's type
StatementListgetModifieds ()
int getNumLocals ()
StatementListgetParameters ()
TypegetParamType (const char *nam)
virtual ExpgetPremised (Exp *left)
virtual ExpgetProven (Exp *left)
char * getRegName (Exp *r)
void getStatements (StatementList &stmts)
 get all the statements
ProcStatus getStatus ()
StatementgetStmtAtLex (unsigned int begin, unsigned int end)
ExpgetSymbolExp (Exp *le, Type *ty=NULL, bool lastPass=false)
 Return an expression that is equivilent to e in terms of local variables.
ExpgetSymbolFor (Exp *e, Type *ty)
 Lookup the expression in the symbol map.
char * getSymbolName (Exp *e)
 As getLocalName, but look for expression e.
ADDRESS getTheReturnAddr ()
ReturnStatementgetTheReturnStatement ()
TypegetTypeForLocation (Exp *e)
bool inductivePreservation (UserProc *topOfCycle)
void initialiseDecompile ()
 Initialise decompile: sort CFG, number statements, dominator tree, etc.
void initialParameters ()
 Get initial parameters based on proc's use collector.
void initStatements ()
 Initialise the statements, e.g. proc, bb pointers.
void insertAssignAfter (Statement *s, Exp *left, Exp *right)
void insertCasts ()
 Inserting casts as needed (for this procedure).
void insertParameter (Exp *e, Type *ty)
 Insert into parameters list correctly sorted.
void insertStatementAfter (Statement *s, Statement *a)
bool isAddressEscapedVar (Exp *e)
bool isDecoded ()
 Returns whether or not this procedure can be decoded (i.e.
bool isDecompiled ()
bool isEarlyRecursive ()
bool isLocal (Exp *e)
 True if e represents a stack local variable.
bool isLocalOrParam (Exp *e)
 True if e represents a stack local or stack param.
bool isLocalOrParamPattern (Exp *e)
 True if e could represent a stack local or stack param.
virtual bool isNoReturn ()
 Return true if this procedure doesn't return.
virtual bool isPreserved (Exp *e)
 Return whether e is preserved by this proc.
bool isPropagatable (Exp *e)
 True if e can be propagated.
bool isRetNonFakeUsed (CallStatement *c, Exp *loc, UserProc *p, ProcSet *visited)
bool isSorted ()
void killPremise (Exp *e)
void logSuspectMemoryDefs ()
char * lookupParam (Exp *e)
char * lookupSym (Exp *e, Type *ty)
 Lookup the symbol map considering type.
char * lookupSymFromRef (RefExp *r)
char * lookupSymFromRefAny (RefExp *r)
void makeParamsImplicit ()
void makeSymbolsImplicit ()
void mapExpressionsToLocals (bool lastPass=false)
void mapLocalsAndParams ()
 Map expressions to locals and initial parameters.
void mapParameters ()
void mapSymbolTo (Exp *from, Exp *to)
void mapSymbolToRepl (Exp *from, Exp *oldTo, Exp *newTo)
 As above but with replacement.
void mapTempsToLocals ()
void markAsNonChildless (ProcSet *cs)
ProcSetmiddleDecompile (ProcList *path, int indent)
 Middle decompile: All the decompilation from preservation up to but not including removing unused statements.
void nameParameterPhis ()
bool nameStackLocations ()
ExpnewLocal (Type *ty, Exp *e, char *nam=NULL)
 Return the next available local variable; make it the given type.
char * newLocalName (Exp *e)
int nextParamNum ()
void numberStatements ()
void placePhiFunctions ()
void prePresDecompile ()
 Prepare for preservation analysis only.
void print (std::ostream &out, bool html=false)
 print this proc, mainly for debugging
void printAnalysedXML ()
void printAST (SyntaxNode *a=NULL)
virtual void printCallGraphXML (std::ostream &os, int depth, bool recurse=true)
void printDecodedXML ()
void printDFG ()
void printLocalsAsC (std::ostream &os)
 Print the locals declaration in C style.
void printParams (std::ostream &out, bool html=false)
char * prints ()
void printSSAXML ()
void printSymbolMap (std::ostream &out, bool html=false)
 Print just the symbol map.
void printToLog ()
void printUseGraph ()
void printXML ()
void processDecodedICTs ()
 Copy the decoded indirect control transfer instructions' RTLs to the front end's map, and decode any new targets for this CFG.
void processFloatConstants ()
void promoteSignature ()
 promote the signature if possible
bool propagateAndRemoveStatements ()
bool propagateStatements (bool &convert, int pass)
 Propagate statemtents; return true if change; set convert if an indirect call is converted to direct (else clear).
void propagateToCollector ()
bool prove (Exp *query, bool conditional=false)
 prove any arbitary property of this procedure.
bool prover (Exp *query, std::set< PhiAssign * > &lastPhis, std::map< PhiAssign *, Exp * > &cache, Exp *original, PhiAssign *lastPhi=NULL)
 helper function, should be private
void rangeAnalysis ()
void recursionGroupAnalysis (ProcList *path, int indent)
 Analyse the whole group of procedures for conditional preserveds, and update till no change.
void removeCallLiveness ()
bool removeDeadStatements ()
void removeMatchingAssignsIfPossible (Exp *e)
bool removeNullStatements ()
bool removeRedundantParameters ()
void removeRedundantPhis ()
bool removeRedundantReturns (std::set< UserProc * > &removeRetSet)
 Remove any returns that are not used by any callers return true if any returns are removed.
virtual void removeReturn (Exp *e)
void removeSpAssignsIfPossible ()
void removeStatement (Statement *stmt)
 remove a statement
void removeSubscriptsFromParameters ()
void removeSubscriptsFromSymbols ()
void removeSymbolMapping (Exp *from, Exp *to)
void removeUnusedLocals ()
void remUnusedStmtEtc (RefCounter &refCounts)
void remUnusedStmtEtc ()
 Remove unused statements.
void renameLocal (const char *oldName, const char *newName)
virtual void renameParam (const char *oldName, const char *newName)
void reverseStrengthReduction ()
bool searchAll (Exp *search, std::list< Exp * > &result)
bool searchAndReplace (Exp *search, Exp *replace)
void setDecoded ()
 Records that this procedure has been decoded.
void setDominanceNumbers ()
void setEntryBB ()
 Set the entry BB for this procedure (constructor has the entry address).
void setExpSymbol (const char *nam, Exp *e, Type *ty)
void setImplicitRef (Statement *s, Exp *a, Type *ty)
 Find and if necessary insert an implicit reference before s whose address expression is a and type is t.
void setLocalType (const char *nam, Type *ty)
void setParamType (int idx, Type *ty)
void setParamType (const char *nam, Type *ty)
 Get a name like eax or o2 from r24 or r8.
void setPremise (Exp *e)
void setSorted ()
void setStatus (ProcStatus s)
void setTheReturnAddr (ReturnStatement *s, ADDRESS r)
void simplify ()
 simplify the statements in this proc
void testSymbolMap ()
 For debugging.
void toSymbolic (TypedExp *loc, TypedExp *result, bool local=true)
 Given a machine dependent location, return a generated symbolic representation for it.
void trimParameters (int depth=-1)
 Trim parameters. If depth not given or == -1, perform at all depths.
void typeAnalysis ()
 Global type analysis (for this procedure).
void unDecode ()
 Removes the decoded bit and throws away all the current information about this procedure.
void undoComputedBB (Statement *stmt)
 Change BB containing this statement from a COMPCALL to a CALL.
void updateArguments ()
 Update the arguments in calls.
void updateCallDefines ()
 Update the defines in calls.
void updateCalls ()
void updateForUseChange (std::set< UserProc * > &removeRetSet)
 Update parameters and call livenesses to take into account the changes causes by removing a return from this procedure, or a callee's parameter (which affects this procedure's arguments, which are also uses).
void updateReturnTypes ()
void useBeforeDefine (Exp *loc)
 Add a location to the UseCollector; this means this location is used before defined, and hence is an initial* parameter.
 UserProc (Prog *prog, std::string &name, ADDRESS address)
void windowsModeDecompile ()
virtual ~UserProc ()

Protected Member Functions

void setCFG (Cfg *c)
 UserProc ()

Private Member Functions

void addToStackMap (int c, Type *ty)
 function to do safe adding.
void checkMemSize (Exp *e)
 Implement the above for one given Exp*.
void checkMemSizes ()
 A special pass to check the sizes of memory that is about to be converted into a var, ensuring that the largest size used in the proc is used for all references (and it's declared that size).
Exp ** findVarEntry (int idx)
 Find a pointer to the Exp* representing the given var Used by the above 2.
void searchRegularLocals (OPER minusOrPlus, bool lastPass, int sp, StatementList &stmts)

Private Attributes

LocationSet addressEscapedVars
 The set of address-escaped locals and parameters.
std::list< Proc * > calleeList
 Set of callees (Procedures that this procedure calls).
Cfgcfg
 The control flow graph.
UseCollector col
 A collector for initial parameters (locations used before being defined).
ProcSetcycleGrp
 Pointer to a set of procedures involved in a recursion group.
DataFlow df
 DataFlow object.
int DFGcount
std::map< std::string, Type * > locals
DataIntervalMap localTable
 The local "symbol table", which is aware of overlaps.
int nextLocal
int nextParam
StatementList parameters
 The list of parameters, ordered and filtered.
std::map< int, Type * > stackMap
 A map of stack locations (negative values) to types.
ProcStatus status
 The status of this user procedure.
int stmtNumber
 Current statement number.
SymbolMap symbolMap
ReturnStatementtheReturnStatement
 We ensure that there is only one return statement now.

Friends

class XMLProgParser


Member Typedef Documentation

typedef std::map<Statement*, int> UserProc::RefCounter
 

Definition at line 596 of file proc.h.

typedef std::multimap<Exp*,Exp*,lessExpStar> UserProc::SymbolMap
 

A map between machine dependent locations and their corresponding symbolic, machine independent representations.

Example: m[r28{0} - 8] -> local5; this means that *after* transforming out of SSA form, any locations not specifically mapped otherwise (e.g. m[r28{0} - 8]{55} -> local6) will get this name. It is a *multi*map because one location can have several default names differentiated by type. E.g. r24 -> eax for int, r24 -> eax_1 for float

Definition at line 348 of file proc.h.


Constructor & Destructor Documentation

UserProc::UserProc Prog prog,
std::string &  name,
ADDRESS  address
 

Definition at line 426 of file proc.cpp.

References cfg, localTable, DataIntervalMap::setProc(), and Cfg::setProc().

UserProc::~UserProc  )  [virtual]
 

Definition at line 438 of file proc.cpp.

References cfg.

UserProc::UserProc  )  [protected]
 

Definition at line 420 of file proc.cpp.

References localTable, and DataIntervalMap::setProc().


Member Function Documentation

void UserProc::addCallee Proc callee  ) 
 

Add to the set of callees.

Definition at line 599 of file proc.cpp.

References calleeList.

Referenced by addCallees(), and CallStatement::rangeAnalysis().

void UserProc::addCallees std::list< UserProc * > &  callees  ) 
 

Add to a set of callee Procs.

Definition at line 3728 of file proc.cpp.

References addCallee(), and calleeList.

void UserProc::addImplicitAssigns  ) 
 

Definition at line 3913 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), StatementList::begin(), cfg, StatementList::end(), Boomerang::get(), and getStatements().

Referenced by typeAnalysis().

void UserProc::addLocal Type ty,
const char *  nam,
Exp e
 

Add a new local supplying all needed information.

Definition at line 2777 of file proc.cpp.

References Location::local(), locals, and mapSymbolTo().

Referenced by checkLocalFor().

void UserProc::addParameter Exp e,
Type ty
 

Add parameter to signature.

Definition at line 2351 of file proc.cpp.

References Signature::addParameter(), Proc::removeParameter(), and Proc::signature.

void UserProc::addParameterSymbols  ) 
 

Definition at line 2393 of file proc.cpp.

References StatementList::begin(), cfg, StatementList::end(), Signature::getParamName(), mapSymbolTo(), Location::param(), parameters, Proc::signature, and to.

Referenced by remUnusedStmtEtc().

void UserProc::addToStackMap int  c,
Type ty
[private]
 

function to do safe adding.

void UserProc::assignProcsToCalls  ) 
 

find the procs the calls point to

Definition at line 2055 of file proc.cpp.

References cfg, Prog::findProc(), CallStatement::getDestProc(), Cfg::getFirstBB(), GotoStatement::getFixedDest(), Cfg::getNextBB(), BasicBlock::getRTLs(), GotoStatement::isComputed(), NULL, Proc::prog, and CallStatement::setDestProc().

Referenced by Prog::finishDecode().

void UserProc::branchAnalysis  ) 
 

Definition at line 1751 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), StatementList::begin(), cfg, StatementList::end(), Boomerang::get(), getStatements(), opAnd, opNot, Cfg::removeBB(), and Exp::simplify().

Referenced by remUnusedStmtEtc().

bool UserProc::canProveNow  ) 
 

returns true if the prover is working right now

bool UserProc::canRename Exp e  )  [inline]
 

Definition at line 535 of file proc.h.

References DataFlow::canRename(), and df.

Referenced by CallStatement::updateArguments().

void UserProc::castConst int  num,
Type ty
 

Cast the constant whose conscript is num to be type ty.

Definition at line 3881 of file proc.cpp.

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

bool UserProc::checkForGainfulUse Exp e,
ProcSet visited
 

Reurn true if location e is used gainfully in this procedure.

visited is a set of UserProcs already visited.

Definition at line 4686 of file proc.cpp.

References Exp::addUsedLocs(), StatementList::begin(), checkForGainfulUse(), doesRecurseTo(), StatementList::end(), LocationSet::existsImplicit(), getStatements(), Statement::isCall(), and Proc::isLib().

Referenced by checkForGainfulUse(), and removeRedundantParameters().

void UserProc::checkLocalFor RefExp r  ) 
 

Definition at line 5452 of file proc.cpp.

References addLocal(), existsLocal(), RefExp::getDef(), getRegName(), Unary::getSubExp1(), Statement::getTypeFor(), Exp::isRegOf(), lookupSymFromRefAny(), and newLocalName().

Referenced by ExpRegMapper::visit().

void UserProc::checkMemSize Exp e  )  [private]
 

Implement the above for one given Exp*.

void UserProc::checkMemSizes  )  [private]
 

A special pass to check the sizes of memory that is about to be converted into a var, ensuring that the largest size used in the proc is used for all references (and it's declared that size).

void UserProc::clearRanges  ) 
 

Definition at line 5056 of file proc.cpp.

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

Referenced by rangeAnalysis().

void UserProc::clearUses  ) 
 

Clear the useCollectors (in this Proc, and all calls).

Definition at line 5000 of file proc.cpp.

References Cfg::begin(), cfg, UseCollector::clear(), col, Cfg::end(), Proc::getName(), LOG, and NULL.

void UserProc::complete  ) 
 

All the decompile stuff except propagation, DFA repair, and null/unused statement removal.

Todo:
Check if this function is used, and remove it if it isn't

bool UserProc::containsAddr ADDRESS  uAddr  ) 
 

return true if this procedure contains the given address.

Definition at line 164 of file proc.cpp.

References cfg, Cfg::getFirstBB(), and Cfg::getNextBB().

Referenced by Prog::findContainingProc().

void UserProc::conTypeAnalysis  ) 
 

Definition at line 3739 of file proc.cpp.

References Constraints::addConstraints(), StatementList::begin(), LocationSet::clear(), StatementList::end(), Proc::getName(), getStatements(), and LOG.

void UserProc::countRefs RefCounter refCounts  ) 
 

Definition at line 2892 of file proc.cpp.

References LocationSet::begin(), StatementList::begin(), DEBUG_UNUSED, LocationSet::end(), StatementList::end(), RefExp::getDef(), getStatements(), Statement::isImplicit(), and LOG.

Referenced by remUnusedStmtEtc().

ProcSet * UserProc::decompile ProcList path,
int &  indent
 

Begin the decompile process at this procedure.

path is a list of pointers to procedures, representing the path from the current entry point to the current procedure in the call graph. Pass an empty set at the top level. indent is the indentation level; pass 0 at the top level

Definition at line 953 of file proc.cpp.

References Boomerang::alert_considering(), CALL, cfg, child(), Boomerang::get(), Cfg::getFirstBB(), BasicBlock::getLowAddr(), Proc::getName(), Cfg::getNextBB(), BasicBlock::getRTLs(), BasicBlock::getType(), LOG, NULL, PROC_DECODED, PROC_EARLYDONE, PROC_FINAL, PROC_VISITED, Proc::prog, Prog::reDecode(), setStatus(), status, and VERBOSE.

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

void UserProc::deleteCFG  ) 
 

Deletes the whole CFG and all the RTLs and Exps associated with it.

Also nulls the internal cfg pointer (to prevent strange errors)

Definition at line 450 of file proc.cpp.

References cfg, and NULL.

Referenced by Prog::remProc().

void UserProc::dfaTypeAnalysis  ) 
 

Definition at line 73 of file dfa.cpp.

References Boomerang::alert_decompile_debug_point(), StatementList::begin(), cfg, DEBUG_TA, DFA_ITER_LIMIT, Signature::dfaTypeAnalysis(), StatementList::end(), Boomerang::get(), getStatements(), LOG, and Proc::signature.

Referenced by typeAnalysis().

bool UserProc::doesParamChainToCall Exp param,
UserProc p,
ProcSet visited
 

Definition at line 4593 of file proc.cpp.

References StatementList::begin(), Cfg::begin(), cfg, StatementList::end(), Cfg::end(), Exp::getSubExp1(), Proc::isLib(), and NULL.

bool UserProc::doesRecurseTo UserProc p  )  [inline]
 

Definition at line 460 of file proc.h.

References cycleGrp.

Referenced by checkForGainfulUse().

bool UserProc::doRenameBlockVars int  pass,
bool  clearStacks = false
 

Definition at line 1856 of file proc.cpp.

References df, Proc::getName(), LOG, DataFlow::renameBlockVars(), and VERBOSE.

Referenced by earlyDecompile(), middleDecompile(), remUnusedStmtEtc(), and typeAnalysis().

void UserProc::dump  ) 
 

Definition at line 713 of file proc.cpp.

References print().

void UserProc::dumpLocals  ) 
 

Definition at line 4060 of file proc.cpp.

Referenced by print().

void UserProc::dumpLocals std::ostream &  os,
bool  html = false
 

Definition at line 4003 of file proc.cpp.

References expFromSymbol(), and locals.

void UserProc::dumpSymbolMap  ) 
 

For debugging.

Definition at line 4021 of file proc.cpp.

References getTypeForLocation(), and symbolMap.

void UserProc::dumpSymbolMapx  ) 
 

For debugging.

Definition at line 4030 of file proc.cpp.

References getTypeForLocation(), and symbolMap.

void UserProc::earlyDecompile  ) 
 

Early decompile: Place phi functions, number statements, first rename, propagation: ready for preserveds.

Definition at line 1160 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), df, doRenameBlockVars(), Boomerang::get(), Proc::getName(), LOG, numberStatements(), DataFlow::placePhiFunctions(), printToLog(), PROC_EARLYDONE, propagateStatements(), status, updateCallDefines(), and VERBOSE.

void UserProc::eliminateDuplicateArgs  ) 
 

Definition at line 5248 of file proc.cpp.

References Cfg::begin(), cfg, Cfg::end(), Proc::getName(), LOG, and NULL.

bool UserProc::ellipsisProcessing  ) 
 

Trim parameters to procedure calls with ellipsis (.

..). Also add types for ellipsis parameters, if any Returns true if any signature types so added.

Definition at line 3892 of file proc.cpp.

References Cfg::begin(), cfg, Cfg::end(), NULL, and Proc::prog.

Referenced by typeAnalysis().

bool UserProc::existsLocal char *  name  ) 
 

True if a local exists with name name.

Definition at line 5447 of file proc.cpp.

References locals.

Referenced by checkLocalFor().

Exp * UserProc::expFromSymbol const char *  nam  ) 
 

return a symbol's exp (note: the original exp, like r24, not local1)

Definition at line 2863 of file proc.cpp.

References symbolMap.

Referenced by CHLLCode::AddLocal(), dumpLocals(), StatementList::findOnLeft(), and renameLocal().

bool UserProc::filterParams Exp e  ) 
 

As above but for parameters and arguments.

Definition at line 4217 of file proc.cpp.

References addr(), Exp::getOper(), Signature::getStackRegister(), opMemOf, opPC, opRegOf, Proc::prog, and Proc::signature.

Referenced by insertParameter(), and CallStatement::updateArguments().

bool UserProc::filterReturns Exp e  ) 
 

Decide whether to filter out e (return true) or keep it.

Definition at line 4191 of file proc.cpp.

References Exp::getOper(), isPreserved(), opCF, opFlags, opGlobal, opMemOf, opPC, and opZF.

Referenced by ReturnStatement::updateReturns().

void UserProc::finalSimplify  ) 
 

perform final simplifications

Definition at line 2089 of file proc.cpp.

References cfg, Cfg::getFirstBB(), Cfg::getNextBB(), BasicBlock::getRTLs(), NULL, and BasicBlock::simplify().

Referenced by Prog::finishDecode().

void UserProc::findFinalParameters  ) 
 

Definition at line 2127 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), LocationSet::begin(), cfg, StatementList::clear(), Exp::clone(), LocationSet::end(), Boomerang::get(), Signature::getNumParams(), Signature::getParamExp(), Signature::isForced(), NULL, parameters, and Proc::signature.

Referenced by remUnusedStmtEtc().

char * UserProc::findFirstSymbol Exp e  ) 
 

Definition at line 4276 of file proc.cpp.

References NULL, and symbolMap.

Referenced by nameParameterPhis(), DfaLocalMapper::preVisit(), ComplexityFinder::visit(), and UsedLocalFinder::visit().

void UserProc::findLiveAtDomPhi LocationSet usedByDomPhi  ) 
 

Definition at line 5344 of file proc.cpp.

References df, DataFlow::findLiveAtDomPhi(), NULL, and LocationSet::remove().

Referenced by propagateStatements().

char * UserProc::findLocal Exp e,
Type ty
 

Determine whether e is a local, either as a true opLocal (e.g.

generated by fromSSA), or if it is in the symbol map and the name is in the locals map. If it is a local, return its name, else NULL

Definition at line 4248 of file proc.cpp.

References Exp::isLocal(), locals, lookupSym(), and NULL.

Referenced by CallStatement::calcResults(), and UsedLocalFinder::visit().

char * UserProc::findLocalFromRef RefExp r  ) 
 

Definition at line 4262 of file proc.cpp.

References RefExp::getDef(), Unary::getSubExp1(), Statement::getTypeFor(), locals, lookupSym(), and NULL.

void UserProc::findPhiUnites ConnectionGraph pu  ) 
 

Definition at line 5371 of file proc.cpp.

References PhiAssign::begin(), StatementList::begin(), ConnectionGraph::connect(), PhiAssign::end(), StatementList::end(), Assignment::getLeft(), getStatements(), Statement::isPhi(), and NULL.

void UserProc::findPreserveds  ) 
 

Was trimReturns().

Definition at line 1897 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), StatementList::begin(), DEBUG_PROOF, StatementList::end(), Boomerang::get(), ReturnStatement::getModifieds(), Proc::getName(), LOG, NULL, opEquals, prove(), theReturnStatement, and VERBOSE.

Referenced by middleDecompile().

void UserProc::findSpPreservation  ) 
 

Preservations only for the stack pointer.

Definition at line 1865 of file proc.cpp.

References DEBUG_PROOF, Proc::getName(), Signature::getStackRegister(), LOG, opEquals, opPlus, Proc::prog, prove(), Location::regOf(), Proc::signature, sp, and VERBOSE.

Referenced by middleDecompile().

Exp** UserProc::findVarEntry int  idx  )  [private]
 

Find a pointer to the Exp* representing the given var Used by the above 2.

void UserProc::fixCallAndPhiRefs  ) 
 

Perform call and phi statement bypassing at all depths.

Definition at line 4311 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), StatementList::begin(), Exp::clone(), StatementList::end(), Boomerang::get(), CallStatement::getArguments(), Proc::getName(), Exp::getOper(), Signature::getStackRegister(), getStatements(), Exp::getSubExp1(), Exp::getSubExp2(), Exp::isIntConst(), Exp::isRegN(), Exp::isSubscript(), LOG, Location::memOf(), NULL, and Proc::signature.

Referenced by middleDecompile().

void UserProc::fixCallAndPhiRefs int  d  ) 
 

Perform call and phi statement bypassing at depth d.

void UserProc::fixRefs int  n,
int  depth,
std::map< Exp *, Exp *, lessExpStar > &  pres,
StatementList removes
 

Helper function for fixCallAndPhiRefs.

void UserProc::fixUglyBranches  ) 
 

Definition at line 1815 of file proc.cpp.

References StatementList::begin(), StatementList::end(), Proc::getName(), getStatements(), LOG, opGtrEq, opMinus, and VERBOSE.

Referenced by remUnusedStmtEtc().

void UserProc::fromSSAform  ) 
 

Definition at line 3031 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), Boomerang::alert_decompiling(), StatementList::begin(), cfg, StatementList::end(), Boomerang::get(), Proc::getName(), Cfg::getNumBBs(), getStatements(), and LOG.

void UserProc::generateCode HLLCode hll  ) 
 

code generation

Definition at line 609 of file proc.cpp.

References HLLCode::AddLocal(), HLLCode::AddProcStart(), cfg, Boomerang::get(), getEntryBB(), locals, NULL, printToLog(), removeUnusedLocals(), Cfg::structure(), and VERBOSE.

SyntaxNode * UserProc::getAST  ) 
 

Returns an abstract syntax tree for the procedure in the internal representation.

This function actually _calculates_ * this value and is expected to do so expensively.

Definition at line 463 of file proc.cpp.

References BlockSyntaxNode::addStatement(), cfg, Cfg::getFirstBB(), and Cfg::getNextBB().

Referenced by printAST().

std::list<Proc*>& UserProc::getCallees  )  [inline]
 

Get the callees.

Definition at line 793 of file proc.h.

References calleeList.

Referenced by Prog::printCallGraph().

Cfg * UserProc::getCFG  )  [inline]
 

Returns a pointer to the CFG object.

Definition at line 431 of file proc.h.

References cfg.

Referenced by case_CALL_NCT(), SparcFrontEnd::case_DD(), FrontEnd::createReturnBlock(), Prog::generateDotFile(), CallStatement::makeArgAssign(), DataFlow::placePhiFunctions(), SparcFrontEnd::processProc(), PentiumFrontEnd::processProc(), FrontEnd::processProc(), PentiumFrontEnd::processStringInst(), BasicBlock::processSwitch(), CallingConvention::StdC::PentiumSignature::qualified(), StatementTest::testBypass(), FrontSparcTest::testDelaySlot(), CfgTest::testDominators(), StatementTest::testEmpty(), StatementTest::testEndlessLoop(), StatementTest::testFlow(), StatementTest::testKill(), CfgTest::testPlacePhi(), CfgTest::testPlacePhi2(), StatementTest::testRecursion(), CfgTest::testRenameVars(), CfgTest::testSemiDominators(), StatementTest::testUse(), StatementTest::testUseKill(), StatementTest::testUseOverBB(), and StatementTest::testUseOverKill().

DataFlow* UserProc::getDataFlow  )  [inline]
 

Returns a pointer to the DataFlow object.

Definition at line 436 of file proc.h.

References df.

Referenced by StatementTest::testBypass(), CfgTest::testDominators(), CfgTest::testPlacePhi(), CfgTest::testPlacePhi2(), CfgTest::testRenameVars(), and CfgTest::testSemiDominators().

void UserProc::getDefinitions LocationSet defs  ) 
 

Definition at line 3713 of file proc.cpp.

References Signature::getNumReturns(), Signature::getReturnExp(), LocationSet::insert(), and Proc::signature.

PBB UserProc::getEntryBB  ) 
 

Get the BB that is the entry point (not always the first BB).

Definition at line 573 of file proc.cpp.

References cfg, and Cfg::getEntryBB().

Referenced by generateCode(), and PentiumFrontEnd::processProc().

const char * UserProc::getLocalName int  n  ) 
 

Definition at line 2873 of file proc.cpp.

References locals, and NULL.

Type * UserProc::getLocalType const char *  nam  ) 
 

return a local's type

Definition at line 2786 of file proc.cpp.

References locals, and NULL.

Referenced by getSymbolFor(), lookupSym(), and StmtSsaXformer::visit().

StatementList& UserProc::getModifieds  )  [inline]
 

Definition at line 685 of file proc.h.

References ReturnStatement::getModifieds(), and theReturnStatement.

int UserProc::getNumLocals  )  [inline]
 

Definition at line 760 of file proc.h.

References locals.

StatementList& UserProc::getParameters  )  [inline]
 

Definition at line 684 of file proc.h.

References parameters.

Type * UserProc::getParamType const char *  nam  ) 
 

Definition at line 2801 of file proc.cpp.

References Signature::getNumParams(), Signature::getParamName(), Signature::getParamType(), NULL, and Proc::signature.

Referenced by getSymbolFor(), and lookupSym().

Exp * UserProc::getPremised Exp left  )  [virtual]
 

Implements Proc.

Definition at line 3870 of file proc.cpp.

References NULL, and Proc::recurPremises.

Exp * UserProc::getProven Exp left  )  [virtual]
 

Implements Proc.

Definition at line 3859 of file proc.cpp.

References NULL, and Proc::provenTrue.

Referenced by mapExpressionsToLocals(), and CallingConvention::Win32Signature::qualified().

char * UserProc::getRegName Exp r  ) 
 

Definition at line 5389 of file proc.cpp.

References Prog::getRegName(), Exp::isRegOf(), and Proc::prog.

Referenced by checkLocalFor(), and newLocalName().

void UserProc::getStatements StatementList stmts  ) 
 

get all the statements

Definition at line 802 of file proc.cpp.

References cfg, Cfg::getFirstBB(), Cfg::getNextBB(), and NULL.

Referenced by addImplicitAssigns(), Boomerang::alert_decompile_debug_point(), branchAnalysis(), castConst(), checkForGainfulUse(), clearRanges(), conTypeAnalysis(), countRefs(), dfaTypeAnalysis(), findPhiUnites(), fixCallAndPhiRefs(), fixUglyBranches(), fromSSAform(), getStmtAtLex(), isRetNonFakeUsed(), logSuspectMemoryDefs(), mapExpressionsToLocals(), mapLocalsAndParams(), mapTempsToLocals(), nameParameterPhis(), printDFG(), printUseGraph(), processFloatConstants(), PentiumFrontEnd::processOverlapped(), propagateStatements(), removeMatchingAssignsIfPossible(), removeNullStatements(), removeSpAssignsIfPossible(), Prog::removeUnusedGlobals(), removeUnusedLocals(), remUnusedStmtEtc(), reverseStrengthReduction(), searchAndReplace(), StatementTest::testBypass(), and updateCallDefines().

ProcStatus UserProc::getStatus  )  [inline]
 

Definition at line 465 of file proc.h.

References status.

Referenced by Decompiler::procStatus().

Statement * UserProc::getStmtAtLex unsigned int  begin,
unsigned int  end
 

Definition at line 2724 of file proc.cpp.

References StatementList::begin(), StatementList::end(), Statement::getLexBegin(), getStatements(), and NULL.

Referenced by Prog::getStmtAtLex().

Exp * UserProc::getSymbolExp Exp le,
Type ty = NULL,
bool  lastPass = false
 

Return an expression that is equivilent to e in terms of local variables.

Creates new locals as needed.

Definition at line 2407 of file proc.cpp.

References Exp::getOper(), Signature::getStackRegister(), Exp::getSubExp1(), Exp::getSubExp2(), Exp::isIntConst(), Exp::isMemOf(), Exp::isRegN(), Exp::isSubscript(), locals, LOG, m, Location::memOf(), NULL, opAddrOf, opMinus, opPlus, Proc::signature, and symbolMap.

Referenced by DfaLocalMapper::processExp(), searchRegularLocals(), and TempToLocalMapper::visit().

Exp * UserProc::getSymbolFor Exp e,
Type ty
 

Lookup the expression in the symbol map.

Return NULL or a C string with the symbol. Use the Type* ty to select from several names in the multimap; the name corresponding to the first compatible type is returned

Definition at line 2834 of file proc.cpp.

References getLocalType(), getParamType(), Type::isCompatibleWith(), NULL, and symbolMap.

Referenced by renameLocal().

char * UserProc::getSymbolName Exp e  ) 
 

As getLocalName, but look for expression e.

Definition at line 2881 of file proc.cpp.

References Exp::getSubExp1(), Exp::isLocal(), Exp::isParam(), NULL, and symbolMap.

ADDRESS UserProc::getTheReturnAddr  )  [inline]
 

Definition at line 857 of file proc.h.

References ReturnStatement::getRetAddr(), NO_ADDRESS, NULL, and theReturnStatement.

Referenced by FrontEnd::createReturnBlock().

ReturnStatement* UserProc::getTheReturnStatement  )  [inline]
 

Definition at line 863 of file proc.h.

References theReturnStatement.

Referenced by CHLLCode::AddProcDec().

Type * UserProc::getTypeForLocation Exp e  ) 
 

Definition at line 5397 of file proc.cpp.

References Exp::isLocal(), and locals.

Referenced by dumpSymbolMap(), dumpSymbolMapx(), and printSymbolMap().

bool UserProc::inductivePreservation UserProc topOfCycle  ) 
 

Definition at line 4541 of file proc.cpp.

void UserProc::initialiseDecompile  ) 
 

Initialise decompile: sort CFG, number statements, dominator tree, etc.

Definition at line 1116 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), Boomerang::alert_start_decompile(), cfg, df, DataFlow::dominators(), Boomerang::get(), Proc::getName(), initStatements(), LOG, numberStatements(), printToLog(), printXML(), PROC_FINAL, setStatus(), Cfg::sortByAddress(), stmtNumber, and VERBOSE.

void UserProc::initialParameters  ) 
 

Get initial parameters based on proc's use collector.

Definition at line 4527 of file proc.cpp.

References StatementList::append(), UseCollector::begin(), StatementList::clear(), col, UseCollector::end(), Proc::getName(), LOG, parameters, and printParams().

void UserProc::initStatements  ) 
 

Initialise the statements, e.g. proc, bb pointers.

Definition at line 766 of file proc.cpp.

References cfg, CallStatement::getDestProc(), Cfg::getExitBB(), Cfg::getFirstBB(), Cfg::getNextBB(), BasicBlock::getNumInEdges(), Proc::isNoReturn(), and CallStatement::setSigArguments().

Referenced by initialiseDecompile(), and StatementTest::testBypass().

void UserProc::insertAssignAfter Statement s,
Exp left,
Exp right
 

Definition at line 854 of file proc.cpp.

References cfg, Statement::getBB(), Cfg::getEntryBB(), BasicBlock::getRTLs(), NULL, and Statement::setProc().

void UserProc::insertCasts  ) 
 

Inserting casts as needed (for this procedure).

void UserProc::insertParameter Exp e,
Type ty
 

Insert into parameters list correctly sorted.

Definition at line 4155 of file proc.cpp.

References Signature::argumentCompare(), StatementList::begin(), Exp::clone(), Type::clone(), StatementList::end(), filterParams(), StatementList::insert(), parameters, and Proc::signature.

void UserProc::insertStatementAfter Statement s,
Statement a
 

Definition at line 881 of file proc.cpp.

References Cfg::begin(), cfg, Cfg::end(), BasicBlock::getRTLs(), and NULL.

bool UserProc::isAddressEscapedVar Exp e  )  [inline]
 

Definition at line 579 of file proc.h.

References addressEscapedVars, and LocationSet::exists().

Referenced by DataFlow::canRename().

bool UserProc::isDecoded  )  [inline]
 

Returns whether or not this procedure can be decoded (i.e.

has it already been decoded).

Definition at line 457 of file proc.h.

References PROC_DECODED, and status.

Referenced by Prog::decodeEverythingUndecoded(), Prog::finishDecode(), Prog::generateDotFile(), Prog::generateRTL(), Prog::getStmtAtLex(), and Prog::print().

bool UserProc::isDecompiled  )  [inline]
 

Definition at line 458 of file proc.h.

References PROC_FINAL, and status.

bool UserProc::isEarlyRecursive  )  [inline]
 

Definition at line 459 of file proc.h.

References cycleGrp, NULL, PROC_INCYCLE, and status.

bool UserProc::isLocal Exp e  ) 
 

True if e represents a stack local variable.

Definition at line 4547 of file proc.cpp.

References Exp::isLocal(), Exp::isMemOf(), and symbolMap.

Referenced by isLocalOrParam().

bool UserProc::isLocalOrParam Exp e  ) 
 

True if e represents a stack local or stack param.

Definition at line 4560 of file proc.cpp.

References StatementList::existsOnLeft(), isLocal(), and parameters.

Referenced by isPropagatable().

bool UserProc::isLocalOrParamPattern Exp e  ) 
 

True if e could represent a stack local or stack param.

Definition at line 4566 of file proc.cpp.

References addr(), Signature::getStackRegister(), Exp::getSubExp2(), Exp::isIntConst(), Exp::isMemOf(), Signature::isPromoted(), NULL, Location::regOf(), and Proc::signature.

Referenced by DataFlow::canRename(), DfaLocalMapper::processExp(), and ExpRegMapper::visit().

bool UserProc::isNoReturn  )  [virtual]
 

Return true if this procedure doesn't return.

Implements Proc.

Definition at line 140 of file proc.cpp.

References cfg, CallStatement::getDestProc(), Cfg::getExitBB(), BasicBlock::getInEdges(), BasicBlock::getNumInEdges(), Proc::isNoReturn(), and NULL.

bool UserProc::isPreserved Exp e  )  [virtual]
 

Return whether e is preserved by this proc.

Implements Proc.

Definition at line 3877 of file proc.cpp.

References Proc::provenTrue.

Referenced by filterReturns().

bool UserProc::isPropagatable Exp e  ) 
 

True if e can be propagated.

Definition at line 4555 of file proc.cpp.

References addressEscapedVars, LocationSet::exists(), and isLocalOrParam().

bool UserProc::isRetNonFakeUsed CallStatement c,
Exp loc,
UserProc p,
ProcSet visited
 

Definition at line 4633 of file proc.cpp.

References LocationSet::begin(), StatementList::begin(), LocationSet::end(), StatementList::end(), getStatements(), and Exp::getSubExp1().

bool UserProc::isSorted  )  [inline]
 

Definition at line 462 of file proc.h.

References PROC_SORTED, and status.

void UserProc::killPremise Exp e  )  [inline]
 

Definition at line 826 of file proc.h.

References Proc::recurPremises.

void UserProc::logSuspectMemoryDefs  ) 
 

Definition at line 5137 of file proc.cpp.

References StatementList::begin(), StatementList::end(), getStatements(), LOG, and opInitValueOf.

char * UserProc::lookupParam Exp e  ) 
 

Definition at line 3933 of file proc.cpp.

References cfg, Cfg::findTheImplicitAssign(), Statement::getTypeFor(), LOG, lookupSym(), and NULL.

Referenced by mapParameters().

char * UserProc::lookupSym Exp e,
Type ty
 

Lookup the symbol map considering type.

Definition at line 3962 of file proc.cpp.

References getLocalType(), getParamType(), Exp::getSubExp1(), Type::isCompatibleWith(), Exp::isTypedExp(), NULL, and symbolMap.

Referenced by CHLLCode::appendExp(), findLocal(), findLocalFromRef(), isBareMemof(), lookupParam(), lookupSymFromRef(), lookupSymFromRefAny(), nameParameterPhis(), BadMemofFinder::visit(), and UsedLocalFinder::visit().

char * UserProc::lookupSymFromRef RefExp r  ) 
 

Definition at line 3945 of file proc.cpp.

References RefExp::getDef(), Unary::getSubExp1(), Statement::getTypeFor(), and lookupSym().

char * UserProc::lookupSymFromRefAny RefExp r  ) 
 

Definition at line 3952 of file proc.cpp.

References RefExp::getDef(), Unary::getSubExp1(), Statement::getTypeFor(), and lookupSym().

Referenced by checkLocalFor(), StmtSsaXformer::commonLhs(), ExpSsaXformer::postVisit(), and StmtSsaXformer::visit().

void UserProc::makeParamsImplicit  ) 
 

Definition at line 5334 of file proc.cpp.

References Exp::accept(), StatementList::begin(), cfg, StatementList::end(), and parameters.

void UserProc::makeSymbolsImplicit  ) 
 

Definition at line 5323 of file proc.cpp.

References cfg, mapSymbolTo(), and symbolMap.

void UserProc::mapExpressionsToLocals bool  lastPass = false  ) 
 

Definition at line 2495 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), Type::asArray(), Type::asPointer(), StatementList::begin(), ArrayType::clone(), Exp::clone(), StatementList::end(), Boomerang::get(), Proc::getName(), PointerType::getPointsTo(), getProven(), Signature::getStackRegister(), getStatements(), Exp::getSubExp1(), Exp::isAddrOf(), Signature::isAddrOfStackLocal(), Type::isInteger(), Exp::isMemOf(), Exp::isSubscript(), ArrayType::isUnbounded(), LOG, NULL, Proc::prog, Location::regOf(), Type::resolvesToArray(), Type::resolvesToPointer(), Proc::signature, and sp.

void UserProc::mapLocalsAndParams  ) 
 

Map expressions to locals and initial parameters.

Definition at line 5308 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), StatementList::begin(), Statement::dfaMapLocals(), StatementList::end(), Boomerang::get(), Proc::getName(), getStatements(), and LOG.

void UserProc::mapParameters  ) 
 

Definition at line 3325 of file proc.cpp.

References StatementList::begin(), Exp::clone(), StatementList::end(), LOG, lookupParam(), NULL, Location::param(), parameters, and Exp::removeSubscripts().

void UserProc::mapSymbolTo Exp from,
Exp to
 

Definition at line 2820 of file proc.cpp.

References symbolMap, and to.

Referenced by addLocal(), addParameterSymbols(), makeSymbolsImplicit(), mapSymbolToRepl(), and setExpSymbol().

void UserProc::mapSymbolToRepl Exp from,
Exp oldTo,
Exp newTo
 

As above but with replacement.

Definition at line 2815 of file proc.cpp.

References mapSymbolTo(), and removeSymbolMapping().

Referenced by renameLocal().

void UserProc::mapTempsToLocals  ) 
 

Definition at line 5274 of file proc.cpp.

References PhiAssign::accept(), StatementList::begin(), StatementList::end(), and getStatements().

void UserProc::markAsNonChildless ProcSet cs  ) 
 

Definition at line 4474 of file proc.cpp.

References cfg, Cfg::getFirstBB(), BasicBlock::getLastStmt(), and Cfg::getNextBB().

ProcSet * UserProc::middleDecompile ProcList path,
int  indent
 

Middle decompile: All the decompilation from preservation up to but not including removing unused statements.

Returns the cycle set from the recursive call to decompile()

Definition at line 1208 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), Boomerang::alert_decompile_SSADepth(), df, doRenameBlockVars(), findPreserveds(), findSpPreservation(), fixCallAndPhiRefs(), Boomerang::get(), Proc::getName(), LOG, numberStatements(), DataFlow::placePhiFunctions(), printDFG(), printToLog(), printXML(), PROC_INCYCLE, promoteSignature(), propagateStatements(), reverseStrengthReduction(), status, theReturnStatement, updateArguments(), updateCallDefines(), ReturnStatement::updateModifieds(), ReturnStatement::updateReturns(), and VERBOSE.

void UserProc::nameParameterPhis  ) 
 

Definition at line 5413 of file proc.cpp.

References PhiAssign::begin(), StatementList::begin(), PhiAssign::end(), StatementList::end(), findFirstSymbol(), Assignment::getLeft(), getStatements(), TypingStatement::getType(), Statement::isPhi(), lookupSym(), and NULL.

bool UserProc::nameStackLocations  ) 
 

Exp * UserProc::newLocal Type ty,
Exp e,
char *  nam = NULL
 

Return the next available local variable; make it the given type.

Note: was returning TypedExp*. If nam is non null, use that name

Definition at line 2761 of file proc.cpp.

References Type::getCtype(), Location::local(), locals, LOG, newLocalName(), and NULL.

char * UserProc::newLocalName Exp e  ) 
 

Definition at line 2745 of file proc.cpp.

References getRegName(), Exp::isSubscript(), and locals.

Referenced by checkLocalFor(), and newLocal().

int UserProc::nextParamNum  )  [inline]
 

Definition at line 562 of file proc.h.

References nextParam.

void UserProc::numberStatements  ) 
 

Definition at line 788 of file proc.cpp.

References cfg, Cfg::getFirstBB(), Cfg::getNextBB(), and stmtNumber.

Referenced by earlyDecompile(), initialiseDecompile(), middleDecompile(), remUnusedStmtEtc(), StatementTest::testBypass(), and CfgTest::testRenameVars().

void UserProc::placePhiFunctions  )  [inline]
 

Definition at line 529 of file proc.h.

References df, and DataFlow::placePhiFunctions().

void UserProc::prePresDecompile  ) 
 

Prepare for preservation analysis only.

void UserProc::print std::ostream &  out,
bool  html = false
 

print this proc, mainly for debugging

Definition at line 654 of file proc.cpp.

References cfg, Proc::cluster, col, dumpLocals(), Cluster::getName(), Cfg::print(), UseCollector::print(), Signature::print(), printParams(), printSymbolMap(), and Proc::signature.

Referenced by Boomerang::alert_decompile_debug_point(), dump(), Prog::generateRTL(), Decompiler::getRtlForProc(), Prog::print(), printAnalysedXML(), printDecodedXML(), prints(), printSSAXML(), and printToLog().

void UserProc::printAnalysedXML  ) 
 

Definition at line 278 of file proc.cpp.

References DUMP_XML, escapeXMLChars(), Boomerang::get(), Proc::getName(), and print().

void UserProc::printAST SyntaxNode a = NULL  ) 
 

Definition at line 531 of file proc.cpp.

References SyntaxNode::evaluate(), getAST(), Proc::getName(), NULL, and SyntaxNode::printAST().

void UserProc::printCallGraphXML std::ostream &  os,
int  depth,
bool  recurse = true
[virtual]
 

Reimplemented from Proc.

Definition at line 226 of file proc.cpp.

References calleeList, DUMP_XML, Proc::getName(), and Proc::visited.

void UserProc::printDecodedXML  ) 
 

Definition at line 261 of file proc.cpp.

References DUMP_XML, escapeXMLChars(), Boomerang::get(), Proc::getName(), and print().

Referenced by setDecoded().

void UserProc::printDFG  ) 
 

Definition at line 723 of file proc.cpp.

References LocationSet::begin(), StatementList::begin(), DFGcount, LocationSet::end(), StatementList::end(), Boomerang::get(), Proc::getName(), getStatements(), LOG, and VERBOSE.

Referenced by middleDecompile().

void UserProc::printLocalsAsC std::ostream &  os  ) 
 

Print the locals declaration in C style.

void UserProc::printParams std::ostream &  out,
bool  html = false
 

Definition at line 687 of file proc.cpp.

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

Referenced by initialParameters(), and print().

char * UserProc::prints  ) 
 

Definition at line 705 of file proc.cpp.

References debug_buffer, DEBUG_BUFSIZE, and print().

void UserProc::printSSAXML  ) 
 

Definition at line 295 of file proc.cpp.

References DUMP_XML, escapeXMLChars(), Boomerang::get(), Proc::getName(), and print().

Referenced by printXML().

void UserProc::printSymbolMap std::ostream &  out,
bool  html = false
 

Print just the symbol map.

Definition at line 3987 of file proc.cpp.

References getTypeForLocation(), and symbolMap.

Referenced by print().

void UserProc::printToLog  ) 
 

Definition at line 717 of file proc.cpp.

References LOG, and print().

Referenced by earlyDecompile(), generateCode(), initialiseDecompile(), middleDecompile(), rangeAnalysis(), remUnusedStmtEtc(), and updateCalls().

void UserProc::printUseGraph  ) 
 

Definition at line 323 of file proc.cpp.

References LocationSet::begin(), StatementList::begin(), LocationSet::end(), StatementList::end(), Boomerang::get(), RefExp::getDef(), Proc::getName(), Statement::getNumber(), and getStatements().

Referenced by printXML().

void UserProc::printXML  ) 
 

Definition at line 313 of file proc.cpp.

References DUMP_XML, Prog::printCallGraphXML(), Proc::printDetailsXML(), printSSAXML(), printUseGraph(), and Proc::prog.

Referenced by initialiseDecompile(), middleDecompile(), remUnusedStmtEtc(), and typeAnalysis().

void UserProc::processDecodedICTs  ) 
 

Copy the decoded indirect control transfer instructions' RTLs to the front end's map, and decode any new targets for this CFG.

Definition at line 5166 of file proc.cpp.

References Prog::addDecodedRtl(), cfg, DEBUG_SWITCH, Cfg::getFirstBB(), BasicBlock::getHiAddr(), BasicBlock::getLastRtl(), BasicBlock::getLastStmt(), Cfg::getNextBB(), LOG, NULL, and Proc::prog.

void UserProc::processFloatConstants  ) 
 

Definition at line 2358 of file proc.cpp.

References StatementList::begin(), StatementList::end(), Prog::getFloatConstant(), getStatements(), LOG, Location::memOf(), opFsize, opIntConst, opMemOf, opWild, and Proc::prog.

void UserProc::promoteSignature  ) 
 

promote the signature if possible

Definition at line 2740 of file proc.cpp.

References Signature::promote(), and Proc::signature.

Referenced by middleDecompile(), and StatementTest::testBypass().

bool UserProc::propagateAndRemoveStatements  ) 
 

bool UserProc::propagateStatements bool &  convert,
int  pass
 

Propagate statemtents; return true if change; set convert if an indirect call is converted to direct (else clear).

Definition at line 2680 of file proc.cpp.

References Assign::accept(), StatementList::begin(), StatementList::end(), findLiveAtDomPhi(), getStatements(), and LOG.

Referenced by earlyDecompile(), middleDecompile(), remUnusedStmtEtc(), typeAnalysis(), and CallStatement::updateArguments().

void UserProc::propagateToCollector  ) 
 

Definition at line 4489 of file proc.cpp.

References UseCollector::begin(), col, and UseCollector::end().

bool UserProc::prove Exp query,
bool  conditional = false
 

prove any arbitary property of this procedure.

If conditional is true, do not save the result, as it may be conditional on premises stored in other procedures

Definition at line 3380 of file proc.cpp.

References DEBUG_PROOF, Proc::getName(), Exp::isEquality(), LOG, and Proc::provenTrue.

Referenced by findPreserveds(), and findSpPreservation().

bool UserProc::prover Exp query,
std::set< PhiAssign * > &  lastPhis,
std::map< PhiAssign *, Exp * > &  cache,
Exp original,
PhiAssign lastPhi = NULL
 

helper function, should be private

Definition at line 3463 of file proc.cpp.

References Exp::clone(), PhiAssign::end(), Exp::getSubExp2(), and LOG.

void UserProc::rangeAnalysis  ) 
 

Definition at line 5065 of file proc.cpp.

References Cfg::addJunctionStatements(), cfg, clearRanges(), Cfg::establishDFTOrder(), Cfg::getEntryBB(), BasicBlock::getFirstStmt(), Proc::getName(), LOG, NULL, printToLog(), and Cfg::sortByAddress().

void UserProc::recursionGroupAnalysis ProcList path,
int  indent
 

Analyse the whole group of procedures for conditional preserveds, and update till no change.

Also finalise the whole group.

Definition at line 1670 of file proc.cpp.

References Boomerang::alert_decompiling(), cycleGrp, Boomerang::get(), LOG, PROC_INCYCLE, and VERBOSE.

void UserProc::removeCallLiveness  ) 
 

Definition at line 5261 of file proc.cpp.

References Cfg::begin(), cfg, Cfg::end(), Proc::getName(), LOG, and NULL.

bool UserProc::removeDeadStatements  ) 
 

void UserProc::removeMatchingAssignsIfPossible Exp e  ) 
 

Definition at line 1993 of file proc.cpp.

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

bool UserProc::removeNullStatements  ) 
 

Definition at line 2657 of file proc.cpp.

References StatementList::begin(), StatementList::end(), Statement::getNumber(), getStatements(), Statement::isNullStatement(), LOG, and removeStatement().

Referenced by remUnusedStmtEtc().

bool UserProc::removeRedundantParameters  ) 
 

Definition at line 4754 of file proc.cpp.

References Exp::accept(), Boomerang::alert_decompile_debug_point(), StatementList::append(), StatementList::begin(), cfg, checkForGainfulUse(), DEBUG_UNUSED, StatementList::end(), Exp::expSubscriptAllNull(), Boomerang::get(), Proc::getName(), Exp::getSubExp1(), Signature::isForced(), Exp::isSubscript(), LOG, parameters, Cfg::removeImplicitAssign(), Signature::removeParameter(), Proc::signature, symbolMap, and Proc::visited.

Referenced by removeRedundantReturns().

void UserProc::removeRedundantPhis  ) 
 

bool UserProc::removeRedundantReturns std::set< UserProc * > &  removeRetSet  ) 
 

Remove any returns that are not used by any callers return true if any returns are removed.

Definition at line 4819 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), Boomerang::alert_decompiling(), DEBUG_UNUSED, Boomerang::get(), Proc::getName(), Signature::getNumReturns(), Signature::getReturnExp(), Signature::isForced(), LOG, NULL, removeRedundantParameters(), and Proc::signature.

void UserProc::removeReturn Exp e  )  [virtual]
 

Reimplemented from Proc.

Definition at line 2328 of file proc.cpp.

References ReturnStatement::removeReturn(), and theReturnStatement.

void UserProc::removeSpAssignsIfPossible  ) 
 

Definition at line 1951 of file proc.cpp.

References LocationSet::begin(), StatementList::begin(), LocationSet::end(), StatementList::end(), Signature::getStackRegister(), getStatements(), Proc::prog, Location::regOf(), Proc::signature, and sp.

void UserProc::removeStatement Statement stmt  ) 
 

remove a statement

Definition at line 814 of file proc.cpp.

References Proc::provenTrue.

Referenced by Cfg::removeImplicitAssign(), and removeNullStatements().

void UserProc::removeSubscriptsFromParameters  ) 
 

Definition at line 3364 of file proc.cpp.

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

void UserProc::removeSubscriptsFromSymbols  ) 
 

Definition at line 3343 of file proc.cpp.

References symbolMap.

void UserProc::removeSymbolMapping Exp from,
Exp to
 

Definition at line 2849 of file proc.cpp.

References symbolMap, and to.

Referenced by mapSymbolToRepl().

void UserProc::removeUnusedLocals  ) 
 

Definition at line 2931 of file proc.cpp.

References Statement::addUsedLocals(), Boomerang::alert_decompile_debug_point(), LocationSet::begin(), StatementList::begin(), DEBUG_UNUSED, Assignment::definesLoc(), LocationSet::end(), StatementList::end(), Boomerang::get(), Proc::getName(), getStatements(), Statement::isCall(), Statement::isReturn(), and LOG.

Referenced by generateCode().

void UserProc::remUnusedStmtEtc RefCounter refCounts  ) 
 

Definition at line 1590 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), StatementList::begin(), StatementList::end(), Boomerang::get(), Assignment::getLeft(), Exp::getOper(), getStatements(), and opGlobal.

void UserProc::remUnusedStmtEtc  ) 
 

Remove unused statements.

Definition at line 1489 of file proc.cpp.

References addParameterSymbols(), Boomerang::alert_decompile_afterRemoveStmts(), Boomerang::alert_decompile_debug_point(), Boomerang::alert_decompiling(), branchAnalysis(), countRefs(), df, doRenameBlockVars(), findFinalParameters(), fixUglyBranches(), Boomerang::get(), Proc::getName(), LOG, numberStatements(), DataFlow::placePhiFunctions(), printToLog(), printXML(), PROC_FINAL, PROC_INCYCLE, propagateStatements(), removeNullStatements(), status, typeAnalysis(), updateCalls(), and VERBOSE.

void UserProc::renameLocal const char *  oldName,
const char *  newName
 

Definition at line 200 of file proc.cpp.

References cfg, expFromSymbol(), getSymbolFor(), Location::local(), locals, mapSymbolToRepl(), and Cfg::searchAndReplace().

void UserProc::renameParam const char *  oldName,
const char *  newName
[virtual]
 

Reimplemented from Proc.

Definition at line 176 of file proc.cpp.

References Proc::renameParam().

void UserProc::reverseStrengthReduction  ) 
 

Definition at line 4103 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), StatementList::begin(), StatementList::end(), Boomerang::get(), RefExp::getDef(), getStatements(), Exp::getSubExp1(), Exp::isIntConst(), Statement::isPhi(), opMult, and tmp.

Referenced by middleDecompile().

bool UserProc::searchAll Exp search,
std::list< Exp * > &  result
 

Definition at line 211 of file proc.cpp.

References cfg, and Cfg::searchAll().

bool UserProc::searchAndReplace Exp search,
Exp replace
 

Definition at line 3841 of file proc.cpp.

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

void UserProc::searchRegularLocals OPER  minusOrPlus,
bool  lastPass,
int  sp,
StatementList stmts
[private]
 

Definition at line 2624 of file proc.cpp.

References StatementList::begin(), StatementList::end(), getSymbolExp(), Assignment::getTypeFor(), LOG, Location::memOf(), NULL, opWildIntConst, Location::regOf(), result, and Assign::searchAll().

void UserProc::setCFG Cfg c  )  [inline, protected]
 

Definition at line 873 of file proc.h.

References cfg.

void UserProc::setDecoded  ) 
 

Records that this procedure has been decoded.

Definition at line 551 of file proc.cpp.

References printDecodedXML(), PROC_DECODED, and setStatus().

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

void UserProc::setDominanceNumbers  ) 
 

void UserProc::setEntryBB  ) 
 

Set the entry BB for this procedure (constructor has the entry address).

Definition at line 583 of file proc.cpp.

References Proc::address, cfg, Cfg::getFirstBB(), BasicBlock::getLowAddr(), and Cfg::getNextBB().

Referenced by ST20FrontEnd::processProc(), PPCFrontEnd::processProc(), and PentiumFrontEnd::processProc().

void UserProc::setExpSymbol const char *  nam,
Exp e,
Type ty
 

Definition at line 2809 of file proc.cpp.

References Location::local(), and mapSymbolTo().

void UserProc::setImplicitRef Statement s,
Exp a,
Type ty
 

Find and if necessary insert an implicit reference before s whose address expression is a and type is t.

Definition at line 5185 of file proc.cpp.

References StatementList::begin(), StatementList::end(), Statement::getBB(), and BasicBlock::getRTLs().

Referenced by Binary::descendType().

void UserProc::setLocalType const char *  nam,
Type ty
 

Definition at line 2794 of file proc.cpp.

References Type::getCtype(), locals, and LOG.

Referenced by StmtSsaXformer::visit().

void UserProc::setParamType int  idx,
Type ty
 

Definition at line 187 of file proc.cpp.

References StatementList::begin(), StatementList::end(), parameters, Signature::setParamType(), and Proc::signature.

void UserProc::setParamType const char *  nam,
Type ty
 

Get a name like eax or o2 from r24 or r8.

Definition at line 183 of file proc.cpp.

References Signature::setParamType(), and Proc::signature.

void UserProc::setPremise Exp e  )  [inline]
 

Definition at line 825 of file proc.h.

References Exp::clone(), and Proc::recurPremises.

void UserProc::setSorted  )  [inline]
 

Definition at line 463 of file proc.h.

References PROC_SORTED, and setStatus().

void UserProc::setStatus ProcStatus  s  ) 
 

Definition at line 681 of file proc.cpp.

References Boomerang::alert_proc_status_change(), Boomerang::get(), and status.

Referenced by decompile(), initialiseDecompile(), setDecoded(), setSorted(), and unDecode().

void UserProc::setTheReturnAddr ReturnStatement s,
ADDRESS  r
[inline]
 

Definition at line 859 of file proc.h.

References NULL, ReturnStatement::setRetAddr(), and theReturnStatement.

Referenced by FrontEnd::createReturnBlock().

void UserProc::simplify  )  [inline]
 

simplify the statements in this proc

Definition at line 486 of file proc.h.

References cfg, and Cfg::simplify().

Referenced by typeAnalysis().

void UserProc::testSymbolMap  ) 
 

For debugging.

Definition at line 4040 of file proc.cpp.

References symbolMap.

void UserProc::toSymbolic TypedExp loc,
TypedExp result,
bool  local = true
 

Given a machine dependent location, return a generated symbolic representation for it.

void UserProc::trimParameters int  depth = -1  ) 
 

Trim parameters. If depth not given or == -1, perform at all depths.

void UserProc::typeAnalysis  ) 
 

Global type analysis (for this procedure).

Definition at line 5014 of file proc.cpp.

References addImplicitAssigns(), CON_TYPE_ANALYSIS, DFA_TYPE_ANALYSIS, dfaTypeAnalysis(), doRenameBlockVars(), ellipsisProcessing(), Proc::getName(), LOG, printXML(), propagateStatements(), and simplify().

Referenced by remUnusedStmtEtc().

void UserProc::unDecode  ) 
 

Removes the decoded bit and throws away all the current information about this procedure.

Definition at line 562 of file proc.cpp.

References cfg, Cfg::clear(), PROC_UNDECODED, and setStatus().

void UserProc::undoComputedBB Statement stmt  )  [inline]
 

Change BB containing this statement from a COMPCALL to a CALL.

Definition at line 813 of file proc.h.

References cfg, and Cfg::undoComputedBB().

Referenced by CallStatement::rangeAnalysis().

void UserProc::updateArguments  ) 
 

Update the arguments in calls.

Definition at line 4066 of file proc.cpp.

References Boomerang::alert_decompile_debug_point(), Boomerang::alert_decompiling(), Cfg::begin(), cfg, Cfg::end(), Boomerang::get(), Proc::getName(), LOG, NULL, and Const::print().

Referenced by middleDecompile(), and updateCalls().

void UserProc::updateCallDefines  ) 
 

Update the defines in calls.

Definition at line 4090 of file proc.cpp.

References StatementList::begin(), StatementList::end(), Proc::getName(), getStatements(), LOG, NULL, and CallStatement::updateDefines().

Referenced by earlyDecompile(), middleDecompile(), and updateCalls().

void UserProc::updateCalls  ) 
 

Definition at line 1739 of file proc.cpp.

References Proc::getName(), LOG, printToLog(), updateArguments(), updateCallDefines(), and VERBOSE.

Referenced by remUnusedStmtEtc().

void UserProc::updateForUseChange std::set< UserProc * > &  removeRetSet  ) 
 

Update parameters and call livenesses to take into account the changes causes by removing a return from this procedure, or a callee's parameter (which affects this procedure's arguments, which are also uses).

Definition at line 4939 of file proc.cpp.

References cfg, DEBUG_UNUSED, Cfg::getFirstBB(), BasicBlock::getLastStmt(), Proc::getName(), Cfg::getNextBB(), Proc::isLib(), LOG, NULL, and parameters.

void UserProc::updateReturnTypes  ) 
 

void UserProc::useBeforeDefine Exp loc  )  [inline]
 

Add a location to the UseCollector; this means this location is used before defined, and hence is an initial* parameter.

Note that final parameters don't use this information; it's only for handling recursion.

Definition at line 845 of file proc.h.

References col, and UseCollector::insert().

void UserProc::windowsModeDecompile  ) 
 


Friends And Related Function Documentation

friend class XMLProgParser [friend]
 

Reimplemented from Proc.

Definition at line 871 of file proc.h.


Member Data Documentation

LocationSet UserProc::addressEscapedVars [private]
 

The set of address-escaped locals and parameters.

If in this list, they should not be propagated

Definition at line 382 of file proc.h.

Referenced by isAddressEscapedVar(), and isPropagatable().

std::list<Proc*> UserProc::calleeList [private]
 

Set of callees (Procedures that this procedure calls).

Used for call graph, among other things

Definition at line 360 of file proc.h.

Referenced by addCallee(), addCallees(), getCallees(), and printCallGraphXML().

Cfg* UserProc::cfg [private]
 

The control flow graph.

Definition at line 318 of file proc.h.

Referenced by addImplicitAssigns(), addParameterSymbols(), assignProcsToCalls(), branchAnalysis(), clearUses(), containsAddr(), decompile(), deleteCFG(), dfaTypeAnalysis(), doesParamChainToCall(), eliminateDuplicateArgs(), ellipsisProcessing(), finalSimplify(), findFinalParameters(), fromSSAform(), generateCode(), getAST(), getCFG(), getEntryBB(), getStatements(), initialiseDecompile(), initStatements(), insertAssignAfter(), insertStatementAfter(), isNoReturn(), lookupParam(), makeParamsImplicit(), makeSymbolsImplicit(), markAsNonChildless(), numberStatements(), print(), processDecodedICTs(), rangeAnalysis(), removeCallLiveness(), removeRedundantParameters(), renameLocal(), searchAll(), setCFG(), setEntryBB(), simplify(), unDecode(), undoComputedBB(), updateArguments(), updateForUseChange(), UserProc(), and ~UserProc().

UseCollector UserProc::col [private]
 

A collector for initial parameters (locations used before being defined).

Note that final parameters don't use this; it's only of use during group decompilation analysis (sorting out recursion)

Definition at line 366 of file proc.h.

Referenced by clearUses(), initialParameters(), print(), propagateToCollector(), and useBeforeDefine().

ProcSet* UserProc::cycleGrp [private]
 

Pointer to a set of procedures involved in a recursion group.

NOTE: Each procedure in the cycle points to the same set! However, there can be several separate cycles. E.g. in test/source/recursion.c, there is a cycle with f and g, while another is being built up (it only has c, d, and e at the point where the f-g cycle is found).

Definition at line 402 of file proc.h.

Referenced by doesRecurseTo(), isEarlyRecursive(), and recursionGroupAnalysis().

DataFlow UserProc::df [private]
 

DataFlow object.

Holds information relevant to transforming to and from SSA form.

Definition at line 389 of file proc.h.

Referenced by canRename(), doRenameBlockVars(), earlyDecompile(), findLiveAtDomPhi(), getDataFlow(), initialiseDecompile(), middleDecompile(), placePhiFunctions(), and remUnusedStmtEtc().

int UserProc::DFGcount [private]
 

Definition at line 855 of file proc.h.

Referenced by printDFG().

std::map<std::string, Type*> UserProc::locals [private]
 

Definition at line 334 of file proc.h.

Referenced by addLocal(), dumpLocals(), existsLocal(), findLocal(), findLocalFromRef(), generateCode(), getLocalName(), getLocalType(), getNumLocals(), getSymbolExp(), getTypeForLocation(), newLocal(), newLocalName(), renameLocal(), and setLocalType().

DataIntervalMap UserProc::localTable [private]
 

The local "symbol table", which is aware of overlaps.

Definition at line 355 of file proc.h.

Referenced by UserProc().

int UserProc::nextLocal [private]
 

Definition at line 336 of file proc.h.

int UserProc::nextParam [private]
 

Definition at line 337 of file proc.h.

Referenced by nextParamNum().

StatementList UserProc::parameters [private]
 

The list of parameters, ordered and filtered.

Note that a LocationList could be used, but then there would be nowhere to store the types (for DFA based TA) The RHS is just ignored; the list is of ImplicitAssigns. DESIGN ISSUE: it would be nice for the parameters' implicit assignments to be the sole definitions, i.e. not need other implicit assignments for these. But the targets of RefExp's are not expected to change address, so they are not suitable at present (since the addresses regularly get changed as the parameters get recreated).

Definition at line 377 of file proc.h.

Referenced by addParameterSymbols(), findFinalParameters(), getParameters(), initialParameters(), insertParameter(), isLocalOrParam(), makeParamsImplicit(), mapParameters(), printParams(), removeRedundantParameters(), removeSubscriptsFromParameters(), setParamType(), and updateForUseChange().

std::map<int, Type *> UserProc::stackMap [private]
 

A map of stack locations (negative values) to types.

This is currently PENTIUM specific and is computed from range information.

Definition at line 408 of file proc.h.

ProcStatus UserProc::status [private]
 

The status of this user procedure.

Status: undecoded .. final decompiled

Definition at line 324 of file proc.h.

Referenced by decompile(), earlyDecompile(), getStatus(), isDecoded(), isDecompiled(), isEarlyRecursive(), isSorted(), middleDecompile(), XMLProgParser::persistToXML(), remUnusedStmtEtc(), and setStatus().

int UserProc::stmtNumber [private]
 

Current statement number.

Makes it easier to split decompile() into smaller pieces.

Definition at line 394 of file proc.h.

Referenced by initialiseDecompile(), and numberStatements().

SymbolMap UserProc::symbolMap [private]
 

Definition at line 350 of file proc.h.

Referenced by dumpSymbolMap(), dumpSymbolMapx(), expFromSymbol(), findFirstSymbol(), getSymbolExp(), getSymbolFor(), getSymbolName(), isLocal(), lookupSym(), makeSymbolsImplicit(), mapSymbolTo(), printSymbolMap(), removeRedundantParameters(), removeSubscriptsFromSymbols(), removeSymbolMapping(), and testSymbolMap().

ReturnStatement* UserProc::theReturnStatement [private]
 

We ensure that there is only one return statement now.

See code in frontend/frontend.cpp handling case STMT_RET. If no return statement, this will be NULL.

Definition at line 854 of file proc.h.

Referenced by findPreserveds(), getModifieds(), getTheReturnAddr(), getTheReturnStatement(), middleDecompile(), XMLProgParser::persistToXML(), removeReturn(), and setTheReturnAddr().


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