Public Methods |
| | livenessAnalyzer (bool debug) |
| | Create a liveness analysis object. More...
|
| virtual string | name () |
| | Name of the analysis. More...
|
| void | clear () |
| | Reset liveness information. More...
|
| bool | isLive (stmtNode *stmt) |
| | Is a particular statement live. More...
|
| virtual void | at_index (stmtLocation *current, binaryNode *binary, pointerValue &left, pointerValue &right, pointerValue &result, bool result_is_a_use) |
| virtual void | at_call (stmtLocation *current, callNode *call, pointerValue &call_target, procNode *callee, pointervalue_list &arguments, pointerValue &return_val) |
| virtual void | at_heap (stmtLocation *current, callNode *call, pointervalue_list &arguments, pointerValue &return_val, bool is_alloc) |
| virtual void | at_assignment (stmtLocation *current, binaryNode *binary, pointerValue &left, pointerValue &right, pointerValue &result, bool result_is_a_use, memoryblock_set &changes) |
| virtual void | at_return (stmtLocation *stmt, returnNode *ret, pointerValue &result, pointerValue &return_val) |
| virtual void | at_exprstmt (stmtLocation *stmt, exprstmtNode *es, pointerValue &result) |
| virtual void | at_if (stmtLocation *stmt, ifNode *ifnode, pointerValue &result) |
| virtual void | at_merge (basicblockLocation *where, memoryBlock *block, memoryuse_list &phi_uses, pointerValue &result, memoryblock_set &changes) |
| virtual void | at_stmt_exit (stmtLocation *stmt, pointerValue &result) |
| virtual void | at_basicblock_entry (basicblockLocation *block, procedureInfo *info, pointerValue &initial) |
| virtual void | at_procedure_entry (procLocation *proc, procedureInfo *info, pointerValue &return_val) |
| virtual void | at_procedure_exit (procLocation *proc, procedureInfo *info, pointerValue &return_val) |
Protected Methods |
| void | collectDefs (pointerValue &pointer) |
| | Collect defs. More...
|
| void | addDef (memoryDef *def) |
| | Add one def. More...
|
| bool | determineLiveness () |
| | Determine liveness. More...
|
| bool | isLive (memoryUse *use, memoryBlock *owner) |
| | Look up liveness. More...
|
| void | setLive (stmtLocation *where) |
| | Set live for statements. More...
|
| void | setLive (basicblockLocation *where, memoryBlock *block) |
| | Set live for merge-points. More...
|
Private Types |
| typedef set< stmtNode * > | stmt_liveness_set |
| typedef stmt_liveness_set::iterator | stmt_liveness_set_p |
| typedef set< stmtLocation * > | stmtlocation_liveness_set |
| typedef stmtlocation_liveness_set::iterator | stmtlocation_liveness_set_p |
typedef pair< basicblockLocation *,
memoryBlock * > | mergepoint_pair |
| typedef set< mergepoint_pair > | mergepoint_liveness_set |
| typedef mergepoint_liveness_set::iterator | mergepoint_liveness_set_p |
| typedef list< bool > | change_stack |
Private Attributes |
| stmt_liveness_set | _live_stmts |
| | Live statements. More...
|
| stmtlocation_liveness_set | _live_stmtlocations |
| | Live statement locations. More...
|
| mergepoint_liveness_set | _live_mergepoints |
| | Live merge points. More...
|
| memorydef_set | _defs |
| | Collect defs. More...
|
| bool | _change |
| | Record changes. More...
|
| change_stack | _change_stack |
| | Change stack. More...
|
| bool | _debug |
| | Debug flag. More...
|
Liveness is a property of statements in the program. A statement is live if any of the defs created by the statement are live. A def is live if it has uses, and at least one of it's uses is live. A use is live if the statement in which it occurs is live.