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

#include <SlicedGraphs.h>

Public Types

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

Public Member Functions

 SlicedCGEdgeIterImpl ()=default
 
reference operator* () const
 
pointer operator-> () const
 
SlicedCallGraphNodeRef target () const
 
SlicedCGEdgeIterImploperator++ ()
 
SlicedCGEdgeIterImpl operator++ (int)
 

Static Public Member Functions

static SlicedCGEdgeIterImpl begin (const SlicedThreadCallGraphView *v, const CallGraphNode *n)
 
static SlicedCGEdgeIterImpl end (const SlicedThreadCallGraphView *v, const CallGraphNode *n)
 

Private Types

using EdgeIt = CallGraphNode::const_iterator
 

Private Member Functions

 SlicedCGEdgeIterImpl (const SlicedThreadCallGraphView *v, const CallGraphNode *n)
 
void skipNonKept ()
 
void refresh ()
 

Private Attributes

const SlicedThreadCallGraphViewview = nullptr
 
const CallGraphNodesrc = nullptr
 
EdgeIt realIt {}
 
EdgeIt realEnd {}
 
SlicedCallGraphEdgeRef cur {}
 

Friends

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

Detailed Description

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

Definition at line 667 of file SlicedGraphs.h.

Member Typedef Documentation

◆ difference_type

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

Definition at line 672 of file SlicedGraphs.h.

◆ EdgeIt

Definition at line 737 of file SlicedGraphs.h.

◆ iterator_category

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

Definition at line 670 of file SlicedGraphs.h.

◆ pointer

Definition at line 673 of file SlicedGraphs.h.

◆ reference

Definition at line 674 of file SlicedGraphs.h.

◆ value_type

Definition at line 671 of file SlicedGraphs.h.

Constructor & Destructor Documentation

◆ SlicedCGEdgeIterImpl() [1/2]

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

◆ SlicedCGEdgeIterImpl() [2/2]

template<bool Forward>
SVF::SlicedCGEdgeIterImpl< Forward >::SlicedCGEdgeIterImpl ( const SlicedThreadCallGraphView v,
const CallGraphNode n 
)
inlineprivate

Definition at line 743 of file SlicedGraphs.h.

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

Member Function Documentation

◆ begin()

Definition at line 678 of file SlicedGraphs.h.

679 {
681 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
682 it.realIt = edges.begin();
683 it.realEnd = edges.end();
684 it.skipNonKept();
685 it.refresh();
686 return it;
687 }

◆ end()

Definition at line 688 of file SlicedGraphs.h.

689 {
691 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
692 it.realIt = edges.end();
693 it.realEnd = edges.end();
694 return it;
695 }

◆ operator*()

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

Definition at line 697 of file SlicedGraphs.h.

698 {
699 return cur;
700 }
SlicedCallGraphEdgeRef cur

◆ operator++() [1/2]

Definition at line 710 of file SlicedGraphs.h.

711 {
712 if (realIt != realEnd)
713 {
714 ++realIt;
715 skipNonKept();
716 }
717 refresh();
718 return *this;
719 }

◆ operator++() [2/2]

Definition at line 720 of file SlicedGraphs.h.

721 {
722 SlicedCGEdgeIterImpl t = *this;
723 ++*this;
724 return t;
725 }

◆ operator->()

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

Definition at line 701 of file SlicedGraphs.h.

702 {
703 return &cur;
704 }

◆ refresh()

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

Definition at line 749 of file SlicedGraphs.h.

750 {
751 if (realIt != realEnd)
752 {
753 const CallGraphEdge* e = *realIt;
754 cur = SlicedCallGraphEdgeRef{{view, e->getSrcNode()}, {view, e->getDstNode()}, e};
755 }
756 else
757 {
758 cur = SlicedCallGraphEdgeRef{};
759 }
760 }

◆ skipNonKept()

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

Definition at line 745 of file SlicedGraphs.h.

746 {
747 while (realIt != realEnd && !view->isKeptEdge(*realIt)) ++realIt;
748 }
bool isKeptEdge(const CallGraphEdge *e) const

◆ target()

template<bool Forward>
SlicedCallGraphNodeRef SVF::SlicedCGEdgeIterImpl< Forward >::target ( ) const
inline

Definition at line 705 of file SlicedGraphs.h.

706 {
707 return Forward ? cur.dst : cur.src;
708 }
SlicedCallGraphNodeRef src
SlicedCallGraphNodeRef dst

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 731 of file SlicedGraphs.h.

732 {
733 return !(a == b);
734 }
cJSON * a
Definition cJSON.cpp:2560
const cJSON *const b
Definition cJSON.h:255

◆ operator==

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

Definition at line 727 of file SlicedGraphs.h.

728 {
729 return a.view == b.view && a.src == b.src && a.realIt == b.realIt;
730 }

Member Data Documentation

◆ cur

template<bool Forward>
SlicedCallGraphEdgeRef SVF::SlicedCGEdgeIterImpl< Forward >::cur {}
private

Definition at line 741 of file SlicedGraphs.h.

741{};

◆ realEnd

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

Definition at line 740 of file SlicedGraphs.h.

740{}, realEnd{};

◆ realIt

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

Definition at line 740 of file SlicedGraphs.h.

740{}, realEnd{};

◆ src

template<bool Forward>
const CallGraphNode* SVF::SlicedCGEdgeIterImpl< Forward >::src = nullptr
private

Definition at line 739 of file SlicedGraphs.h.

◆ view

Definition at line 738 of file SlicedGraphs.h.


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