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 1083 of file SlicedGraphs.h.

Member Typedef Documentation

◆ difference_type

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

Definition at line 1088 of file SlicedGraphs.h.

◆ EdgeIt

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

Definition at line 1153 of file SlicedGraphs.h.

◆ iterator_category

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

Definition at line 1086 of file SlicedGraphs.h.

◆ pointer

Definition at line 1089 of file SlicedGraphs.h.

◆ reference

Definition at line 1090 of file SlicedGraphs.h.

◆ value_type

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

Definition at line 1087 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 1159 of file SlicedGraphs.h.

1159: 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 1094 of file SlicedGraphs.h.

1095 {
1097 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
1098 it.realIt = edges.begin();
1099 it.realEnd = edges.end();
1100 it.skipNonKept();
1101 it.refresh();
1102 return it;
1103 }

◆ end()

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

Definition at line 1104 of file SlicedGraphs.h.

1105 {
1107 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
1108 it.realIt = edges.end();
1109 it.realEnd = edges.end();
1110 return it;
1111 }

◆ operator*()

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

Definition at line 1113 of file SlicedGraphs.h.

1114 {
1115 return cur;
1116 }

◆ operator++() [1/2]

Definition at line 1126 of file SlicedGraphs.h.

1127 {
1128 if (realIt != realEnd)
1129 {
1130 ++realIt;
1131 skipNonKept();
1132 }
1133 refresh();
1134 return *this;
1135 }

◆ operator++() [2/2]

Definition at line 1136 of file SlicedGraphs.h.

1137 {
1138 SlicedSVFGEdgeIterImpl t = *this;
1139 ++*this;
1140 return t;
1141 }

◆ operator->()

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

Definition at line 1117 of file SlicedGraphs.h.

1118 {
1119 return &cur;
1120 }

◆ refresh()

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

Definition at line 1167 of file SlicedGraphs.h.

1168 {
1169 if (realIt != realEnd)
1170 {
1171 const SVFGEdge* e = *realIt;
1172 cur = SlicedSVFGEdgeRef{{view, e->getSrcNode()}, {view, e->getDstNode()}, e};
1173 }
1174 else
1175 {
1176 cur = SlicedSVFGEdgeRef{};
1177 }
1178 }
VFGEdge SVFGEdge
Definition SVFG.h:42

◆ skipNonKept()

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

Definition at line 1161 of file SlicedGraphs.h.

1162 {
1163 while (realIt != realEnd &&
1164 !view->isKeptNode(Forward ? (*realIt)->getDstNode() : (*realIt)->getSrcNode()))
1165 ++realIt;
1166 }
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 1121 of file SlicedGraphs.h.

1122 {
1123 return Forward ? cur.dst : cur.src;
1124 }
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 1147 of file SlicedGraphs.h.

1148 {
1149 return !(a == b);
1150 }
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 1143 of file SlicedGraphs.h.

1144 {
1145 return a.view == b.view && a.src == b.src && a.realIt == b.realIt;
1146 }

Member Data Documentation

◆ cur

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

Definition at line 1157 of file SlicedGraphs.h.

1157{};

◆ realEnd

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

Definition at line 1156 of file SlicedGraphs.h.

1156{}, realEnd{};

◆ realIt

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

Definition at line 1156 of file SlicedGraphs.h.

1156{}, realEnd{};

◆ src

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

Definition at line 1155 of file SlicedGraphs.h.

◆ view

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

Definition at line 1154 of file SlicedGraphs.h.


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