Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::VFGEdge Class Reference

#include <VFGEdge.h>

Inheritance diagram for SVF::VFGEdge:
SVF::GenericEdge< VFGNode > SVF::DirectSVFGEdge SVF::IndirectSVFGEdge SVF::CallDirSVFGEdge SVF::IntraDirSVFGEdge SVF::RetDirSVFGEdge SVF::CallIndSVFGEdge SVF::IntraIndSVFGEdge SVF::RetIndSVFGEdge SVF::ThreadMHPIndSVFGEdge

Public Types

enum  VFGEdgeK {
  IntraDirectVF , IntraIndirectVF , CallDirVF , RetDirVF ,
  CallIndVF , RetIndVF , TheadMHPIndirectVF
}
typedef VFGEdgeK SVFGEdgeK
typedef GenericNode< VFGNode, VFGEdge >::GEdgeSetTy VFGEdgeSetTy
typedef VFGEdgeSetTy SVFGEdgeSetTy
Public Types inherited from SVF::GenericEdge< VFGNode >
typedef VFGNode 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

 VFGEdge (VFGNode *s, VFGNode *d, GEdgeFlag k)
 Constructor.
 ~VFGEdge ()
 Destructor.
bool isDirectVFGEdge () const
 Get methods of the components.
bool isIndirectVFGEdge () const
bool isCallVFGEdge () const
bool isRetVFGEdge () const
bool isCallDirectVFGEdge () const
bool isRetDirectVFGEdge () const
bool isCallIndirectVFGEdge () const
bool isRetIndirectVFGEdge () const
bool isIntraVFGEdge () const
bool isThreadMHPIndirectVFGEdge () const
virtual const std::string toString () const
Public Member Functions inherited from SVF::GenericEdge< VFGNode >
 GenericEdge (VFGNode *s, VFGNode *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 Public Member Functions

static GEdgeFlag makeEdgeFlagWithInvokeID (GEdgeKind k, CallSiteID cs)
 Compute the unique edgeFlag value from edge kind and CallSiteID.

Friends

OutStream & operator<< (OutStream &o, const VFGEdge &edge)
 Overloading operator << for dumping ICFG node ID.

Additional Inherited Members

Static Protected Attributes inherited from SVF::GenericEdge< VFGNode >
static constexpr unsigned char EdgeKindMaskBits
 We use the lower 8 bits to denote edge kind.
static constexpr u64_t EdgeKindMask

Detailed Description

Definition at line 44 of file VFGEdge.h.

Member Typedef Documentation

◆ SVFGEdgeK

Definition at line 62 of file VFGEdge.h.

◆ SVFGEdgeSetTy

Definition at line 118 of file VFGEdge.h.

◆ VFGEdgeSetTy

Member Enumeration Documentation

◆ VFGEdgeK

seven types of ICFG edge four types of direct value-flow edges three types of indirect value-flow edges

Enumerator
IntraDirectVF 
IntraIndirectVF 
CallDirVF 
RetDirVF 
CallIndVF 
RetIndVF 
TheadMHPIndirectVF 

Definition at line 51 of file VFGEdge.h.

Constructor & Destructor Documentation

◆ VFGEdge()

SVF::VFGEdge::VFGEdge ( VFGNode * s,
VFGNode * d,
GEdgeFlag k )
inline

Constructor.

Definition at line 66 of file VFGEdge.h.

66 : GenericVFGEdgeTy(s,d,k)
67 {
68 }
GenericEdge< VFGNode > GenericVFGEdgeTy
Definition VFGEdge.h:43

◆ ~VFGEdge()

SVF::VFGEdge::~VFGEdge ( )
inline

Destructor.

Definition at line 70 of file VFGEdge.h.

71 {
72 }

Member Function Documentation

◆ isCallDirectVFGEdge()

bool SVF::VFGEdge::isCallDirectVFGEdge ( ) const
inline

Definition at line 92 of file VFGEdge.h.

93 {
94 return getEdgeKind() == CallDirVF;
95 }
GEdgeKind getEdgeKind() const

◆ isCallIndirectVFGEdge()

bool SVF::VFGEdge::isCallIndirectVFGEdge ( ) const
inline

Definition at line 100 of file VFGEdge.h.

101 {
102 return getEdgeKind() == CallIndVF;
103 }

◆ isCallVFGEdge()

bool SVF::VFGEdge::isCallVFGEdge ( ) const
inline

Definition at line 84 of file VFGEdge.h.

85 {
86 return getEdgeKind() == CallDirVF || getEdgeKind() == CallIndVF;
87 }

◆ isDirectVFGEdge()

bool SVF::VFGEdge::isDirectVFGEdge ( ) const
inline

Get methods of the components.

Definition at line 76 of file VFGEdge.h.

77 {
79 }

◆ isIndirectVFGEdge()

bool SVF::VFGEdge::isIndirectVFGEdge ( ) const
inline

Definition at line 80 of file VFGEdge.h.

◆ isIntraVFGEdge()

bool SVF::VFGEdge::isIntraVFGEdge ( ) const
inline

Definition at line 108 of file VFGEdge.h.

109 {
111 }

◆ isRetDirectVFGEdge()

bool SVF::VFGEdge::isRetDirectVFGEdge ( ) const
inline

Definition at line 96 of file VFGEdge.h.

97 {
98 return getEdgeKind() == RetDirVF;
99 }

◆ isRetIndirectVFGEdge()

bool SVF::VFGEdge::isRetIndirectVFGEdge ( ) const
inline

Definition at line 104 of file VFGEdge.h.

105 {
106 return getEdgeKind() == RetIndVF;
107 }

◆ isRetVFGEdge()

bool SVF::VFGEdge::isRetVFGEdge ( ) const
inline

Definition at line 88 of file VFGEdge.h.

89 {
90 return getEdgeKind() == RetDirVF || getEdgeKind() == RetIndVF;
91 }

◆ isThreadMHPIndirectVFGEdge()

bool SVF::VFGEdge::isThreadMHPIndirectVFGEdge ( ) const
inline

Definition at line 112 of file VFGEdge.h.

113 {
115 }

◆ makeEdgeFlagWithInvokeID()

GEdgeFlag SVF::VFGEdge::makeEdgeFlagWithInvokeID ( GEdgeKind k,
CallSiteID cs )
inlinestatic

Compute the unique edgeFlag value from edge kind and CallSiteID.

Definition at line 120 of file VFGEdge.h.

121 {
122 return (cs << EdgeKindMaskBits) | k;
123 }
static constexpr unsigned char EdgeKindMaskBits

◆ toString()

const std::string VFGEdge::toString ( ) const
virtual

Reimplemented in SVF::CallDirSVFGEdge, SVF::CallIndSVFGEdge, SVF::DirectSVFGEdge, SVF::IndirectSVFGEdge, SVF::IntraDirSVFGEdge, SVF::IntraIndSVFGEdge, SVF::RetDirSVFGEdge, SVF::RetIndSVFGEdge, and SVF::ThreadMHPIndSVFGEdge.

Definition at line 366 of file VFG.cpp.

367{
368 std::string str;
369 std::stringstream rawstr(str);
370 rawstr << "VFGEdge: [" << getDstID() << "<--" << getSrcID() << "]\t";
371 return rawstr.str();
372}

◆ operator<<

OutStream & operator<< ( OutStream & o,
const VFGEdge & edge )
friend

Overloading operator << for dumping ICFG node ID.

Definition at line 127 of file VFGEdge.h.

128 {
129 o << edge.toString();
130 return o;
131 }

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