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

#include <CallGraph.h>

Inheritance diagram for SVF::CallGraphNode:
SVF::GenericNode< NodeTy, EdgeTy > SVF::SVFBaseNode

Public Member Functions

 CallGraphNode (NodeID i, const SVFFunction *f)
 Constructor.
 
const std::string & getName () const
 
const SVFFunctiongetFunction () const
 Get function of this call node.
 
virtual const std::string toString () const
 
- Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
 GenericNode (NodeID i, GNodeK k)
 Constructor.
 
virtual ~GenericNode ()
 Destructor.
 
bool hasIncomingEdge () const
 Has incoming/outgoing edge set.
 
bool hasOutgoingEdge () const
 
iterator OutEdgeBegin ()
 iterators
 
iterator OutEdgeEnd ()
 
iterator InEdgeBegin ()
 
iterator InEdgeEnd ()
 
const_iterator OutEdgeBegin () const
 
const_iterator OutEdgeEnd () const
 
const_iterator InEdgeBegin () const
 
const_iterator InEdgeEnd () const
 
virtual iterator directOutEdgeBegin ()
 Iterators used for SCC detection, overwrite it in child class if necessary.
 
virtual iterator directOutEdgeEnd ()
 
virtual iterator directInEdgeBegin ()
 
virtual iterator directInEdgeEnd ()
 
virtual const_iterator directOutEdgeBegin () const
 
virtual const_iterator directOutEdgeEnd () const
 
virtual const_iterator directInEdgeBegin () const
 
virtual const_iterator directInEdgeEnd () const
 
bool addIncomingEdge (EdgeType *inEdge)
 Add incoming and outgoing edges.
 
bool addOutgoingEdge (EdgeType *outEdge)
 
EdgeTypehasIncomingEdge (EdgeType *edge) const
 Find incoming and outgoing edges.
 
EdgeTypehasOutgoingEdge (EdgeType *edge) const
 
const GEdgeSetTygetOutEdges () const
 
const GEdgeSetTygetInEdges () const
 
u32_t removeIncomingEdge (EdgeType *edge)
 
u32_t removeOutgoingEdge (EdgeType *edge)
 
- Public Member Functions inherited from SVF::SVFBaseNode
 SVFBaseNode (NodeID i, GNodeK k, SVFType *ty=nullptr)
 
NodeID getId () const
 Get ID.
 
GNodeK getNodeKind () const
 Get node kind.
 
virtual const SVFTypegetType () const
 
virtual void setSourceLoc (const std::string &sourceCodeInfo)
 
virtual const std::string getSourceLoc () const
 
const std::string valueOnlyToString () const
 

Static Public Member Functions

static bool classof (const CallGraphNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
 
static bool classof (const GenericICFGNodeTy *node)
 
static bool classof (const SVFBaseNode *node)
 
- Static Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
static bool classof (const GenericNode< NodeTy, EdgeTy > *)
 
static bool classof (const SVFBaseNode *)
 

Private Attributes

const SVFFunctionfun
 

Friends

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

Additional Inherited Members

- Public Types inherited from SVF::GenericNode< NodeTy, EdgeTy >
typedef NodeTy NodeType
 
typedef EdgeTy EdgeType
 
typedef OrderedSet< EdgeType *, typename EdgeType::equalGEdge > GEdgeSetTy
 Edge kind.
 
typedef GEdgeSetTy::iterator iterator
 
typedef GEdgeSetTy::const_iterator const_iterator
 
- Public Types inherited from SVF::SVFBaseNode
enum  GNodeK {
  IntraBlock , GlobalBlock , FunEntryBlock , FunExitBlock ,
  FunCallBlock , FunRetBlock , ValNode , FunValNode ,
  GepValNode , RetNode , VarargNode , GlobalValNode ,
  ConstantDataValNode , BlackHoleNode , ConstantFPValNode , ConstantIntValNode ,
  ConstantNullptrValNode , DummyValNode , ObjNode , GepObjNode ,
  BaseObjNode , FunObjNode , HeapObjNode , StackObjNode ,
  GlobalObjNode , ConstantDataObjNode , ConstantFPObjNode , ConstantIntObjNode ,
  ConstantNullptrObjNode , DummyObjNode , Cmp , BinaryOp ,
  UnaryOp , Branch , DummyVProp , NPtr ,
  FRet , ARet , AParm , FParm ,
  Addr , Copy , Gep , Store ,
  Load , TPhi , TIntraPhi , TInterPhi ,
  FPIN , FPOUT , APIN , APOUT ,
  MPhi , MIntraPhi , MInterPhi , CallNodeKd ,
  CDNodeKd , CFLNodeKd , CHNodeKd , ConstraintNodeKd ,
  TCTNodeKd , DCHNodeKd , OtherKd
}
 
- Static Protected Member Functions inherited from SVF::SVFBaseNode
static bool isICFGNodeKinds (GNodeK n)
 Helper functions to check node kinds.
 
static bool isInterICFGNodeKind (GNodeK n)
 
static bool isSVFVarKind (GNodeK n)
 
static bool isValVarKinds (GNodeK n)
 
static bool isConstantDataValVar (GNodeK n)
 
static bool isObjVarKinds (GNodeK n)
 
static bool isBaseObjVarKinds (GNodeK n)
 
static bool isConstantDataObjVarKinds (GNodeK n)
 
static bool isVFGNodeKinds (GNodeK n)
 
static bool isArgumentVFGNodeKinds (GNodeK n)
 
static bool isStmtVFGNodeKinds (GNodeK n)
 
static bool isPHIVFGNodeKinds (GNodeK n)
 
static bool isMRSVFGNodeKinds (GNodeK n)
 
static bool isMSSAPHISVFGNodeKinds (GNodeK n)
 
- Protected Attributes inherited from SVF::SVFBaseNode
NodeID id
 Node ID.
 
GNodeK nodeKind
 Node kind.
 
const SVFTypetype
 SVF type.
 
std::string sourceLoc
 Source code information of this value.
 

Detailed Description

Definition at line 114 of file CallGraph.h.

Constructor & Destructor Documentation

◆ CallGraphNode()

SVF::CallGraphNode::CallGraphNode ( NodeID  i,
const SVFFunction f 
)
inline

Constructor.

Definition at line 121 of file CallGraph.h.

122 {
123 }
const SVFFunction * fun
Definition CallGraph.h:117
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74
GenericNode< CallGraphNode, CallGraphEdge > GenericCallGraphNodeTy
Definition CallGraph.h:113

Member Function Documentation

◆ classof() [1/3]

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

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

Definition at line 150 of file CallGraph.h.

151 {
152 return true;
153 }

◆ classof() [2/3]

static bool SVF::CallGraphNode::classof ( const GenericICFGNodeTy node)
inlinestatic

Definition at line 155 of file CallGraph.h.

156 {
157 return node->getNodeKind() == CallNodeKd;
158 }

◆ classof() [3/3]

static bool SVF::CallGraphNode::classof ( const SVFBaseNode node)
inlinestatic

Definition at line 160 of file CallGraph.h.

161 {
162 return node->getNodeKind() == CallNodeKd;
163 }

◆ getFunction()

const SVFFunction * SVF::CallGraphNode::getFunction ( ) const
inline

Get function of this call node.

Definition at line 131 of file CallGraph.h.

132 {
133 return fun;
134 }

◆ getName()

const std::string & SVF::CallGraphNode::getName ( ) const
inline

Definition at line 125 of file CallGraph.h.

126 {
127 return fun->getName();
128 }
const std::string & getName() const
Definition SVFValue.h:243

◆ toString()

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

Definition at line 60 of file CallGraph.cpp.

61{
62 std::string str;
63 std::stringstream rawstr(str);
64 rawstr << "CallGraphNode ID: " << getId() << " {fun: " << fun->getName() << "}";
65 return rawstr.str();
66}
NodeID getId() const
Get ID.

Friends And Related Symbol Documentation

◆ operator<<

OutStream & operator<< ( OutStream o,
const CallGraphNode node 
)
friend

Overloading operator << for dumping ICFG node ID.

Definition at line 139 of file CallGraph.h.

140 {
141 o << node.toString();
142 return o;
143 }

Member Data Documentation

◆ fun

const SVFFunction* SVF::CallGraphNode::fun
private

Definition at line 117 of file CallGraph.h.


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