retdec
Public Types | Public Member Functions | Public Attributes | List of all members
retdec::llvmir2hll::DefUseChains Class Reference

Def-use chains. More...

#include <def_use_analysis.h>

Collaboration diagram for retdec::llvmir2hll::DefUseChains:
Collaboration graph
[legend]

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< Functionfunc
 Function for which the chains have been computed. More...
 
ShPtr< CFGcfg
 CFG of func. More...
 
std::function< bool(ShPtr< Variable >)> shouldBeIncluded
 
DefUseChain du
 
NodePairMap kill
 
NodePairMap gen
 
NodePairMap in
 
NodePairMap out
 

Detailed Description

Def-use chains.

See the description of DefUseAnalysis for more info (mainly concerning the book that this implementation is based on: [ItC]).

Member Typedef Documentation

◆ DefUseChain

A def-use chain (see [ItC]).

◆ NodePairMap

Mapping of a CFG node into a set of (statement, variable) pairs.

◆ StmtVarPair

(statement, variable) pair

◆ StmtVarPairSet

Set of (statement, variable) pairs.

Member Function Documentation

◆ debugPrint()

void retdec::llvmir2hll::DefUseChains::debugPrint ( )

Emits all the live variables info to standard error.

Only for debugging purposes.

Member Data Documentation

◆ cfg

ShPtr<CFG> retdec::llvmir2hll::DefUseChains::cfg

CFG of func.

◆ du

DefUseChain retdec::llvmir2hll::DefUseChains::du

Def-use chain for each statement s that defines a variable x (the DU(s, x) set in [ItC]).

◆ func

ShPtr<Function> retdec::llvmir2hll::DefUseChains::func

Function for which the chains have been computed.

◆ gen

NodePairMap retdec::llvmir2hll::DefUseChains::gen

Mapping of a CFG node B into the following set:

{(s, x) | s \in B uses x and x is not defined prior to s in B}
NodePairMap in
Definition: def_use_analysis.h:88

(The GEN[B] set from Definition 27 in [ItC].)

◆ in

NodePairMap retdec::llvmir2hll::DefUseChains::in

Mapping of a CFG node B into the following set:

{(s, x) | s uses x and s is reachable from the beginning of B}

(The IN[B] set from Definition 27 in [ItC].)

◆ kill

NodePairMap retdec::llvmir2hll::DefUseChains::kill

Mapping of a CFG node B into the following set:

{(s, x) | s \notin B uses x and B defines x}

(The KILL[B] set from Definition 27 in [ItC].)

◆ out

NodePairMap retdec::llvmir2hll::DefUseChains::out

Mapping of a CFG node B into the following set:

{(s, x) | s \notin B uses x and s is reachable from the end of B}

(The OUT[B] set from Definition 27 in [ItC].)

◆ shouldBeIncluded

std::function<bool (ShPtr<Variable>)> retdec::llvmir2hll::DefUseChains::shouldBeIncluded

A function that returns whether the given variable should be included in def-use chains.


The documentation for this class was generated from the following files: