Static Value-Flow Analysis
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. More...
 
virtual ~WPAFSSolver ()
 Destructor. More...
 
virtual NodeID sccRepNode (NodeID id) const
 SCC methods. More...
 

Protected Member Functions

virtual NodeStackSCCDetect ()
 SCC detection. More...
 
- Protected Member Functions inherited from SVF::WPASolver< GraphType >
 WPASolver ()
 Constructor. More...
 
virtual ~WPASolver ()=default
 Destructor. More...
 
SCCgetSCCDetector () const
 Get SCC detector. More...
 
const GraphType graph ()
 Get/Set graph methods. More...
 
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. More...
 
virtual void collapseFields ()
 collapse positive weight cycles of a graph More...
 
virtual void propagate (GNODE *v)
 
virtual bool propFromSrcToDst (GEDGE *)
 Propagate information from source to destination node, to be implemented in the child class. More...
 
NodeID popFromWorklist ()
 Worklist operations. More...
 
virtual void pushIntoWorklist (NodeID id)
 
bool isWorklistEmpty ()
 
bool isInWorklist (NodeID id)
 
GNODENode (NodeID id)
 Get node on the graph. More...
 
NodeID Node_Index (GNODE node)
 Get node ID. More...
 

Protected Attributes

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

Additional Inherited Members

- Public Types inherited from SVF::WPASolver< GraphType >
typedef SVF::GenericGraphTraits< GraphType > GTraits
 Define the GTraits and node iterator for printing. More...
 
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 More...
 

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.

52  : WPASolver<GraphType>()
53  {}

◆ ~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 
74  NodeStack revTopoStack;
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  {
92  NodeID nodeId = revTopoStack.top();
93  revTopoStack.pop();
94  nodeStack.push(nodeId);
95  }
96 
97  return nodeStack;
98  }
void find(void)
Definition: SCC.h:308
GNodeStack & topoNodeStack()
Definition: SCC.h:128
const NodeBS & subNodes(NodeID n) const
get all subnodes in one scc, if size is empty insert itself into the set
Definition: SCC.h:173
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
Definition: GeneralType.h:118
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: