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

#include <WPAFSSolver.h>

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

Public Member Functions

 WPAFSSolver ()
 Constructor.
 
virtual ~WPAFSSolver ()
 Destructor.
 
virtual NodeID sccRepNode (NodeID id) const
 SCC methods.
 

Protected Member Functions

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 void propagate (GNODE *v)
 
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

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 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 Attributes inherited from SVF::WPASolver< GraphType >
u32_t numOfIteration
 num of iterations during constraint solving
 

Detailed Description

template<class GraphType>
class SVF::WPAFSSolver< GraphType >

Flow-sensitive Solver

Definition at line 48 of file WPAFSSolver.h.

Constructor & Destructor Documentation

◆ WPAFSSolver()

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

Constructor.

Definition at line 52 of file WPAFSSolver.h.

53 {}
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ ~WPAFSSolver()

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

Destructor.

Definition at line 55 of file WPAFSSolver.h.

55{}

Member Function Documentation

◆ SCCDetect()

template<class GraphType >
virtual NodeStack & SVF::WPAFSSolver< GraphType >::SCCDetect ( )
inlineprotectedvirtual

SCC detection.

SCC detection

Both rep and sub nodes need to be processed later. Collect sub nodes from SCCDetector.

restore the topological order.

Reimplemented from SVF::WPASolver< GraphType >.

Reimplemented in SVF::FlowSensitive.

Definition at line 67 of file WPAFSSolver.h.

68 {
70 this->getSCCDetector()->find();
71
75 NodeStack& topoStack = this->getSCCDetector()->topoNodeStack();
76 while (!topoStack.empty())
77 {
78 NodeID nodeId = topoStack.top();
79 topoStack.pop();
80 const NodeBS& subNodes = this->getSCCDetector()->subNodes(nodeId);
81 for (NodeBS::iterator it = subNodes.begin(), eit = subNodes.end(); it != eit; ++it)
82 {
83 revTopoStack.push(*it);
84 }
85 }
86
87 assert(nodeStack.empty() && "node stack is not empty, some nodes are not popped properly.");
88
90 while (!revTopoStack.empty())
91 {
93 revTopoStack.pop();
94 nodeStack.push(nodeId);
95 }
96
97 return nodeStack;
98 }
SparseBitVectorIterator iterator
NodeStack nodeStack
stack used for processing nodes.
Definition WPAFSSolver.h:64
SCC * getSCCDetector() const
Get SCC detector.
Definition WPASolver.h:67
std::stack< NodeID > NodeStack
u32_t NodeID
Definition GeneralType.h:55
SparseBitVector NodeBS
Definition GeneralType.h:62

◆ sccRepNode()

template<class GraphType >
virtual NodeID SVF::WPAFSSolver< GraphType >::sccRepNode ( NodeID  id) const
inlinevirtual

SCC methods.

Reimplemented from SVF::WPASolver< GraphType >.

Definition at line 58 of file WPAFSSolver.h.

59 {
60 return id;
61 }

Member Data Documentation

◆ nodeStack

template<class GraphType >
NodeStack SVF::WPAFSSolver< GraphType >::nodeStack
protected

stack used for processing nodes.

Definition at line 64 of file WPAFSSolver.h.


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