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

#include <ICFGNode.h>

Inheritance diagram for SVF::ICFGNode:
SVF::GenericNode< NodeTy, EdgeTy > SVF::SVFBaseNode SVF::GlobalICFGNode SVF::InterICFGNode SVF::IntraICFGNode SVF::CallICFGNode SVF::FunEntryICFGNode SVF::FunExitICFGNode SVF::RetICFGNode

Public Types

typedef ICFGEdge::ICFGEdgeSetTy::iterator iterator
 
typedef ICFGEdge::ICFGEdgeSetTy::const_iterator const_iterator
 
typedef Set< const CallPE * > CallPESet
 
typedef Set< const RetPE * > RetPESet
 
typedef std::list< const VFGNode * > VFGNodeList
 
typedef std::list< const SVFStmt * > SVFStmtList
 
typedef GNodeK ICFGNodeK
 
- Public Types inherited from SVF::GenericNode< NodeTy, EdgeTy >
typedef NodeTy NodeType
 
typedef EdgeTy EdgeType
 
typedef OrderedSet< EdgeType *, typename EdgeType::equalGEdge > GEdgeSetTy
 Edge kind. More...
 
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 , GepValNode ,
  RetNode , VarargNode , DummyValNode , ObjNode ,
  GepObjNode , FIObjNode , 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
}
 

Public Member Functions

 ICFGNode (NodeID i, GNodeK k)
 Constructor. More...
 
virtual const SVFFunctiongetFun () const
 Return the function of this ICFGNode. More...
 
virtual const SVFBasicBlockgetBB () const
 Return the basic block of this ICFGNode. More...
 
virtual const std::string toString () const
 
void dump () const
 
void addVFGNode (const VFGNode *vfgNode)
 
const VFGNodeListgetVFGNodes () const
 
void addSVFStmt (const SVFStmt *edge)
 
const SVFStmtListgetSVFStmts () const
 
- Public Member Functions inherited from SVF::GenericNode< NodeTy, EdgeTy >
 GenericNode (NodeID i, GNodeK k)
 Constructor. More...
 
virtual ~GenericNode ()
 Destructor. More...
 
bool hasIncomingEdge () const
 Has incoming/outgoing edge set. More...
 
bool hasOutgoingEdge () const
 
iterator OutEdgeBegin ()
 iterators More...
 
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. More...
 
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. More...
 
bool addOutgoingEdge (EdgeType *outEdge)
 
EdgeTypehasIncomingEdge (EdgeType *edge) const
 Find incoming and outgoing edges. More...
 
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. More...
 
GNodeK getNodeKind () const
 Get node kind. More...
 
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 ICFGNode *)
 
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 *)
 

Protected Attributes

const SVFFunctionfun
 
const SVFBasicBlockbb
 
VFGNodeList VFGNodes
 
SVFStmtList pagEdges
 
- Protected Attributes inherited from SVF::SVFBaseNode
NodeID id
 Node ID. More...
 
GNodeK nodeKind
 Node kind. More...
 
const SVFTypetype
 SVF type. More...
 
std::string sourceLoc
 Source code information of this value. More...
 

Friends

class SVFIRWriter
 
class SVFIRReader
 
OutStreamoperator<< (OutStream &o, const ICFGNode &node)
 Overloading operator << for dumping ICFG node ID. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from SVF::SVFBaseNode
static bool isICFGNodeKinds (GNodeK n)
 Helper functions to check node kinds. More...
 
static bool isInterICFGNodeKind (GNodeK n)
 
static bool isSVFVarKind (GNodeK n)
 
static bool isValVarKinds (GNodeK n)
 
static bool isObjVarKinds (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)
 

Detailed Description

Definition at line 54 of file ICFGNode.h.

Member Typedef Documentation

◆ CallPESet

Definition at line 63 of file ICFGNode.h.

◆ const_iterator

typedef ICFGEdge::ICFGEdgeSetTy::const_iterator SVF::ICFGNode::const_iterator

Definition at line 62 of file ICFGNode.h.

◆ ICFGNodeK

Definition at line 67 of file ICFGNode.h.

◆ iterator

typedef ICFGEdge::ICFGEdgeSetTy::iterator SVF::ICFGNode::iterator

Definition at line 61 of file ICFGNode.h.

◆ RetPESet

typedef Set<const RetPE *> SVF::ICFGNode::RetPESet

Definition at line 64 of file ICFGNode.h.

◆ SVFStmtList

typedef std::list<const SVFStmt*> SVF::ICFGNode::SVFStmtList

Definition at line 66 of file ICFGNode.h.

◆ VFGNodeList

typedef std::list<const VFGNode*> SVF::ICFGNode::VFGNodeList

Definition at line 65 of file ICFGNode.h.

Constructor & Destructor Documentation

◆ ICFGNode()

SVF::ICFGNode::ICFGNode ( NodeID  i,
GNodeK  k 
)
inline

Constructor.

Definition at line 71 of file ICFGNode.h.

71  : GenericICFGNodeTy(i, k), fun(nullptr), bb(nullptr)
72  {
73  }
const SVFFunction * fun
Definition: ICFGNode.h:148
const SVFBasicBlock * bb
Definition: ICFGNode.h:149
GenericNode< ICFGNode, ICFGEdge > GenericICFGNodeTy
Definition: ICFGNode.h:46

Member Function Documentation

◆ addSVFStmt()

void SVF::ICFGNode::addSVFStmt ( const SVFStmt edge)
inline

Set/Get methods of VFGNodes

Definition at line 112 of file ICFGNode.h.

113  {
114  pagEdges.push_back(edge);
115  }
SVFStmtList pagEdges
Definition: ICFGNode.h:151

◆ addVFGNode()

void SVF::ICFGNode::addVFGNode ( const VFGNode vfgNode)
inline

Set/Get methods of VFGNodes

Definition at line 99 of file ICFGNode.h.

100  {
101  VFGNodes.push_back(vfgNode);
102  }
VFGNodeList VFGNodes
Definition: ICFGNode.h:150

◆ classof() [1/3]

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

Definition at line 135 of file ICFGNode.h.

136  {
137  return isICFGNodeKinds(node->getNodeKind());
138  }
static bool isICFGNodeKinds(GNodeK n)
Helper functions to check node kinds.
Definition: GenericGraph.h:298

◆ classof() [2/3]

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

Definition at line 130 of file ICFGNode.h.

131  {
132  return true;
133  }

◆ classof() [3/3]

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

Definition at line 140 of file ICFGNode.h.

141  {
142  return isICFGNodeKinds(node->getNodeKind());
143  }

◆ dump()

void ICFGNode::dump ( ) const

Definition at line 69 of file ICFG.cpp.

70 {
71  outs() << this->toString() << "\n";
72 }
virtual const std::string toString() const
Definition: ICFG.cpp:61
std::ostream & outs()
Overwrite llvm::outs()
Definition: SVFUtil.h:50

◆ getBB()

virtual const SVFBasicBlock* SVF::ICFGNode::getBB ( ) const
inlinevirtual

Return the basic block of this ICFGNode.

Definition at line 82 of file ICFGNode.h.

83  {
84  return bb;
85  }

◆ getFun()

virtual const SVFFunction* SVF::ICFGNode::getFun ( ) const
inlinevirtual

Return the function of this ICFGNode.

Reimplemented in SVF::FunExitICFGNode, and SVF::FunEntryICFGNode.

Definition at line 76 of file ICFGNode.h.

77  {
78  return fun;
79  }

◆ getSVFStmts()

const SVFStmtList& SVF::ICFGNode::getSVFStmts ( ) const
inline

Definition at line 117 of file ICFGNode.h.

118  {
119  return pagEdges;
120  }

◆ getVFGNodes()

const VFGNodeList& SVF::ICFGNode::getVFGNodes ( ) const
inline

Definition at line 104 of file ICFGNode.h.

105  {
106  return VFGNodes;
107  }

◆ toString()

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

Reimplemented in SVF::RetICFGNode, SVF::CallICFGNode, SVF::FunExitICFGNode, SVF::FunEntryICFGNode, SVF::IntraICFGNode, and SVF::GlobalICFGNode.

Definition at line 61 of file ICFG.cpp.

62 {
63  std::string str;
64  std::stringstream rawstr(str);
65  rawstr << "ICFGNode" << getId();
66  return rawstr.str();
67 }
const char *const string
Definition: cJSON.h:172
NodeID getId() const
Get ID.
Definition: GenericGraph.h:260

Friends And Related Function Documentation

◆ operator<<

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

Overloading operator << for dumping ICFG node ID.

Definition at line 90 of file ICFGNode.h.

91  {
92  o << node.toString();
93  return o;
94  }

◆ SVFIRReader

friend class SVFIRReader
friend

Definition at line 57 of file ICFGNode.h.

◆ SVFIRWriter

friend class SVFIRWriter
friend

Definition at line 56 of file ICFGNode.h.

Member Data Documentation

◆ bb

const SVFBasicBlock* SVF::ICFGNode::bb
protected

Definition at line 149 of file ICFGNode.h.

◆ fun

const SVFFunction* SVF::ICFGNode::fun
protected

Definition at line 148 of file ICFGNode.h.

◆ pagEdges

SVFStmtList SVF::ICFGNode::pagEdges
protected

Definition at line 151 of file ICFGNode.h.

◆ VFGNodes

VFGNodeList SVF::ICFGNode::VFGNodes
protected

Definition at line 150 of file ICFGNode.h.


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