retdec
|
Def-use chains. More...
#include <def_use_analysis.h>
Public Types | |
using | StmtVarPair = std::pair< ShPtr< Statement >, ShPtr< Variable > > |
(statement, variable) pair More... | |
using | StmtVarPairSet = std::set< StmtVarPair > |
Set of (statement, variable) pairs. More... | |
using | NodePairMap = std::map< ShPtr< CFG::Node >, StmtVarPairSet > |
Mapping of a CFG node into a set of (statement, variable) pairs. More... | |
using | DefUseChain = std::vector< std::pair< StmtVarPair, StmtSet > > |
A def-use chain (see [ItC]). More... | |
Public Member Functions | |
void | debugPrint () |
Emits all the live variables info to standard error. More... | |
Public Attributes | |
ShPtr< Function > | func |
Function for which the chains have been computed. More... | |
ShPtr< CFG > | cfg |
CFG of func . More... | |
std::function< bool(ShPtr< Variable >)> | shouldBeIncluded |
DefUseChain | du |
NodePairMap | kill |
NodePairMap | gen |
NodePairMap | in |
NodePairMap | out |
Def-use chains.
See the description of DefUseAnalysis for more info (mainly concerning the book that this implementation is based on: [ItC]).
using retdec::llvmir2hll::DefUseChains::DefUseChain = std::vector<std::pair<StmtVarPair, StmtSet> > |
A def-use chain (see [ItC]).
using retdec::llvmir2hll::DefUseChains::NodePairMap = std::map<ShPtr<CFG::Node>, StmtVarPairSet> |
Mapping of a CFG node into a set of (statement, variable) pairs.
using retdec::llvmir2hll::DefUseChains::StmtVarPair = std::pair<ShPtr<Statement>, ShPtr<Variable> > |
(statement, variable) pair
using retdec::llvmir2hll::DefUseChains::StmtVarPairSet = std::set<StmtVarPair> |
Set of (statement, variable) pairs.
void retdec::llvmir2hll::DefUseChains::debugPrint | ( | ) |
Emits all the live variables info to standard error.
Only for debugging purposes.
DefUseChain retdec::llvmir2hll::DefUseChains::du |
Def-use chain for each statement s
that defines a variable x
(the DU(s, x)
set in [ItC]).
Function for which the chains have been computed.
NodePairMap retdec::llvmir2hll::DefUseChains::gen |
NodePairMap retdec::llvmir2hll::DefUseChains::in |
Mapping of a CFG node B
into the following set:
(The IN
[B] set from Definition 27 in [ItC].)
NodePairMap retdec::llvmir2hll::DefUseChains::kill |
Mapping of a CFG node B
into the following set:
(The KILL
[B] set from Definition 27 in [ItC].)
NodePairMap retdec::llvmir2hll::DefUseChains::out |
Mapping of a CFG node B
into the following set:
(The OUT
[B] set from Definition 27 in [ItC].)
A function that returns whether the given variable should be included in def-use chains.