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

#include <ICFGEdge.h>

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

 ICFGEdge (ICFGNode *s, ICFGNode *d, GEdgeFlag k)
 Constructor. More...
 
 ~ICFGEdge ()
 Destructor. More...
 
bool isCFGEdge () const
 Get methods of the components. More...
 
bool isCallCFGEdge () const
 
bool isRetCFGEdge () const
 
bool isIntraCFGEdge () 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

class SVFIRWriter
 
class SVFIRReader
 
OutStreamoperator<< (OutStream &o, const ICFGEdge &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 ICFGEdge.h.

Member Typedef Documentation

◆ ICFGEdgeSetTy

Definition at line 90 of file ICFGEdge.h.

◆ SVFGEdgeK

Definition at line 60 of file ICFGEdge.h.

◆ SVFGEdgeSetTy

Definition at line 91 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 53 of file ICFGEdge.h.

54  {
55  IntraCF,
56  CallCF,
57  RetCF,
58  };

Constructor & Destructor Documentation

◆ ICFGEdge()

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

Constructor.

Definition at line 64 of file ICFGEdge.h.

64  : GenericICFGEdgeTy(s, d, k)
65  {
66  }
GenericEdge< ICFGNode > GenericICFGEdgeTy
Definition: ICFGEdge.h:38

◆ ~ICFGEdge()

SVF::ICFGEdge::~ICFGEdge ( )
inline

Destructor.

Definition at line 68 of file ICFGEdge.h.

68 {}

Member Function Documentation

◆ isCallCFGEdge()

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

Definition at line 77 of file ICFGEdge.h.

78  {
79  return getEdgeKind() == CallCF;
80  }
GEdgeKind getEdgeKind() const
Definition: GenericGraph.h:89

◆ isCFGEdge()

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

Get methods of the components.

Definition at line 72 of file ICFGEdge.h.

73  {
74  return getEdgeKind() == IntraCF || getEdgeKind() == CallCF ||
75  getEdgeKind() == RetCF;
76  }

◆ isIntraCFGEdge()

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

Definition at line 85 of file ICFGEdge.h.

86  {
87  return getEdgeKind() == IntraCF;
88  }

◆ isRetCFGEdge()

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

Definition at line 81 of file ICFGEdge.h.

82  {
83  return getEdgeKind() == RetCF;
84  }

◆ makeEdgeFlagWithInvokeID()

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

Compute the unique edgeFlag value from edge kind and CallSiteID.

Definition at line 93 of file ICFGEdge.h.

94  {
95  return (cs << EdgeKindMaskBits) | k;
96  }
static constexpr unsigned char EdgeKindMaskBits
We use the lower 8 bits to denote edge kind.
Definition: GenericGraph.h:132

◆ toString()

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

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

Definition at line 157 of file ICFG.cpp.

158 {
159  std::string str;
160  std::stringstream rawstr(str);
161  rawstr << "ICFGEdge: [ICFGNode" << getDstID() << " <-- ICFGNode" << getSrcID() << "]\t";
162  return rawstr.str();
163 }
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 ICFGEdge edge 
)
friend

Overloading operator << for dumping ICFG node ID.

Definition at line 100 of file ICFGEdge.h.

101  {
102  o << edge.toString();
103  return o;
104  }

◆ SVFIRReader

friend class SVFIRReader
friend

Definition at line 47 of file ICFGEdge.h.

◆ SVFIRWriter

friend class SVFIRWriter
friend

Definition at line 46 of file ICFGEdge.h.


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