Static Value-Flow Analysis
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
SVF::VFGEdge Class Reference

#include <VFGEdge.h>

Inheritance diagram for SVF::VFGEdge:
SVF::GenericEdge< NodeTy > 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< NodeTy >
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

 VFGEdge (VFGNode *s, VFGNode *d, GEdgeFlag k)
 Constructor. More...
 
 ~VFGEdge ()
 Destructor. More...
 
bool isDirectVFGEdge () const
 Get methods of the components. More...
 
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< NodeTy >
 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 Public Member Functions

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

Friends

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

Additional Inherited Members

- Static Protected Attributes inherited from SVF::GenericEdge< NodeTy >
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)
 

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

Definition at line 117 of file VFGEdge.h.

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.

52  {
55  CallDirVF,
56  RetDirVF,
57  CallIndVF,
58  RetIndVF,
60  };
@ IntraDirectVF
Definition: VFGEdge.h:53
@ IntraIndirectVF
Definition: VFGEdge.h:54
@ TheadMHPIndirectVF
Definition: VFGEdge.h:59

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:38

◆ ~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
Definition: GenericGraph.h:89

◆ 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.

81  {
83  }

◆ 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  {
114  return getEdgeKind() == TheadMHPIndirectVF;
115  }

◆ makeEdgeFlagWithInvokeID()

static 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
We use the lower 8 bits to denote edge kind.
Definition: GenericGraph.h:132

◆ toString()

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

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

Definition at line 379 of file VFG.cpp.

380 {
381  std::string str;
382  std::stringstream rawstr(str);
383  rawstr << "VFGEdge: [" << getDstID() << "<--" << getSrcID() << "]\t";
384  return rawstr.str();
385 }
const char *const string
Definition: cJSON.h:172
NodeID getDstID() const
Definition: GenericGraph.h:85
NodeID getSrcID() const
get methods of the components
Definition: GenericGraph.h:81

Friends And Related Function Documentation

◆ 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: