Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
SVF::ICFGIWTO Class Reference

#include <ICFGWTO.h>

Inheritance diagram for SVF::ICFGIWTO:
SVF::ICFGWTO SVF::WTO< ICFG >

Public Types

typedef ICFGWTO Base
 
typedef WTOComponentVisitor< ICFG >::WTONodeT ICFGWTONode
 
- Public Types inherited from SVF::ICFGWTO
typedef WTO< ICFGBase
 
typedef WTOComponentVisitor< ICFG >::WTONodeT ICFGWTONode
 
- Public Types inherited from SVF::WTO< ICFG >
typedef GraphT::NodeType NodeT
 
typedef GraphT::EdgeType EdgeT
 
typedef WTOCycleDepth< ICFGGraphTWTOCycleDepth
 
typedef WTOComponent< ICFGWTOComponentT
 
typedef WTONode< ICFGWTONodeT
 
typedef WTOCycle< ICFGWTOCycleT
 
typedef Set< const NodeT * > NodeRefList
 
typedef WTOComponentRefList::const_iterator Iterator
 Iterator over the components.
 

Public Member Functions

 ICFGIWTO (ICFG *graph, const ICFGNode *node, NodeBS &funcPar, CallGraph *cg)
 
virtual ~ICFGIWTO ()
 
void forEachSuccessor (const ICFGNode *node, std::function< void(const ICFGNode *)> func) const override
 
- Public Member Functions inherited from SVF::ICFGWTO
 ICFGWTO (ICFG *graph, const ICFGNode *node)
 
virtual ~ICFGWTO ()
 
void forEachSuccessor (const ICFGNode *node, std::function< void(const ICFGNode *)> func) const override
 
- Public Member Functions inherited from SVF::WTO< ICFG >
 WTO (ICFG *graph, const NodeT *entry)
 Compute the weak topological order of the given graph.
 
 WTO (const WTO &other)=default
 No copy constructor.
 
 WTO (WTO &&other)=default
 Move constructor.
 
WTOoperator= (const WTO &other)=default
 No copy assignment operator.
 
WTOoperator= (WTO &&other)=default
 Move assignment operator.
 
 ~WTO ()
 Destructor.
 
const WTOComponentRefListgetWTOComponents () const
 Get all wto components in WTO.
 
Iterator begin () const
 Begin iterator over the components.
 
Iterator end () const
 End iterator over the components.
 
bool isHead (const NodeT *node) const
 
NodeRefToWTOCycleMap::const_iterator headBegin () const
 
NodeRefToWTOCycleMap::const_iterator headEnd () const
 End iterator over the components.
 
const GraphTWTOCycleDepthcycleDepth (const NodeT *n) const
 Return the cycleDepth of the given node.
 
bool in_cycleDepth_table (const NodeT *n) const
 Return the cycleDepth of the given node.
 
void accept (WTOComponentVisitor< ICFG > &v)
 Accept the given visitor.
 
std::string toString () const
 Dump the order, for debugging purpose.
 
void init ()
 

Public Attributes

NodeBSfuncPar
 
CallGraphcg
 

Additional Inherited Members

- Protected Types inherited from SVF::WTO< ICFG >
typedef const WTOComponentTWTOComponentPtr
 
typedef std::list< WTOComponentPtrWTOComponentRefList
 
typedef Set< WTOComponentPtrWTOComponentRefSet
 
typedef Map< const NodeT *, const WTOCycleT * > NodeRefToWTOCycleMap
 
typedef Map< const NodeT *, NodeRefListNodeRefTONodeRefListMap
 
typedef u32_t CycleDepthNumber
 
typedef Map< const NodeT *, CycleDepthNumberNodeRefToCycleDepthNumber
 
typedef std::vector< const NodeT * > Stack
 
typedef std::shared_ptr< GraphTWTOCycleDepthWTOCycleDepthPtr
 
typedef Map< const NodeT *, WTOCycleDepthPtrNodeRefToWTOCycleDepthPtr
 
- Protected Member Functions inherited from SVF::WTO< ICFG >
virtual void forEachSuccessor (const NodeT *node, std::function< void(const NodeT *)> func) const
 
CycleDepthNumber getCDN (const NodeT *n) const
 Return the depth-first number of the given node.
 
void setCDN (const NodeT *n, const CycleDepthNumber &dfn)
 Set the depth-first number of the given node.
 
const NodeTpop ()
 Pop a node from the stack.
 
void push (const NodeT *n)
 Push a node on the stack.
 
const WTONodeTnewNode (const NodeT *node)
 
const WTOCycleTnewCycle (const WTONodeT *node, const WTOComponentRefList &partition)
 
virtual const WTOCycleTcomponent (const NodeT *node)
 Create the cycle component for the given node.
 
virtual CycleDepthNumber visit (const NodeT *node, WTOComponentRefList &partition)
 
void buildNodeToDepth ()
 Build the node to WTO cycle depth table.
 
- Protected Attributes inherited from SVF::WTO< ICFG >
WTOComponentRefList _components
 
WTOComponentRefSet _allComponents
 
NodeRefToWTOCycleMap headRefToCycle
 
NodeRefToWTOCycleDepthPtr _nodeToDepth
 
NodeRefToCycleDepthNumber _nodeToCDN
 
CycleDepthNumber _num
 
Stack _stack
 
ICFG_graph
 
const NodeT_entry
 

Detailed Description

Definition at line 83 of file ICFGWTO.h.

Member Typedef Documentation

◆ Base

Definition at line 86 of file ICFGWTO.h.

◆ ICFGWTONode

Definition at line 87 of file ICFGWTO.h.

Constructor & Destructor Documentation

◆ ICFGIWTO()

SVF::ICFGIWTO::ICFGIWTO ( ICFG graph,
const ICFGNode node,
NodeBS funcPar,
CallGraph cg 
)
inlineexplicit

Definition at line 91 of file ICFGWTO.h.

91 :
92 Base(graph, node), funcPar(funcPar), cg(cg) {}
ICFGWTO Base
Definition ICFGWTO.h:86
CallGraph * cg
Definition ICFGWTO.h:89
NodeBS & funcPar
Definition ICFGWTO.h:88

◆ ~ICFGIWTO()

virtual SVF::ICFGIWTO::~ICFGIWTO ( )
inlinevirtual

Definition at line 94 of file ICFGWTO.h.

95 {
96 }

Member Function Documentation

◆ forEachSuccessor()

void SVF::ICFGIWTO::forEachSuccessor ( const ICFGNode node,
std::function< void(const ICFGNode *)>  func 
) const
inlineoverride

Definition at line 98 of file ICFGWTO.h.

101 {
102 if (const auto* callNode = SVFUtil::dyn_cast<CallICFGNode>(node))
103 {
104
105 for (const auto &e : callNode->getOutEdges())
106 {
107 ICFGNode *calleeEntryICFGNode = e->getDstNode();
108 CallGraphNode * calleeCGNode = cg->getCallGraphNode(calleeEntryICFGNode->getFun());
109
110 const ICFGNode* succ = nullptr;
111 if (funcPar.test(calleeCGNode->getId()))
113 else
114 succ = callNode->getRetICFGNode();
115
116 func(succ);
117 }
118 }
119 else
120 {
121 for (const auto& e : node->getOutEdges())
122 {
123 ICFGNode *succ = e->getDstNode();
124 CallGraphNode *succCGNode = cg->getCallGraphNode(succ->getFun());
125 if (!funcPar.test(succCGNode->getId()))
126 continue;
127 func(succ);
128 }
129 }
130 }
const CallGraphNode * getCallGraphNode(const std::string &name)
Get call graph node.
bool test(unsigned Idx) const
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

Member Data Documentation

◆ cg

CallGraph* SVF::ICFGIWTO::cg

Definition at line 89 of file ICFGWTO.h.

◆ funcPar

NodeBS& SVF::ICFGIWTO::funcPar

Definition at line 88 of file ICFGWTO.h.


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