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

#include <ICFGWTO.h>

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

Public Types

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

 ICFGWTO (const ICFGNode *node, Set< const FunObjVar * > funcScc={})
 
virtual ~ICFGWTO ()
 
virtual std::vector< const ICFGNode * > getSuccessors (const ICFGNode *node) override
 
- Public Member Functions inherited from SVF::WTO< ICFG >
 WTO (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

Set< const FunObjVar * > scc
 

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 std::vector< const NodeT * > getSuccessors (const NodeT *node)
 Return the successors of node.
 
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
 
const NodeT_entry
 

Detailed Description

Interprocedural Weak Topological Order Each IWTO has an entry ICFGNode within an function-level SCC boundary. Here scc is one or more functions.

Definition at line 50 of file ICFGWTO.h.

Member Typedef Documentation

◆ Base

Definition at line 53 of file ICFGWTO.h.

◆ ICFGWTONode

Definition at line 54 of file ICFGWTO.h.

Constructor & Destructor Documentation

◆ ICFGWTO()

SVF::ICFGWTO::ICFGWTO ( const ICFGNode node,
Set< const FunObjVar * >  funcScc = {} 
)
inlineexplicit

Definition at line 58 of file ICFGWTO.h.

58 {}) :
59 Base(node), scc(funcScc)
60 {
61 if (scc.empty()) // if funcScc is empty, the scc is the function itself
62 scc.insert(node->getFun());
63 }
Set< const FunObjVar * > scc
Definition ICFGWTO.h:55
WTO< ICFG > Base
Definition ICFGWTO.h:53
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ ~ICFGWTO()

virtual SVF::ICFGWTO::~ICFGWTO ( )
inlinevirtual

Definition at line 65 of file ICFGWTO.h.

66 {
67 }

Member Function Documentation

◆ getSuccessors()

virtual std::vector< const ICFGNode * > SVF::ICFGWTO::getSuccessors ( const ICFGNode node)
inlineoverridevirtual

Definition at line 69 of file ICFGWTO.h.

70 {
71 std::vector<const ICFGNode*> successors;
72
73 if (const auto* callNode = SVFUtil::dyn_cast<CallICFGNode>(node))
74 {
75
76 for (const auto &e : callNode->getOutEdges())
77 {
78 ICFGNode *calleeEntryICFGNode = e->getDstNode();
79 const ICFGNode *succ = nullptr;
80
81 if (scc.find(calleeEntryICFGNode->getFun()) != scc.end()) // caller & callee in the same SCC
83 else
84 succ = callNode->getRetICFGNode(); // caller & callee in different SCC
85
86 successors.push_back(succ);
87 }
88 }
89 else
90 {
91 for (const auto& e : node->getOutEdges())
92 {
93 ICFGNode *succ = e->getDstNode();
94 if (scc.find(succ->getFun()) == scc.end()) // if not in the same SCC, skip
95 continue;
96 successors.push_back(succ);
97 }
98 }
99
100 return successors;
101 }

Member Data Documentation

◆ scc

Set<const FunObjVar*> SVF::ICFGWTO::scc

Definition at line 55 of file ICFGWTO.h.


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