Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
SVF::SlicedSVFGEdgeIterImpl< Forward > Class Template Reference

#include <SlicedGraphs.h>

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = SlicedSVFGEdgeRef
 
using difference_type = std::ptrdiff_t
 
using pointer = const SlicedSVFGEdgeRef *
 
using reference = const SlicedSVFGEdgeRef &
 

Public Member Functions

 SlicedSVFGEdgeIterImpl ()=default
 
reference operator* () const
 
pointer operator-> () const
 
SlicedSVFGNodeRef target () const
 
SlicedSVFGEdgeIterImploperator++ ()
 
SlicedSVFGEdgeIterImpl operator++ (int)
 

Static Public Member Functions

static SlicedSVFGEdgeIterImpl begin (const SlicedSVFGView *v, const SVFGNode *n)
 
static SlicedSVFGEdgeIterImpl end (const SlicedSVFGView *v, const SVFGNode *n)
 

Private Types

using EdgeIt = SVFGNode::const_iterator
 

Private Member Functions

 SlicedSVFGEdgeIterImpl (const SlicedSVFGView *v, const SVFGNode *n)
 
void skipNonKept ()
 
void refresh ()
 

Private Attributes

const SlicedSVFGViewview = nullptr
 
const SVFGNodesrc = nullptr
 
EdgeIt realIt {}
 
EdgeIt realEnd {}
 
SlicedSVFGEdgeRef cur {}
 

Friends

bool operator== (const SlicedSVFGEdgeIterImpl &a, const SlicedSVFGEdgeIterImpl &b)
 
bool operator!= (const SlicedSVFGEdgeIterImpl &a, const SlicedSVFGEdgeIterImpl &b)
 

Detailed Description

template<bool Forward>
class SVF::SlicedSVFGEdgeIterImpl< Forward >

Definition at line 1067 of file SlicedGraphs.h.

Member Typedef Documentation

◆ difference_type

template<bool Forward>
using SVF::SlicedSVFGEdgeIterImpl< Forward >::difference_type = std::ptrdiff_t

Definition at line 1072 of file SlicedGraphs.h.

◆ EdgeIt

template<bool Forward>
using SVF::SlicedSVFGEdgeIterImpl< Forward >::EdgeIt = SVFGNode::const_iterator
private

Definition at line 1137 of file SlicedGraphs.h.

◆ iterator_category

template<bool Forward>
using SVF::SlicedSVFGEdgeIterImpl< Forward >::iterator_category = std::forward_iterator_tag

Definition at line 1070 of file SlicedGraphs.h.

◆ pointer

Definition at line 1073 of file SlicedGraphs.h.

◆ reference

Definition at line 1074 of file SlicedGraphs.h.

◆ value_type

template<bool Forward>
using SVF::SlicedSVFGEdgeIterImpl< Forward >::value_type = SlicedSVFGEdgeRef

Definition at line 1071 of file SlicedGraphs.h.

Constructor & Destructor Documentation

◆ SlicedSVFGEdgeIterImpl() [1/2]

template<bool Forward>
SVF::SlicedSVFGEdgeIterImpl< Forward >::SlicedSVFGEdgeIterImpl ( )
default

◆ SlicedSVFGEdgeIterImpl() [2/2]

template<bool Forward>
SVF::SlicedSVFGEdgeIterImpl< Forward >::SlicedSVFGEdgeIterImpl ( const SlicedSVFGView v,
const SVFGNode n 
)
inlineprivate

Definition at line 1143 of file SlicedGraphs.h.

1143: view(v), src(n) {}
cJSON * n
Definition cJSON.cpp:2558
const SlicedSVFGView * view
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

Member Function Documentation

◆ begin()

template<bool Forward>
static SlicedSVFGEdgeIterImpl SVF::SlicedSVFGEdgeIterImpl< Forward >::begin ( const SlicedSVFGView v,
const SVFGNode n 
)
inlinestatic

Definition at line 1078 of file SlicedGraphs.h.

1079 {
1081 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
1082 it.realIt = edges.begin();
1083 it.realEnd = edges.end();
1084 it.skipNonKept();
1085 it.refresh();
1086 return it;
1087 }

◆ end()

template<bool Forward>
static SlicedSVFGEdgeIterImpl SVF::SlicedSVFGEdgeIterImpl< Forward >::end ( const SlicedSVFGView v,
const SVFGNode n 
)
inlinestatic

Definition at line 1088 of file SlicedGraphs.h.

1089 {
1091 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
1092 it.realIt = edges.end();
1093 it.realEnd = edges.end();
1094 return it;
1095 }

◆ operator*()

template<bool Forward>
reference SVF::SlicedSVFGEdgeIterImpl< Forward >::operator* ( ) const
inline

Definition at line 1097 of file SlicedGraphs.h.

1098 {
1099 return cur;
1100 }

◆ operator++() [1/2]

Definition at line 1110 of file SlicedGraphs.h.

1111 {
1112 if (realIt != realEnd)
1113 {
1114 ++realIt;
1115 skipNonKept();
1116 }
1117 refresh();
1118 return *this;
1119 }

◆ operator++() [2/2]

Definition at line 1120 of file SlicedGraphs.h.

1121 {
1122 SlicedSVFGEdgeIterImpl t = *this;
1123 ++*this;
1124 return t;
1125 }

◆ operator->()

template<bool Forward>
pointer SVF::SlicedSVFGEdgeIterImpl< Forward >::operator-> ( ) const
inline

Definition at line 1101 of file SlicedGraphs.h.

1102 {
1103 return &cur;
1104 }

◆ refresh()

template<bool Forward>
void SVF::SlicedSVFGEdgeIterImpl< Forward >::refresh ( )
inlineprivate

Definition at line 1151 of file SlicedGraphs.h.

1152 {
1153 if (realIt != realEnd)
1154 {
1155 const SVFGEdge* e = *realIt;
1156 cur = SlicedSVFGEdgeRef{{view, e->getSrcNode()}, {view, e->getDstNode()}, e};
1157 }
1158 else
1159 {
1160 cur = SlicedSVFGEdgeRef{};
1161 }
1162 }
VFGEdge SVFGEdge
Definition SVFG.h:42

◆ skipNonKept()

template<bool Forward>
void SVF::SlicedSVFGEdgeIterImpl< Forward >::skipNonKept ( )
inlineprivate

Definition at line 1145 of file SlicedGraphs.h.

1146 {
1147 while (realIt != realEnd &&
1148 !view->isKeptNode(Forward ? (*realIt)->getDstNode() : (*realIt)->getSrcNode()))
1149 ++realIt;
1150 }
bool isKeptNode(const SVFGNode *n) const
Whether the node is retained (see the class comment for the rule).

◆ target()

template<bool Forward>
SlicedSVFGNodeRef SVF::SlicedSVFGEdgeIterImpl< Forward >::target ( ) const
inline

Definition at line 1105 of file SlicedGraphs.h.

1106 {
1107 return Forward ? cur.dst : cur.src;
1108 }
SlicedSVFGNodeRef dst
SlicedSVFGNodeRef src

Friends And Related Symbol Documentation

◆ operator!=

template<bool Forward>
bool operator!= ( const SlicedSVFGEdgeIterImpl< Forward > &  a,
const SlicedSVFGEdgeIterImpl< Forward > &  b 
)
friend

Definition at line 1131 of file SlicedGraphs.h.

1132 {
1133 return !(a == b);
1134 }
cJSON * a
Definition cJSON.cpp:2560
const cJSON *const b
Definition cJSON.h:255

◆ operator==

template<bool Forward>
bool operator== ( const SlicedSVFGEdgeIterImpl< Forward > &  a,
const SlicedSVFGEdgeIterImpl< Forward > &  b 
)
friend

Definition at line 1127 of file SlicedGraphs.h.

1128 {
1129 return a.view == b.view && a.src == b.src && a.realIt == b.realIt;
1130 }

Member Data Documentation

◆ cur

template<bool Forward>
SlicedSVFGEdgeRef SVF::SlicedSVFGEdgeIterImpl< Forward >::cur {}
private

Definition at line 1141 of file SlicedGraphs.h.

1141{};

◆ realEnd

template<bool Forward>
EdgeIt SVF::SlicedSVFGEdgeIterImpl< Forward >::realEnd {}
private

Definition at line 1140 of file SlicedGraphs.h.

1140{}, realEnd{};

◆ realIt

template<bool Forward>
EdgeIt SVF::SlicedSVFGEdgeIterImpl< Forward >::realIt {}
private

Definition at line 1140 of file SlicedGraphs.h.

1140{}, realEnd{};

◆ src

template<bool Forward>
const SVFGNode* SVF::SlicedSVFGEdgeIterImpl< Forward >::src = nullptr
private

Definition at line 1139 of file SlicedGraphs.h.

◆ view

template<bool Forward>
const SlicedSVFGView* SVF::SlicedSVFGEdgeIterImpl< Forward >::view = nullptr
private

Definition at line 1138 of file SlicedGraphs.h.


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