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

#include <GenericGraph.h>

Inheritance diagram for SVF::GenericEdge< NodeTy >:
SVF::BasicBlockEdge SVF::CDGEdge SVF::CFLEdge SVF::CHEdge SVF::CallGraphEdge SVF::ConstraintEdge SVF::ICFGEdge 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.
 
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)
 

Public Member Functions

 GenericEdge (NodeTy *s, NodeTy *d, GEdgeFlag k)
 Constructor.
 
virtual ~GenericEdge ()
 Destructor.
 
NodeID getSrcID () const
 get methods of the components
 
NodeID getDstID () const
 
GEdgeKind getEdgeKind () const
 
GEdgeKind getEdgeKindWithoutMask () const
 
NodeType * getSrcNode () const
 
NodeType * getDstNode () 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.
 
static constexpr u64_t EdgeKindMask = (~0ULL) >> (64 - EdgeKindMaskBits)
 

Private Attributes

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

Detailed Description

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

Generic edge on the graph as base class

Definition at line 50 of file GenericGraph.h.

Member Typedef Documentation

◆ 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 60 of file GenericGraph.h.

◆ GEdgeKind

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

Definition at line 61 of file GenericGraph.h.

◆ NodeType

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

Node type.

Definition at line 55 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 69 of file GenericGraph.h.

69 : src(s), dst(d), edgeFlag(k)
70 {
71 }
NodeTy * src
source node
GEdgeFlag edgeFlag
edge kind
NodeTy * dst
destination node
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

◆ ~GenericEdge()

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

Destructor.

Definition at line 74 of file GenericGraph.h.

75 {
76 }

Member Function Documentation

◆ getDstID()

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

Definition at line 84 of file GenericGraph.h.

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

◆ getDstNode()

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

Definition at line 100 of file GenericGraph.h.

101 {
102 return dst;
103 }

◆ getEdgeKind()

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

Definition at line 88 of file GenericGraph.h.

89 {
90 return (EdgeKindMask & edgeFlag);
91 }
static constexpr u64_t EdgeKindMask

◆ getEdgeKindWithoutMask()

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

Definition at line 92 of file GenericGraph.h.

93 {
94 return edgeFlag;
95 }

◆ getSrcID()

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

get methods of the components

Definition at line 80 of file GenericGraph.h.

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

◆ getSrcNode()

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

Definition at line 96 of file GenericGraph.h.

97 {
98 return src;
99 }

◆ operator==()

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

Definition at line 122 of file GenericGraph.h.

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

Member Data Documentation

◆ dst

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

destination node

Definition at line 64 of file GenericGraph.h.

◆ edgeFlag

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

edge kind

Definition at line 65 of file GenericGraph.h.

◆ EdgeKindMask

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

Definition at line 132 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 131 of file GenericGraph.h.

◆ src

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

source node

Definition at line 63 of file GenericGraph.h.


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