Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
SVF::CallGraphEdge Class Reference

#include <CallGraph.h>

Inheritance diagram for SVF::CallGraphEdge:
SVF::GenericEdge< NodeTy >

Public Types

typedef Set< const CallICFGNode * > CallInstSet
 
typedef GenericNode< CallGraphNode, CallGraphEdge >::GEdgeSetTy CallGraphEdgeSet
 
- Public Types inherited from SVF::GenericEdge< NodeTy >
typedef NodeTy 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

 CallGraphEdge (CallGraphNode *s, CallGraphNode *d, const CallICFGNode *icfgNode)
 Constructor.
 
virtual ~CallGraphEdge ()
 Destructor.
 
void addDirectCallSite (const CallICFGNode *call)
 Add direct callsite.
 
CallInstSet::const_iterator directCallsBegin () const
 Iterators for direct and indirect callsites.
 
CallInstSet::const_iterator directCallsEnd () const
 
virtual const std::string toString () const
 
- Public Member Functions inherited from SVF::GenericEdge< NodeTy >
 GenericEdge (NodeTy *s, NodeTy *d, GEdgeFlag k)
 Constructor.
 
virtual ~GenericEdge ()
 Destructor.
 
NodeID getSrcID () const
 get methods of the components
 
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 CallGraphEdge *)
 ClassOf.
 

Private Attributes

CallInstSet directCalls
 

Friends

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

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.
 
static constexpr u64_t EdgeKindMask = (~0ULL) >> (64 - EdgeKindMaskBits)
 

Detailed Description

Definition at line 51 of file CallGraph.h.

Member Typedef Documentation

◆ CallGraphEdgeSet

Definition at line 106 of file CallGraph.h.

◆ CallInstSet

Definition at line 55 of file CallGraph.h.

Constructor & Destructor Documentation

◆ CallGraphEdge()

SVF::CallGraphEdge::CallGraphEdge ( CallGraphNode s,
CallGraphNode d,
const CallICFGNode icfgNode 
)
inline

Constructor.

Definition at line 61 of file CallGraph.h.

61 :
62 GenericCallGraphEdgeTy(s, d, icfgNode->getId())
63 {
64 }
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74
GenericEdge< CallGraphNode > GenericCallGraphEdgeTy
Definition CallGraph.h:50

◆ ~CallGraphEdge()

virtual SVF::CallGraphEdge::~CallGraphEdge ( )
inlinevirtual

Destructor.

Definition at line 66 of file CallGraph.h.

67 {
68 }

Member Function Documentation

◆ addDirectCallSite()

void CallGraphEdge::addDirectCallSite ( const CallICFGNode call)

Add direct callsite.

Definition at line 43 of file CallGraph.cpp.

44{
45 assert(call->getCalledFunction() && "not a direct callsite??");
46 directCalls.insert(call);
47}
CallInstSet directCalls
Definition CallGraph.h:58
const SVFFunction * getCalledFunction() const
Definition ICFGNode.h:518

◆ classof()

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

ClassOf.

Definition at line 89 of file CallGraph.h.

90 {
91 return true;
92 }

◆ directCallsBegin()

CallInstSet::const_iterator SVF::CallGraphEdge::directCallsBegin ( ) const
inline

Iterators for direct and indirect callsites.

Definition at line 77 of file CallGraph.h.

78 {
79 return directCalls.begin();
80 }

◆ directCallsEnd()

CallInstSet::const_iterator SVF::CallGraphEdge::directCallsEnd ( ) const
inline

Definition at line 81 of file CallGraph.h.

82 {
83 return directCalls.end();
84 }

◆ toString()

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

Definition at line 50 of file CallGraph.cpp.

51{
52 std::string str;
53 std::stringstream rawstr(str);
54 rawstr << "CallICFGNode ID: " << getEdgeKindWithoutMask();
55 rawstr << "direct call";
56 rawstr << "[" << getDstID() << "<--" << getSrcID() << "]\t";
57 return rawstr.str();
58}
GEdgeKind getEdgeKindWithoutMask() const
NodeID getDstID() const
NodeID getSrcID() const
get methods of the components

Friends And Related Symbol Documentation

◆ operator<<

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

Overloading operator << for dumping ICFG node ID.

Definition at line 97 of file CallGraph.h.

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

Member Data Documentation

◆ directCalls

CallInstSet SVF::CallGraphEdge::directCalls
private

Definition at line 58 of file CallGraph.h.


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