Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
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
 
SlicedICFGEdgeIterImploperator++ ()
 
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 ICFGNodeother (const ICFGEdge *e)
 

Private Attributes

const SlicedICFGViewview = nullptr
 
const ICFGNodesrc = 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 444 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 527 of file SlicedGraphs.h.

◆ difference_type

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

Definition at line 449 of file SlicedGraphs.h.

◆ EdgeIt

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

Definition at line 526 of file SlicedGraphs.h.

◆ iterator_category

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

Definition at line 447 of file SlicedGraphs.h.

◆ pointer

Definition at line 450 of file SlicedGraphs.h.

◆ reference

Definition at line 451 of file SlicedGraphs.h.

◆ value_type

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

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

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

Member Function Documentation

◆ begin()

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

Definition at line 455 of file SlicedGraphs.h.

456 {
458 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
459 it.realIt = edges.begin();
460 it.realEnd = edges.end();
461 it.bridged = Forward ? v->bridgedSuccsOf(n) : v->bridgedPredsOf(n);
462 it.brIt = it.bridged ? it.bridged->begin() : emptySet().begin();
463 it.brEnd = it.bridged ? it.bridged->end() : emptySet().end();
464 it.skipNonKeptReal();
465 it.refresh();
466 return it;
467 }
static const OrderedSet< const ICFGNode * > & emptySet()

◆ emptySet()

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

Definition at line 538 of file SlicedGraphs.h.

539 {
540 static const OrderedSet<const ICFGNode*> e;
541 return e;
542 }

◆ end()

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

Definition at line 468 of file SlicedGraphs.h.

469 {
471 const auto& edges = Forward ? n->getOutEdges() : n->getInEdges();
472 it.realIt = edges.end();
473 it.realEnd = edges.end();
474 it.bridged = Forward ? v->bridgedSuccsOf(n) : v->bridgedPredsOf(n);
475 it.brIt = it.bridged ? it.bridged->end() : emptySet().end();
476 it.brEnd = it.bridged ? it.bridged->end() : emptySet().end();
477 return it;
478 }

◆ operator*()

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

Definition at line 480 of file SlicedGraphs.h.

481 {
482 return cur;
483 }

◆ operator++() [1/2]

Definition at line 495 of file SlicedGraphs.h.

496 {
497 if (realIt != realEnd)
498 {
499 ++realIt;
501 }
502 else if (brIt != brEnd)
503 {
504 ++brIt;
505 }
506 refresh();
507 return *this;
508 }

◆ operator++() [2/2]

Definition at line 509 of file SlicedGraphs.h.

510 {
511 SlicedICFGEdgeIterImpl t = *this;
512 ++*this;
513 return t;
514 }

◆ operator->()

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

Definition at line 484 of file SlicedGraphs.h.

485 {
486 return &cur;
487 }

◆ other()

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

Definition at line 543 of file SlicedGraphs.h.

544 {
545 return Forward ? e->getDstNode() : e->getSrcNode();
546 }

◆ refresh()

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

Definition at line 551 of file SlicedGraphs.h.

552 {
553 if (realIt != realEnd)
554 {
555 const ICFGEdge* e = *realIt;
556 SlicedICFGNodeRef a{view, e->getSrcNode()}, b{view, e->getDstNode()};
557 cur = SlicedICFGEdgeRef{a, b, e, false};
558 }
559 else if (brIt != brEnd)
560 {
562 cur = Forward ? SlicedICFGEdgeRef{self, adj, nullptr, true}
563 :
564 SlicedICFGEdgeRef{adj, self, nullptr, true};
565 }
566 else
567 {
568 cur = SlicedICFGEdgeRef{};
569 }
570 }
cJSON * a
Definition cJSON.cpp:2560
const cJSON *const b
Definition cJSON.h:255
SlicedNodeRef< SlicedICFGView, ICFGNode > SlicedICFGNodeRef

◆ skipNonKeptReal()

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

Definition at line 547 of file SlicedGraphs.h.

548 {
549 while (realIt != realEnd && !view->isKeptNode(other(*realIt))) ++realIt;
550 }
static const ICFGNode * other(const ICFGEdge *e)
bool isKeptNode(const ICFGNode *node) const
Check if a node is in the sliced view.

◆ target()

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

Definition at line 490 of file SlicedGraphs.h.

491 {
492 return Forward ? cur.dst : cur.src;
493 }
SlicedICFGNodeRef dst
SlicedICFGNodeRef src

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 520 of file SlicedGraphs.h.

521 {
522 return !(a == b);
523 }

◆ operator==

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

Definition at line 516 of file SlicedGraphs.h.

517 {
518 return a.view == b.view && a.src == b.src && a.realIt == b.realIt && a.brIt == b.brIt;
519 }

Member Data Documentation

◆ brEnd

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

Definition at line 533 of file SlicedGraphs.h.

533{}, brEnd{};

◆ bridged

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

Definition at line 532 of file SlicedGraphs.h.

◆ brIt

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

Definition at line 533 of file SlicedGraphs.h.

533{}, brEnd{};

◆ cur

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

Definition at line 534 of file SlicedGraphs.h.

534{};

◆ realEnd

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

Definition at line 531 of file SlicedGraphs.h.

531{}, realEnd{};

◆ realIt

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

Definition at line 531 of file SlicedGraphs.h.

531{}, realEnd{};

◆ src

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

Definition at line 530 of file SlicedGraphs.h.

◆ view

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

Definition at line 529 of file SlicedGraphs.h.


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