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

#include <ICFGEdge.h>

Inheritance diagram for SVF::ICFGEdge:
SVF::GenericEdge< ICFGNode > SVF::CallCFGEdge SVF::IntraCFGEdge SVF::RetCFGEdge

Public Types

enum  ICFGEdgeK { IntraCF , CallCF , RetCF }
typedef ICFGEdgeK SVFGEdgeK
typedef GenericNode< ICFGNode, ICFGEdge >::GEdgeSetTy ICFGEdgeSetTy
typedef ICFGEdgeSetTy SVFGEdgeSetTy
Public Types inherited from SVF::GenericEdge< ICFGNode >
typedef ICFGNode 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

 ICFGEdge (ICFGNode *s, ICFGNode *d, GEdgeFlag k)
 Constructor.
 ~ICFGEdge ()
 Destructor.
bool isCFGEdge () const
 Get methods of the components.
bool isCallCFGEdge () const
bool isRetCFGEdge () const
bool isIntraCFGEdge () const
virtual const std::string toString () const
Public Member Functions inherited from SVF::GenericEdge< ICFGNode >
 GenericEdge (ICFGNode *s, ICFGNode *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 ICFGEdge &edge)
 Overloading operator << for dumping ICFG node ID.

Additional Inherited Members

Static Protected Attributes inherited from SVF::GenericEdge< ICFGNode >
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 ICFGEdge.h.

Member Typedef Documentation

◆ ICFGEdgeSetTy

◆ SVFGEdgeK

Definition at line 58 of file ICFGEdge.h.

◆ SVFGEdgeSetTy

Definition at line 89 of file ICFGEdge.h.

Member Enumeration Documentation

◆ ICFGEdgeK

ten types of ICFG edge three types of control-flow edges seven types of value-flow edges

Enumerator
IntraCF 
CallCF 
RetCF 

Definition at line 51 of file ICFGEdge.h.

52 {
53 IntraCF,
54 CallCF,
55 RetCF,
56 };

Constructor & Destructor Documentation

◆ ICFGEdge()

SVF::ICFGEdge::ICFGEdge ( ICFGNode * s,
ICFGNode * d,
GEdgeFlag k )
inline

Constructor.

Definition at line 62 of file ICFGEdge.h.

62 : GenericICFGEdgeTy(s, d, k)
63 {
64 }
GenericEdge< ICFGNode > GenericICFGEdgeTy
Definition ICFGEdge.h:43

◆ ~ICFGEdge()

SVF::ICFGEdge::~ICFGEdge ( )
inline

Destructor.

Definition at line 66 of file ICFGEdge.h.

66{}

Member Function Documentation

◆ isCallCFGEdge()

bool SVF::ICFGEdge::isCallCFGEdge ( ) const
inline

Definition at line 75 of file ICFGEdge.h.

76 {
77 return getEdgeKind() == CallCF;
78 }
GEdgeKind getEdgeKind() const

◆ isCFGEdge()

bool SVF::ICFGEdge::isCFGEdge ( ) const
inline

Get methods of the components.

Definition at line 70 of file ICFGEdge.h.

71 {
72 return getEdgeKind() == IntraCF || getEdgeKind() == CallCF ||
73 getEdgeKind() == RetCF;
74 }

◆ isIntraCFGEdge()

bool SVF::ICFGEdge::isIntraCFGEdge ( ) const
inline

Definition at line 83 of file ICFGEdge.h.

84 {
85 return getEdgeKind() == IntraCF;
86 }

◆ isRetCFGEdge()

bool SVF::ICFGEdge::isRetCFGEdge ( ) const
inline

Definition at line 79 of file ICFGEdge.h.

80 {
81 return getEdgeKind() == RetCF;
82 }

◆ makeEdgeFlagWithInvokeID()

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

Compute the unique edgeFlag value from edge kind and CallSiteID.

Definition at line 91 of file ICFGEdge.h.

92 {
93 return (cs << EdgeKindMaskBits) | k;
94 }
static constexpr unsigned char EdgeKindMaskBits

◆ toString()

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

Reimplemented in SVF::CallCFGEdge, SVF::IntraCFGEdge, and SVF::RetCFGEdge.

Definition at line 155 of file ICFG.cpp.

156{
157 std::string str;
158 std::stringstream rawstr(str);
159 rawstr << "ICFGEdge: [ICFGNode" << getDstID() << " <-- ICFGNode" << getSrcID() << "]\t";
160 return rawstr.str();
161}

◆ operator<<

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

Overloading operator << for dumping ICFG node ID.

Definition at line 98 of file ICFGEdge.h.

99 {
100 o << edge.toString();
101 return o;
102 }

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