Static Value-Flow Analysis
Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
SVF::RetCFGEdge Class Reference

#include <ICFGEdge.h>

Inheritance diagram for SVF::RetCFGEdge:
SVF::ICFGEdge SVF::GenericEdge< NodeTy >

Public Member Functions

 RetCFGEdge (ICFGNode *s, ICFGNode *d)
 Constructor. More...
 
void addRetPE (const RetPE *ret)
 Add call parameter edge to this CallCFGEdge. More...
 
const RetPEgetRetPE () const
 Add get parameter edge to this CallCFGEdge. More...
 
const CallICFGNodegetCallSite () const
 Return call ICFGNode at the callsite. More...
 
virtual const std::string toString () const
 
- Public Member Functions inherited from SVF::ICFGEdge
 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
 
- 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 bool classof (const RetCFGEdge *)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
static bool classof (const ICFGEdge *edge)
 
static bool classof (const GenericICFGEdgeTy *edge)
 
- Static Public Member Functions inherited from SVF::ICFGEdge
static GEdgeFlag makeEdgeFlagWithInvokeID (GEdgeKind k, CallSiteID cs)
 Compute the unique edgeFlag value from edge kind and CallSiteID. More...
 

Private Attributes

const RetPEretPE
 

Friends

class SVFIRWriter
 
class SVFIRReader
 

Additional Inherited Members

- Public Types inherited from SVF::ICFGEdge
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...
 
- 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

Return ICFG edge representing parameter/return passing from a callee to a caller

Definition at line 233 of file ICFGEdge.h.

Constructor & Destructor Documentation

◆ RetCFGEdge()

SVF::RetCFGEdge::RetCFGEdge ( ICFGNode s,
ICFGNode d 
)
inline

Constructor.

Definition at line 243 of file ICFGEdge.h.

244  : ICFGEdge(s, d, RetCF), retPE(nullptr)
245  {
246  }
ICFGEdge(ICFGNode *s, ICFGNode *d, GEdgeFlag k)
Constructor.
Definition: ICFGEdge.h:64
const RetPE * retPE
Definition: ICFGEdge.h:239

Member Function Documentation

◆ addRetPE()

void SVF::RetCFGEdge::addRetPE ( const RetPE ret)
inline

Add call parameter edge to this CallCFGEdge.

Definition at line 248 of file ICFGEdge.h.

249  {
250  assert(!retPE && "we can only have one retPE for each RetCFGEdge");
251  retPE = ret;
252  }

◆ classof() [1/3]

static bool SVF::RetCFGEdge::classof ( const GenericICFGEdgeTy edge)
inlinestatic

Definition at line 271 of file ICFGEdge.h.

272  {
273  return edge->getEdgeKind() == RetCF;
274  }

◆ classof() [2/3]

static bool SVF::RetCFGEdge::classof ( const ICFGEdge edge)
inlinestatic

Definition at line 267 of file ICFGEdge.h.

268  {
269  return edge->getEdgeKind() == RetCF;
270  }

◆ classof() [3/3]

static bool SVF::RetCFGEdge::classof ( const RetCFGEdge )
inlinestatic

Methods for support type inquiry through isa, cast, and dyn_cast:

Definition at line 263 of file ICFGEdge.h.

264  {
265  return true;
266  }

◆ getCallSite()

const CallICFGNode * RetCFGEdge::getCallSite ( ) const

Return call ICFGNode at the callsite.

Definition at line 196 of file ICFG.cpp.

197 {
198  assert(SVFUtil::isa<RetICFGNode>(getDstNode()) && "not a RetICFGNode?");
199  return SVFUtil::cast<RetICFGNode>(getDstNode())->getCallICFGNode();
200 }
NodeType * getDstNode() const
Definition: GenericGraph.h:101

◆ getRetPE()

const RetPE* SVF::RetCFGEdge::getRetPE ( ) const
inline

Add get parameter edge to this CallCFGEdge.

Definition at line 254 of file ICFGEdge.h.

255  {
256  return retPE;
257  }

◆ toString()

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

Reimplemented from SVF::ICFGEdge.

Definition at line 186 of file ICFG.cpp.

187 {
188  std::string str;
189  std::stringstream rawstr(str);
190  rawstr << "RetCFGEdge " << " [ICFGNode";
191  rawstr << getDstID() << " <-- ICFGNode" << getSrcID() << "]\t CallSite: " << getDstNode()->toString() << "\t";
192  return rawstr.str();
193 }
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

◆ SVFIRReader

friend class SVFIRReader
friend

Definition at line 236 of file ICFGEdge.h.

◆ SVFIRWriter

friend class SVFIRWriter
friend

Definition at line 235 of file ICFGEdge.h.

Member Data Documentation

◆ retPE

const RetPE* SVF::RetCFGEdge::retPE
private

Definition at line 239 of file ICFGEdge.h.


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