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

#include <SrcSnkSolver.h>

Public Types

typedef SVF::GenericGraphTraits< GraphType > GTraits
 Define the GTraits and node iterator.
 
typedef GTraits::NodeType GNODE
 
typedef GTraits::EdgeType GEDGE
 
typedef GTraits::nodes_iterator node_iterator
 
typedef GTraits::ChildIteratorType child_iterator
 
typedef SVF::GenericGraphTraits< SVF::Inverse< GNODE * > > InvGTraits
 Define inverse GTraits and note iterator.
 
typedef InvGTraits::ChildIteratorType inv_child_iterator
 
typedef FIFOWorkList< DPIm > WorkList
 Define worklist.
 

Protected Member Functions

 SrcSnkSolver ()
 Constructor.
 
virtual ~SrcSnkSolver ()
 Destructor.
 
const GraphType graph () const
 Get/Set graph methods.
 
void setGraph (GraphType g)
 
GNODEgetNode (NodeID id) const
 
virtual NodeID getNodeIDFromItem (const DPIm &item) const
 
virtual void forwardTraverse (DPIm &it)
 CFL forward traverse solve.
 
virtual void backwardTraverse (DPIm &it)
 CFL forward traverse solve.
 
virtual void FWProcessCurNode (const DPIm &)
 Process the DP item.
 
virtual void BWProcessCurNode (const DPIm &)
 
virtual void FWProcessOutgoingEdge (const DPIm &item, GEDGE *edge)
 Propagation for the solving, to be implemented in the child class.
 
virtual void BWProcessIncomingEdge (const DPIm &item, GEDGE *edge)
 
DPIm popFromWorklist ()
 Worklist operations.
 
bool pushIntoWorklist (DPIm &item)
 
bool isWorklistEmpty ()
 
bool isInWorklist (DPIm &item)
 

Private Attributes

GraphType _graph
 Graph.
 
WorkList worklist
 Worklist for resolution.
 

Detailed Description

template<class GraphType, class DPIm = DPItem>
class SVF::SrcSnkSolver< GraphType, DPIm >

Definition at line 44 of file SrcSnkSolver.h.

Member Typedef Documentation

◆ child_iterator

template<class GraphType , class DPIm = DPItem>
typedef GTraits::ChildIteratorType SVF::SrcSnkSolver< GraphType, DPIm >::child_iterator

Definition at line 53 of file SrcSnkSolver.h.

◆ GEDGE

template<class GraphType , class DPIm = DPItem>
typedef GTraits::EdgeType SVF::SrcSnkSolver< GraphType, DPIm >::GEDGE

Definition at line 51 of file SrcSnkSolver.h.

◆ GNODE

template<class GraphType , class DPIm = DPItem>
typedef GTraits::NodeType SVF::SrcSnkSolver< GraphType, DPIm >::GNODE

Definition at line 50 of file SrcSnkSolver.h.

◆ GTraits

template<class GraphType , class DPIm = DPItem>
typedef SVF::GenericGraphTraits<GraphType> SVF::SrcSnkSolver< GraphType, DPIm >::GTraits

Define the GTraits and node iterator.

Definition at line 49 of file SrcSnkSolver.h.

◆ inv_child_iterator

template<class GraphType , class DPIm = DPItem>
typedef InvGTraits::ChildIteratorType SVF::SrcSnkSolver< GraphType, DPIm >::inv_child_iterator

Definition at line 57 of file SrcSnkSolver.h.

◆ InvGTraits

template<class GraphType , class DPIm = DPItem>
typedef SVF::GenericGraphTraits<SVF::Inverse<GNODE *> > SVF::SrcSnkSolver< GraphType, DPIm >::InvGTraits

Define inverse GTraits and note iterator.

Definition at line 56 of file SrcSnkSolver.h.

◆ node_iterator

template<class GraphType , class DPIm = DPItem>
typedef GTraits::nodes_iterator SVF::SrcSnkSolver< GraphType, DPIm >::node_iterator

Definition at line 52 of file SrcSnkSolver.h.

◆ WorkList

template<class GraphType , class DPIm = DPItem>
typedef FIFOWorkList<DPIm> SVF::SrcSnkSolver< GraphType, DPIm >::WorkList

Define worklist.

Definition at line 60 of file SrcSnkSolver.h.

Constructor & Destructor Documentation

◆ SrcSnkSolver()

template<class GraphType , class DPIm = DPItem>
SVF::SrcSnkSolver< GraphType, DPIm >::SrcSnkSolver ( )
inlineprotected

Constructor.

Definition at line 65 of file SrcSnkSolver.h.

65 : _graph(nullptr)
66 {
67 }
GraphType _graph
Graph.

◆ ~SrcSnkSolver()

template<class GraphType , class DPIm = DPItem>
virtual SVF::SrcSnkSolver< GraphType, DPIm >::~SrcSnkSolver ( )
inlineprotectedvirtual

Destructor.

Definition at line 69 of file SrcSnkSolver.h.

70 {
71 }

Member Function Documentation

◆ backwardTraverse()

template<class GraphType , class DPIm = DPItem>
virtual void SVF::SrcSnkSolver< GraphType, DPIm >::backwardTraverse ( DPIm &  it)
inlineprotectedvirtual

CFL forward traverse solve.

Definition at line 112 of file SrcSnkSolver.h.

113 {
115
116 while (!isWorklistEmpty())
117 {
118 DPIm item = popFromWorklist();
120
122 inv_child_iterator EI = InvGTraits::child_begin(v);
123 inv_child_iterator EE = InvGTraits::child_end(v);
124 for (; EI != EE; ++EI)
125 {
126 BWProcessIncomingEdge(item,*(EI.getCurrent()) );
127 }
128 }
129 }
cJSON * item
Definition cJSON.h:222
GNODE * getNode(NodeID id) const
bool pushIntoWorklist(DPIm &item)
virtual void BWProcessCurNode(const DPIm &)
virtual void BWProcessIncomingEdge(const DPIm &item, GEDGE *edge)
DPIm popFromWorklist()
Worklist operations.
GTraits::NodeType GNODE
virtual NodeID getNodeIDFromItem(const DPIm &item) const
InvGTraits::ChildIteratorType inv_child_iterator
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ BWProcessCurNode()

template<class GraphType , class DPIm = DPItem>
virtual void SVF::SrcSnkSolver< GraphType, DPIm >::BWProcessCurNode ( const DPIm &  )
inlineprotectedvirtual

Definition at line 135 of file SrcSnkSolver.h.

136 {
137 }

◆ BWProcessIncomingEdge()

template<class GraphType , class DPIm = DPItem>
virtual void SVF::SrcSnkSolver< GraphType, DPIm >::BWProcessIncomingEdge ( const DPIm &  item,
GEDGE edge 
)
inlineprotectedvirtual

Definition at line 147 of file SrcSnkSolver.h.

148 {
149 DPIm newItem(item);
150 newItem.setCurNodeID(edge->getSrcID());
152 }

◆ forwardTraverse()

template<class GraphType , class DPIm = DPItem>
virtual void SVF::SrcSnkSolver< GraphType, DPIm >::forwardTraverse ( DPIm &  it)
inlineprotectedvirtual

CFL forward traverse solve.

Definition at line 93 of file SrcSnkSolver.h.

94 {
96
97 while (!isWorklistEmpty())
98 {
99 DPIm item = popFromWorklist();
101
103 child_iterator EI = GTraits::child_begin(v);
104 child_iterator EE = GTraits::child_end(v);
105 for (; EI != EE; ++EI)
106 {
107 FWProcessOutgoingEdge(item,*(EI.getCurrent()) );
108 }
109 }
110 }
GTraits::ChildIteratorType child_iterator
virtual void FWProcessOutgoingEdge(const DPIm &item, GEDGE *edge)
Propagation for the solving, to be implemented in the child class.
virtual void FWProcessCurNode(const DPIm &)
Process the DP item.

◆ FWProcessCurNode()

template<class GraphType , class DPIm = DPItem>
virtual void SVF::SrcSnkSolver< GraphType, DPIm >::FWProcessCurNode ( const DPIm &  )
inlineprotectedvirtual

Process the DP item.

Definition at line 132 of file SrcSnkSolver.h.

133 {
134 }

◆ FWProcessOutgoingEdge()

template<class GraphType , class DPIm = DPItem>
virtual void SVF::SrcSnkSolver< GraphType, DPIm >::FWProcessOutgoingEdge ( const DPIm &  item,
GEDGE edge 
)
inlineprotectedvirtual

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

Definition at line 141 of file SrcSnkSolver.h.

142 {
143 DPIm newItem(item);
144 newItem.setCurNodeID(edge->getDstID());
146 }

◆ getNode()

template<class GraphType , class DPIm = DPItem>
GNODE * SVF::SrcSnkSolver< GraphType, DPIm >::getNode ( NodeID  id) const
inlineprotected

Definition at line 84 of file SrcSnkSolver.h.

85 {
86 return _graph->getGNode(id);
87 }

◆ getNodeIDFromItem()

template<class GraphType , class DPIm = DPItem>
virtual NodeID SVF::SrcSnkSolver< GraphType, DPIm >::getNodeIDFromItem ( const DPIm &  item) const
inlineprotectedvirtual

Definition at line 88 of file SrcSnkSolver.h.

89 {
90 return item.getCurNodeID();
91 }

◆ graph()

template<class GraphType , class DPIm = DPItem>
const GraphType SVF::SrcSnkSolver< GraphType, DPIm >::graph ( ) const
inlineprotected

Get/Set graph methods.

Definition at line 74 of file SrcSnkSolver.h.

75 {
76 return _graph;
77 }

◆ isInWorklist()

template<class GraphType , class DPIm = DPItem>
bool SVF::SrcSnkSolver< GraphType, DPIm >::isInWorklist ( DPIm &  item)
inlineprotected

Definition at line 168 of file SrcSnkSolver.h.

169 {
170 return worklist.find(item);
171 }
WorkList worklist
Worklist for resolution.

◆ isWorklistEmpty()

template<class GraphType , class DPIm = DPItem>
bool SVF::SrcSnkSolver< GraphType, DPIm >::isWorklistEmpty ( )
inlineprotected

Definition at line 164 of file SrcSnkSolver.h.

165 {
166 return worklist.empty();
167 }

◆ popFromWorklist()

template<class GraphType , class DPIm = DPItem>
DPIm SVF::SrcSnkSolver< GraphType, DPIm >::popFromWorklist ( )
inlineprotected

Worklist operations.

Definition at line 156 of file SrcSnkSolver.h.

157 {
158 return worklist.pop();
159 }

◆ pushIntoWorklist()

template<class GraphType , class DPIm = DPItem>
bool SVF::SrcSnkSolver< GraphType, DPIm >::pushIntoWorklist ( DPIm &  item)
inlineprotected

Definition at line 160 of file SrcSnkSolver.h.

161 {
162 return worklist.push(item);
163 }

◆ setGraph()

template<class GraphType , class DPIm = DPItem>
void SVF::SrcSnkSolver< GraphType, DPIm >::setGraph ( GraphType  g)
inlineprotected

Definition at line 78 of file SrcSnkSolver.h.

79 {
80 _graph = g;
81 }

Member Data Documentation

◆ _graph

template<class GraphType , class DPIm = DPItem>
GraphType SVF::SrcSnkSolver< GraphType, DPIm >::_graph
private

Graph.

Definition at line 177 of file SrcSnkSolver.h.

◆ worklist

template<class GraphType , class DPIm = DPItem>
WorkList SVF::SrcSnkSolver< GraphType, DPIm >::worklist
private

Worklist for resolution.

Definition at line 180 of file SrcSnkSolver.h.


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