Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SVF::WPASCCSolver< GraphType > Class Template Reference

#include <WPAFSSolver.h>

Inheritance diagram for SVF::WPASCCSolver< GraphType >:
SVF::WPAFSSolver< GraphType > SVF::WPASolver< GraphType > SVF::WPAMinimumSolver< GraphType >

Public Types

typedef WPASolver< GraphType >::GTraits GTraits
 
typedef WPASolver< GraphType >::GNODE GNODE
 
typedef WPASolver< GraphType >::child_iterator child_iterator
 
- Public Types inherited from SVF::WPASolver< GraphType >
typedef SVF::GenericGraphTraits< GraphType > GTraits
 Define the GTraits and node iterator for printing.
 
typedef GTraits::NodeRef GNODE
 
typedef GTraits::EdgeType GEDGE
 
typedef GTraits::ChildIteratorType child_iterator
 
typedef SCCDetection< GraphType > SCC
 
typedef FIFOWorkList< NodeIDWorkList
 

Public Member Functions

 WPASCCSolver ()
 
virtual ~WPASCCSolver ()
 
- Public Member Functions inherited from SVF::WPAFSSolver< GraphType >
 WPAFSSolver ()
 Constructor.
 
virtual ~WPAFSSolver ()
 Destructor.
 
virtual NodeID sccRepNode (NodeID id) const
 SCC methods.
 

Protected Member Functions

virtual void solve ()
 
virtual void propagate (GNODE *v)
 Propagation for the solving, to be implemented in the child class.
 
virtual void addNodeIntoWorkList (NodeID node)
 
bool isInCurrentSCC (NodeID node)
 
void setCurrentSCC (NodeID id)
 
- Protected Member Functions inherited from SVF::WPAFSSolver< GraphType >
virtual NodeStackSCCDetect ()
 SCC detection.
 
- Protected Member Functions inherited from SVF::WPASolver< GraphType >
 WPASolver ()
 Constructor.
 
virtual ~WPASolver ()=default
 Destructor.
 
SCCgetSCCDetector () const
 Get SCC detector.
 
const GraphType graph ()
 Get/Set graph methods.
 
void setGraph (GraphType g)
 
virtual NodeStackSCCDetect (NodeSet &candidates)
 
virtual void initWorklist ()
 
virtual void solveWorklist ()
 
virtual void processNode (NodeID)
 Following methods are to be implemented in child class, in order to achieve a fully worked PTA.
 
virtual void collapseFields ()
 collapse positive weight cycles of a graph
 
virtual bool propFromSrcToDst (GEDGE *)
 Propagate information from source to destination node, to be implemented in the child class.
 
NodeID popFromWorklist ()
 Worklist operations.
 
virtual void pushIntoWorklist (NodeID id)
 
bool isWorklistEmpty ()
 
bool isInWorklist (NodeID id)
 
GNODENode (NodeID id)
 Get node on the graph.
 
NodeID Node_Index (GNODE node)
 Get node ID.
 

Protected Attributes

NodeID curSCCID
 index of current SCC.
 
- Protected Attributes inherited from SVF::WPAFSSolver< GraphType >
NodeStack nodeStack
 stack used for processing nodes.
 
- Protected Attributes inherited from SVF::WPASolver< GraphType >
bool reanalyze
 Reanalyze if any constraint value changed.
 
u32_t iterationForPrintStat
 print out statistics for i-th iteration
 
GraphType _graph
 Graph.
 
std::unique_ptr< SCCscc
 SCC.
 
WorkList worklist
 Worklist for resolution.
 

Additional Inherited Members

- Public Attributes inherited from SVF::WPASolver< GraphType >
u32_t numOfIteration
 num of iterations during constraint solving
 

Detailed Description

template<class GraphType>
class SVF::WPASCCSolver< GraphType >

Solver based on SCC cycles.

Definition at line 107 of file WPAFSSolver.h.

Member Typedef Documentation

◆ child_iterator

template<class GraphType >
typedef WPASolver<GraphType>::child_iterator SVF::WPASCCSolver< GraphType >::child_iterator

Definition at line 112 of file WPAFSSolver.h.

◆ GNODE

template<class GraphType >
typedef WPASolver<GraphType>::GNODE SVF::WPASCCSolver< GraphType >::GNODE

Definition at line 111 of file WPAFSSolver.h.

◆ GTraits

template<class GraphType >
typedef WPASolver<GraphType>::GTraits SVF::WPASCCSolver< GraphType >::GTraits

Definition at line 110 of file WPAFSSolver.h.

Constructor & Destructor Documentation

◆ WPASCCSolver()

template<class GraphType >
SVF::WPASCCSolver< GraphType >::WPASCCSolver ( )
inline

Definition at line 114 of file WPAFSSolver.h.

llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ ~WPASCCSolver()

template<class GraphType >
virtual SVF::WPASCCSolver< GraphType >::~WPASCCSolver ( )
inlinevirtual

Definition at line 116 of file WPAFSSolver.h.

116{}

Member Function Documentation

◆ addNodeIntoWorkList()

template<class GraphType >
virtual void SVF::WPASCCSolver< GraphType >::addNodeIntoWorkList ( NodeID  node)
inlineprotectedvirtual

Reimplemented in SVF::WPAMinimumSolver< GraphType >.

Definition at line 156 of file WPAFSSolver.h.

157 {
158 if (isInCurrentSCC(node))
159 this->pushIntoWorklist(node);
160 }
bool isInCurrentSCC(NodeID node)
virtual void pushIntoWorklist(NodeID id)
Definition WPASolver.h:156

◆ isInCurrentSCC()

template<class GraphType >
bool SVF::WPASCCSolver< GraphType >::isInCurrentSCC ( NodeID  node)
inlineprotected

Definition at line 162 of file WPAFSSolver.h.

163 {
164 return (const_cast<NodeBS&>(this->getSCCDetector()->subNodes(curSCCID))).test(node);
165 }
NodeID curSCCID
index of current SCC.
SCC * getSCCDetector() const
Get SCC detector.
Definition WPASolver.h:67
SparseBitVector NodeBS
Definition GeneralType.h:62

◆ propagate()

template<class GraphType >
virtual void SVF::WPASCCSolver< GraphType >::propagate ( GNODE v)
inlineprotectedvirtual

Propagation for the solving, to be implemented in the child class.

Reimplemented from SVF::WPASolver< GraphType >.

Definition at line 145 of file WPAFSSolver.h.

146 {
147 child_iterator EI = GTraits::direct_child_begin(v);
148 child_iterator EE = GTraits::direct_child_end(v);
149 for (; EI != EE; ++EI)
150 {
151 if (this->propFromSrcToDst(*(EI.getCurrent())))
153 }
154 }
virtual void addNodeIntoWorkList(NodeID node)
WPASolver< GraphType >::child_iterator child_iterator
NodeID Node_Index(GNODE node)
Get node ID.
Definition WPASolver.h:183
virtual bool propFromSrcToDst(GEDGE *)
Propagate information from source to destination node, to be implemented in the child class.
Definition WPASolver.h:138

◆ setCurrentSCC()

template<class GraphType >
void SVF::WPASCCSolver< GraphType >::setCurrentSCC ( NodeID  id)
inlineprotected

Definition at line 166 of file WPAFSSolver.h.

167 {
168 curSCCID = this->getSCCDetector()->repNode(id);
169 }

◆ solve()

template<class GraphType >
virtual void SVF::WPASCCSolver< GraphType >::solve ( )
inlineprotectedvirtual

All nodes will be solved afterwards, so the worklist can be cleared before each solve iteration.

Reimplemented in SVF::WPAMinimumSolver< GraphType >.

Definition at line 119 of file WPAFSSolver.h.

120 {
123 while (!this->isWorklistEmpty())
124 this->popFromWorklist();
125
126 NodeStack& nodeStack = this->SCCDetect();
127
128 while (!nodeStack.empty())
129 {
130 NodeID rep = nodeStack.top();
131 nodeStack.pop();
132
133 setCurrentSCC(rep);
134
135 const NodeBS& sccNodes = this->getSCCDetector()->subNodes(rep);
136 for (NodeBS::iterator it = sccNodes.begin(), eit = sccNodes.end(); it != eit; ++it)
137 this->pushIntoWorklist(*it);
138
139 while (!this->isWorklistEmpty())
140 this->processNode(this->popFromWorklist());
141 }
142 }
SparseBitVectorIterator iterator
NodeStack nodeStack
stack used for processing nodes.
Definition WPAFSSolver.h:64
virtual NodeStack & SCCDetect()
SCC detection.
Definition WPAFSSolver.h:67
void setCurrentSCC(NodeID id)
NodeID popFromWorklist()
Worklist operations.
Definition WPASolver.h:151
bool isWorklistEmpty()
Definition WPASolver.h:160
virtual void processNode(NodeID)
Following methods are to be implemented in child class, in order to achieve a fully worked PTA.
Definition WPASolver.h:122
std::stack< NodeID > NodeStack
u32_t NodeID
Definition GeneralType.h:55

Member Data Documentation

◆ curSCCID

template<class GraphType >
NodeID SVF::WPASCCSolver< GraphType >::curSCCID
protected

index of current SCC.

Definition at line 171 of file WPAFSSolver.h.


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