Static Value-Flow Analysis
Classes | Public Types | Public Member Functions | Static Protected Attributes | Private Attributes | Friends | List of all members
SVF::GenericEdge< NodeTy > Class Template Reference

#include <GenericGraph.h>

Inheritance diagram for SVF::GenericEdge< NodeTy >:
SVF::CDGEdge SVF::CFLEdge SVF::CHEdge SVF::ConstraintEdge SVF::ICFGEdge SVF::PTACallGraphEdge SVF::SVFStmt SVF::TCTEdge SVF::VFGEdge

Classes

struct  equalGEdge
 Add the hash function for std::set (we also can overload operator< to implement this) More...
 

Public Types

typedef NodeTy NodeType
 Node type. More...
 
typedef u64_t GEdgeFlag
 
typedef s64_t GEdgeKind
 
typedef struct SVF::GenericEdge::equalGEdge equalGEdge
 Add the hash function for std::set (we also can overload operator< to implement this) More...
 

Public Member Functions

 GenericEdge (NodeTy *s, NodeTy *d, GEdgeFlag k)
 Constructor. More...
 
virtual ~GenericEdge ()
 Destructor. More...
 
NodeID getSrcID () const
 get methods of the components More...
 
NodeID getDstID () const
 
GEdgeKind getEdgeKind () const
 
GEdgeKind getEdgeKindWithoutMask () const
 
NodeTypegetSrcNode () const
 
NodeTypegetDstNode () const
 
virtual bool operator== (const GenericEdge< NodeType > *rhs) const
 

Static Protected Attributes

static constexpr unsigned char EdgeKindMaskBits = 8
 We use the lower 8 bits to denote edge kind. More...
 
static constexpr u64_t EdgeKindMask = (~0ULL) >> (64 - EdgeKindMaskBits)
 

Private Attributes

NodeTy * src
 source node More...
 
NodeTy * dst
 destination node More...
 
GEdgeFlag edgeFlag
 edge kind More...
 

Friends

class SVFIRWriter
 
class SVFIRReader
 

Detailed Description

template<class NodeTy>
class SVF::GenericEdge< NodeTy >

Generic edge on the graph as base class

Definition at line 49 of file GenericGraph.h.

Member Typedef Documentation

◆ equalGEdge

template<class NodeTy >
typedef struct SVF::GenericEdge::equalGEdge SVF::GenericEdge< NodeTy >::equalGEdge

Add the hash function for std::set (we also can overload operator< to implement this)

◆ GEdgeFlag

template<class NodeTy >
typedef u64_t SVF::GenericEdge< NodeTy >::GEdgeFlag

Edge Flag Edge format as follows (from lowest bit): (1) 0-7 bits encode an edge kind (allow maximum 16 kinds) (2) 8-63 bits encode a callsite instruction

Definition at line 61 of file GenericGraph.h.

◆ GEdgeKind

template<class NodeTy >
typedef s64_t SVF::GenericEdge< NodeTy >::GEdgeKind

Definition at line 62 of file GenericGraph.h.

◆ NodeType

template<class NodeTy >
typedef NodeTy SVF::GenericEdge< NodeTy >::NodeType

Node type.

Definition at line 56 of file GenericGraph.h.

Constructor & Destructor Documentation

◆ GenericEdge()

template<class NodeTy >
SVF::GenericEdge< NodeTy >::GenericEdge ( NodeTy *  s,
NodeTy *  d,
GEdgeFlag  k 
)
inline

Constructor.

Definition at line 70 of file GenericGraph.h.

70  : src(s), dst(d), edgeFlag(k)
71  {
72  }
NodeTy * src
source node
Definition: GenericGraph.h:64
GEdgeFlag edgeFlag
edge kind
Definition: GenericGraph.h:66
NodeTy * dst
destination node
Definition: GenericGraph.h:65

◆ ~GenericEdge()

template<class NodeTy >
virtual SVF::GenericEdge< NodeTy >::~GenericEdge ( )
inlinevirtual

Destructor.

Definition at line 75 of file GenericGraph.h.

76  {
77  }

Member Function Documentation

◆ getDstID()

template<class NodeTy >
NodeID SVF::GenericEdge< NodeTy >::getDstID ( ) const
inline

Definition at line 85 of file GenericGraph.h.

86  {
87  return dst->getId();
88  }

◆ getDstNode()

template<class NodeTy >
NodeType* SVF::GenericEdge< NodeTy >::getDstNode ( ) const
inline

Definition at line 101 of file GenericGraph.h.

102  {
103  return dst;
104  }

◆ getEdgeKind()

template<class NodeTy >
GEdgeKind SVF::GenericEdge< NodeTy >::getEdgeKind ( ) const
inline

Definition at line 89 of file GenericGraph.h.

90  {
91  return (EdgeKindMask & edgeFlag);
92  }
static constexpr u64_t EdgeKindMask
Definition: GenericGraph.h:133

◆ getEdgeKindWithoutMask()

template<class NodeTy >
GEdgeKind SVF::GenericEdge< NodeTy >::getEdgeKindWithoutMask ( ) const
inline

Definition at line 93 of file GenericGraph.h.

94  {
95  return edgeFlag;
96  }

◆ getSrcID()

template<class NodeTy >
NodeID SVF::GenericEdge< NodeTy >::getSrcID ( ) const
inline

get methods of the components

Definition at line 81 of file GenericGraph.h.

82  {
83  return src->getId();
84  }

◆ getSrcNode()

template<class NodeTy >
NodeType* SVF::GenericEdge< NodeTy >::getSrcNode ( ) const
inline

Definition at line 97 of file GenericGraph.h.

98  {
99  return src;
100  }

◆ operator==()

template<class NodeTy >
virtual bool SVF::GenericEdge< NodeTy >::operator== ( const GenericEdge< NodeType > *  rhs) const
inlinevirtual

Definition at line 123 of file GenericGraph.h.

124  {
125  return (rhs->edgeFlag == this->edgeFlag &&
126  rhs->getSrcID() == this->getSrcID() &&
127  rhs->getDstID() == this->getDstID());
128  }

Friends And Related Function Documentation

◆ SVFIRReader

template<class NodeTy >
friend class SVFIRReader
friend

Definition at line 52 of file GenericGraph.h.

◆ SVFIRWriter

template<class NodeTy >
friend class SVFIRWriter
friend

Definition at line 51 of file GenericGraph.h.

Member Data Documentation

◆ dst

template<class NodeTy >
NodeTy* SVF::GenericEdge< NodeTy >::dst
private

destination node

Definition at line 65 of file GenericGraph.h.

◆ edgeFlag

template<class NodeTy >
GEdgeFlag SVF::GenericEdge< NodeTy >::edgeFlag
private

edge kind

Definition at line 66 of file GenericGraph.h.

◆ EdgeKindMask

template<class NodeTy >
constexpr u64_t SVF::GenericEdge< NodeTy >::EdgeKindMask = (~0ULL) >> (64 - EdgeKindMaskBits)
staticconstexprprotected

Definition at line 133 of file GenericGraph.h.

◆ EdgeKindMaskBits

template<class NodeTy >
constexpr unsigned char SVF::GenericEdge< NodeTy >::EdgeKindMaskBits = 8
staticconstexprprotected

We use the lower 8 bits to denote edge kind.

Definition at line 132 of file GenericGraph.h.

◆ src

template<class NodeTy >
NodeTy* SVF::GenericEdge< NodeTy >::src
private

source node

Definition at line 64 of file GenericGraph.h.


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