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

Member Typedef Documentation

◆ difference_type

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

Definition at line 688 of file SlicedGraphs.h.

◆ EdgeIt

Definition at line 753 of file SlicedGraphs.h.

◆ iterator_category

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

Definition at line 686 of file SlicedGraphs.h.

◆ pointer

Definition at line 689 of file SlicedGraphs.h.

◆ reference

Definition at line 690 of file SlicedGraphs.h.

◆ value_type

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

759: 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 694 of file SlicedGraphs.h.

695 {
697 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
698 it.realIt = edges.begin();
699 it.realEnd = edges.end();
700 it.skipNonKept();
701 it.refresh();
702 return it;
703 }

◆ end()

Definition at line 704 of file SlicedGraphs.h.

705 {
707 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
708 it.realIt = edges.end();
709 it.realEnd = edges.end();
710 return it;
711 }

◆ operator*()

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

Definition at line 713 of file SlicedGraphs.h.

714 {
715 return cur;
716 }
SlicedCallGraphEdgeRef cur

◆ operator++() [1/2]

Definition at line 726 of file SlicedGraphs.h.

727 {
728 if (realIt != realEnd)
729 {
730 ++realIt;
731 skipNonKept();
732 }
733 refresh();
734 return *this;
735 }

◆ operator++() [2/2]

Definition at line 736 of file SlicedGraphs.h.

737 {
738 SlicedCGEdgeIterImpl t = *this;
739 ++*this;
740 return t;
741 }

◆ operator->()

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

Definition at line 717 of file SlicedGraphs.h.

718 {
719 return &cur;
720 }

◆ refresh()

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

Definition at line 765 of file SlicedGraphs.h.

766 {
767 if (realIt != realEnd)
768 {
769 const CallGraphEdge* e = *realIt;
770 cur = SlicedCallGraphEdgeRef{{view, e->getSrcNode()}, {view, e->getDstNode()}, e};
771 }
772 else
773 {
774 cur = SlicedCallGraphEdgeRef{};
775 }
776 }

◆ skipNonKept()

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

Definition at line 761 of file SlicedGraphs.h.

762 {
763 while (realIt != realEnd && !view->isKeptEdge(*realIt)) ++realIt;
764 }
bool isKeptEdge(const CallGraphEdge *e) const

◆ target()

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

Definition at line 721 of file SlicedGraphs.h.

722 {
723 return Forward ? cur.dst : cur.src;
724 }
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 747 of file SlicedGraphs.h.

748 {
749 return !(a == b);
750 }
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 743 of file SlicedGraphs.h.

744 {
745 return a.view == b.view && a.src == b.src && a.realIt == b.realIt;
746 }

Member Data Documentation

◆ cur

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

Definition at line 757 of file SlicedGraphs.h.

757{};

◆ realEnd

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

Definition at line 756 of file SlicedGraphs.h.

756{}, realEnd{};

◆ realIt

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

Definition at line 756 of file SlicedGraphs.h.

756{}, realEnd{};

◆ src

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

Definition at line 755 of file SlicedGraphs.h.

◆ view

Definition at line 754 of file SlicedGraphs.h.


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