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::SlicedPAGEdgeIterImpl< Forward > Class Template Reference

#include <SlicedGraphs.h>

Public Types

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

Public Member Functions

 SlicedPAGEdgeIterImpl ()=default
 
reference operator* () const
 
pointer operator-> () const
 
SlicedPAGNodeRef target () const
 
SlicedPAGEdgeIterImploperator++ ()
 
SlicedPAGEdgeIterImpl operator++ (int)
 

Static Public Member Functions

static SlicedPAGEdgeIterImpl begin (const SlicedPAGView *v, const SVFVar *n)
 
static SlicedPAGEdgeIterImpl end (const SlicedPAGView *v, const SVFVar *n)
 

Private Types

using EdgeIt = SVFVar::const_iterator
 

Private Member Functions

 SlicedPAGEdgeIterImpl (const SlicedPAGView *v, const SVFVar *n)
 
void skipNonKept ()
 
void refresh ()
 

Private Attributes

const SlicedPAGViewview = nullptr
 
const SVFVarsrc = nullptr
 
EdgeIt realIt {}
 
EdgeIt realEnd {}
 
SlicedPAGEdgeRef cur {}
 

Friends

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

Detailed Description

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

Definition at line 867 of file SlicedGraphs.h.

Member Typedef Documentation

◆ difference_type

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

Definition at line 872 of file SlicedGraphs.h.

◆ EdgeIt

template<bool Forward>
using SVF::SlicedPAGEdgeIterImpl< Forward >::EdgeIt = SVFVar::const_iterator
private

Definition at line 937 of file SlicedGraphs.h.

◆ iterator_category

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

Definition at line 870 of file SlicedGraphs.h.

◆ pointer

Definition at line 873 of file SlicedGraphs.h.

◆ reference

template<bool Forward>
using SVF::SlicedPAGEdgeIterImpl< Forward >::reference = const SlicedPAGEdgeRef&

Definition at line 874 of file SlicedGraphs.h.

◆ value_type

template<bool Forward>
using SVF::SlicedPAGEdgeIterImpl< Forward >::value_type = SlicedPAGEdgeRef

Definition at line 871 of file SlicedGraphs.h.

Constructor & Destructor Documentation

◆ SlicedPAGEdgeIterImpl() [1/2]

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

◆ SlicedPAGEdgeIterImpl() [2/2]

template<bool Forward>
SVF::SlicedPAGEdgeIterImpl< Forward >::SlicedPAGEdgeIterImpl ( const SlicedPAGView v,
const SVFVar n 
)
inlineprivate

Definition at line 943 of file SlicedGraphs.h.

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

Member Function Documentation

◆ begin()

template<bool Forward>
static SlicedPAGEdgeIterImpl SVF::SlicedPAGEdgeIterImpl< Forward >::begin ( const SlicedPAGView v,
const SVFVar n 
)
inlinestatic

Definition at line 878 of file SlicedGraphs.h.

879 {
881 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
882 it.realIt = edges.begin();
883 it.realEnd = edges.end();
884 it.skipNonKept();
885 it.refresh();
886 return it;
887 }

◆ end()

template<bool Forward>
static SlicedPAGEdgeIterImpl SVF::SlicedPAGEdgeIterImpl< Forward >::end ( const SlicedPAGView v,
const SVFVar n 
)
inlinestatic

Definition at line 888 of file SlicedGraphs.h.

889 {
891 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
892 it.realIt = edges.end();
893 it.realEnd = edges.end();
894 return it;
895 }

◆ operator*()

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

Definition at line 897 of file SlicedGraphs.h.

898 {
899 return cur;
900 }

◆ operator++() [1/2]

Definition at line 910 of file SlicedGraphs.h.

911 {
912 if (realIt != realEnd)
913 {
914 ++realIt;
915 skipNonKept();
916 }
917 refresh();
918 return *this;
919 }

◆ operator++() [2/2]

Definition at line 920 of file SlicedGraphs.h.

921 {
922 SlicedPAGEdgeIterImpl t = *this;
923 ++*this;
924 return t;
925 }

◆ operator->()

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

Definition at line 901 of file SlicedGraphs.h.

902 {
903 return &cur;
904 }

◆ refresh()

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

Definition at line 949 of file SlicedGraphs.h.

950 {
951 if (realIt != realEnd)
952 {
953 const SVFStmt* s = *realIt;
954 cur = SlicedPAGEdgeRef{{view, s->getSrcNode()}, {view, s->getDstNode()}, s};
955 }
956 else
957 {
958 cur = SlicedPAGEdgeRef{};
959 }
960 }

◆ skipNonKept()

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

Definition at line 945 of file SlicedGraphs.h.

946 {
947 while (realIt != realEnd && !view->isKeptStmt(*realIt)) ++realIt;
948 }
bool isKeptStmt(const SVFStmt *s) const

◆ target()

template<bool Forward>
SlicedPAGNodeRef SVF::SlicedPAGEdgeIterImpl< Forward >::target ( ) const
inline

Definition at line 905 of file SlicedGraphs.h.

906 {
907 return Forward ? cur.dst : cur.src;
908 }
SlicedPAGNodeRef src
SlicedPAGNodeRef dst

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 931 of file SlicedGraphs.h.

932 {
933 return !(a == b);
934 }
cJSON * a
Definition cJSON.cpp:2560
const cJSON *const b
Definition cJSON.h:255

◆ operator==

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

Definition at line 927 of file SlicedGraphs.h.

928 {
929 return a.view == b.view && a.src == b.src && a.realIt == b.realIt;
930 }

Member Data Documentation

◆ cur

template<bool Forward>
SlicedPAGEdgeRef SVF::SlicedPAGEdgeIterImpl< Forward >::cur {}
private

Definition at line 941 of file SlicedGraphs.h.

941{};

◆ realEnd

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

Definition at line 940 of file SlicedGraphs.h.

940{}, realEnd{};

◆ realIt

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

Definition at line 940 of file SlicedGraphs.h.

940{}, realEnd{};

◆ src

template<bool Forward>
const SVFVar* SVF::SlicedPAGEdgeIterImpl< Forward >::src = nullptr
private

Definition at line 939 of file SlicedGraphs.h.

◆ view

template<bool Forward>
const SlicedPAGView* SVF::SlicedPAGEdgeIterImpl< Forward >::view = nullptr
private

Definition at line 938 of file SlicedGraphs.h.


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