Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::SlicedICFGEdgeIterImpl< Forward > Class Template Reference

#include <SlicedGraphs.h>

Public Types

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

Public Member Functions

 SlicedICFGEdgeIterImpl ()=default
reference operator* () const
pointer operator-> () const
SlicedICFGNodeRef target () const
SlicedICFGEdgeIterImpl & operator++ ()
SlicedICFGEdgeIterImpl operator++ (int)

Static Public Member Functions

static SlicedICFGEdgeIterImpl begin (const SlicedICFGView *v, const ICFGNode *n)
static SlicedICFGEdgeIterImpl end (const SlicedICFGView *v, const ICFGNode *n)

Private Types

using EdgeIt = ICFGNode::const_iterator
using BrIt = OrderedSet<const ICFGNode*>::const_iterator

Private Member Functions

 SlicedICFGEdgeIterImpl (const SlicedICFGView *v, const ICFGNode *n)
void skipNonKeptReal ()
void refresh ()

Static Private Member Functions

static const OrderedSet< const ICFGNode * > & emptySet ()
static const ICFGNode * other (const ICFGEdge *e)

Private Attributes

const SlicedICFGView * view = nullptr
const ICFGNode * src = nullptr
EdgeIt realIt {}
EdgeIt realEnd {}
const OrderedSet< const ICFGNode * > * bridged = nullptr
BrIt brIt {}
BrIt brEnd {}
SlicedICFGEdgeRef cur {}

Friends

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

Detailed Description

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

Definition at line 428 of file SlicedGraphs.h.

Member Typedef Documentation

◆ BrIt

template<bool Forward>
using SVF::SlicedICFGEdgeIterImpl< Forward >::BrIt = OrderedSet<const ICFGNode*>::const_iterator
private

Definition at line 511 of file SlicedGraphs.h.

◆ difference_type

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

Definition at line 433 of file SlicedGraphs.h.

◆ EdgeIt

template<bool Forward>
using SVF::SlicedICFGEdgeIterImpl< Forward >::EdgeIt = ICFGNode::const_iterator
private

Definition at line 510 of file SlicedGraphs.h.

◆ iterator_category

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

Definition at line 431 of file SlicedGraphs.h.

◆ pointer

template<bool Forward>
using SVF::SlicedICFGEdgeIterImpl< Forward >::pointer = const SlicedICFGEdgeRef*

Definition at line 434 of file SlicedGraphs.h.

◆ reference

template<bool Forward>
using SVF::SlicedICFGEdgeIterImpl< Forward >::reference = const SlicedICFGEdgeRef&

Definition at line 435 of file SlicedGraphs.h.

◆ value_type

template<bool Forward>
using SVF::SlicedICFGEdgeIterImpl< Forward >::value_type = SlicedICFGEdgeRef

Definition at line 432 of file SlicedGraphs.h.

Constructor & Destructor Documentation

◆ SlicedICFGEdgeIterImpl() [1/2]

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

◆ SlicedICFGEdgeIterImpl() [2/2]

template<bool Forward>
SVF::SlicedICFGEdgeIterImpl< Forward >::SlicedICFGEdgeIterImpl ( const SlicedICFGView * v,
const ICFGNode * n )
inlineprivate

Definition at line 520 of file SlicedGraphs.h.

Member Function Documentation

◆ begin()

template<bool Forward>
SlicedICFGEdgeIterImpl SVF::SlicedICFGEdgeIterImpl< Forward >::begin ( const SlicedICFGView * v,
const ICFGNode * n )
inlinestatic

Definition at line 439 of file SlicedGraphs.h.

440 {
442 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
443 it.realIt = edges.begin();
444 it.realEnd = edges.end();
445 it.bridged = Forward ? v->bridgedSuccsOf(n) : v->bridgedPredsOf(n);
446 it.brIt = it.bridged ? it.bridged->begin() : emptySet().begin();
447 it.brEnd = it.bridged ? it.bridged->end() : emptySet().end();
449 it.refresh();
450 return it;
451 }
static SlicedICFGEdgeIterImpl begin(const SlicedICFGView *v, const ICFGNode *n)
static const OrderedSet< const ICFGNode * > & emptySet()
const OrderedSet< const ICFGNode * > * bridged
static SlicedICFGEdgeIterImpl end(const SlicedICFGView *v, const ICFGNode *n)

◆ emptySet()

template<bool Forward>
const OrderedSet< const ICFGNode * > & SVF::SlicedICFGEdgeIterImpl< Forward >::emptySet ( )
inlinestaticprivate

Definition at line 522 of file SlicedGraphs.h.

523 {
524 static const OrderedSet<const ICFGNode*> e;
525 return e;
526 }

◆ end()

template<bool Forward>
SlicedICFGEdgeIterImpl SVF::SlicedICFGEdgeIterImpl< Forward >::end ( const SlicedICFGView * v,
const ICFGNode * n )
inlinestatic

Definition at line 452 of file SlicedGraphs.h.

453 {
455 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
456 it.realIt = edges.end();
457 it.realEnd = edges.end();
458 it.bridged = Forward ? v->bridgedSuccsOf(n) : v->bridgedPredsOf(n);
459 it.brIt = it.bridged ? it.bridged->end() : emptySet().end();
460 it.brEnd = it.bridged ? it.bridged->end() : emptySet().end();
461 return it;
462 }

◆ operator*()

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

Definition at line 464 of file SlicedGraphs.h.

465 {
466 return cur;
467 }

◆ operator++() [1/2]

template<bool Forward>
SlicedICFGEdgeIterImpl & SVF::SlicedICFGEdgeIterImpl< Forward >::operator++ ( )
inline

Definition at line 479 of file SlicedGraphs.h.

480 {
481 if (realIt != realEnd)
482 {
483 ++realIt;
485 }
486 else if (brIt != brEnd)
487 {
488 ++brIt;
489 }
490 refresh();
491 return *this;
492 }

◆ operator++() [2/2]

template<bool Forward>
SlicedICFGEdgeIterImpl SVF::SlicedICFGEdgeIterImpl< Forward >::operator++ ( int )
inline

Definition at line 493 of file SlicedGraphs.h.

494 {
496 ++*this;
497 return t;
498 }

◆ operator->()

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

Definition at line 468 of file SlicedGraphs.h.

469 {
470 return &cur;
471 }

◆ other()

template<bool Forward>
const ICFGNode * SVF::SlicedICFGEdgeIterImpl< Forward >::other ( const ICFGEdge * e)
inlinestaticprivate

Definition at line 527 of file SlicedGraphs.h.

528 {
529 return Forward ? e->getDstNode() : e->getSrcNode();
530 }

◆ refresh()

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

Definition at line 535 of file SlicedGraphs.h.

536 {
537 if (realIt != realEnd)
538 {
539 const ICFGEdge* e = *realIt;
540 SlicedICFGNodeRef a{view, e->getSrcNode()}, b{view, e->getDstNode()};
541 cur = SlicedICFGEdgeRef{a, b, e, false};
542 }
543 else if (brIt != brEnd)
544 {
546 cur = Forward ? SlicedICFGEdgeRef{self, adj, nullptr, true}
547 :
548 SlicedICFGEdgeRef{adj, self, nullptr, true};
549 }
550 else
551 {
553 }
554 }

◆ skipNonKeptReal()

template<bool Forward>
void SVF::SlicedICFGEdgeIterImpl< Forward >::skipNonKeptReal ( )
inlineprivate

Definition at line 531 of file SlicedGraphs.h.

532 {
533 while (realIt != realEnd && !view->isKeptNode(other(*realIt))) ++realIt;
534 }
static const ICFGNode * other(const ICFGEdge *e)

◆ target()

template<bool Forward>
SlicedICFGNodeRef SVF::SlicedICFGEdgeIterImpl< Forward >::target ( ) const
inline

Definition at line 474 of file SlicedGraphs.h.

475 {
476 return Forward ? cur.dst : cur.src;
477 }

◆ operator!=

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

Definition at line 504 of file SlicedGraphs.h.

505 {
506 return !(a == b);
507 }

◆ operator==

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

Definition at line 500 of file SlicedGraphs.h.

501 {
502 return a.view == b.view && a.src == b.src && a.realIt == b.realIt && a.brIt == b.brIt;
503 }

Member Data Documentation

◆ brEnd

template<bool Forward>
BrIt SVF::SlicedICFGEdgeIterImpl< Forward >::brEnd {}
private

Definition at line 517 of file SlicedGraphs.h.

517{}, brEnd{};

◆ bridged

template<bool Forward>
const OrderedSet<const ICFGNode*>* SVF::SlicedICFGEdgeIterImpl< Forward >::bridged = nullptr
private

Definition at line 516 of file SlicedGraphs.h.

◆ brIt

template<bool Forward>
BrIt SVF::SlicedICFGEdgeIterImpl< Forward >::brIt {}
private

Definition at line 517 of file SlicedGraphs.h.

517{}, brEnd{};

◆ cur

template<bool Forward>
SlicedICFGEdgeRef SVF::SlicedICFGEdgeIterImpl< Forward >::cur {}
private

Definition at line 518 of file SlicedGraphs.h.

518{};

◆ realEnd

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

Definition at line 515 of file SlicedGraphs.h.

515{}, realEnd{};

◆ realIt

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

Definition at line 515 of file SlicedGraphs.h.

515{}, realEnd{};

◆ src

template<bool Forward>
const ICFGNode* SVF::SlicedICFGEdgeIterImpl< Forward >::src = nullptr
private

Definition at line 514 of file SlicedGraphs.h.

◆ view

template<bool Forward>
const SlicedICFGView* SVF::SlicedICFGEdgeIterImpl< Forward >::view = nullptr
private

Definition at line 513 of file SlicedGraphs.h.


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