Static Value-Flow Analysis
Loading...
Searching...
No Matches
SVF::ICFGNode Class Reference

#include <ICFGNode.h>

Inheritance diagram for SVF::ICFGNode:
SVF::GenericNode< ICFGNode, ICFGEdge > SVF::SVFValue 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< ICFGNode, ICFGEdge >
typedef ICFGNode NodeType
typedef ICFGEdge 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::SVFValue
enum  GNodeK {
  IntraBlock , GlobalBlock , FunEntryBlock , FunExitBlock ,
  FunCallBlock , FunRetBlock , ValNode , ArgValNode ,
  FunValNode , GepValNode , RetValNode , VarargValNode ,
  GlobalValNode , ConstDataValNode , BlackHoleValNode , ConstFPValNode ,
  ConstIntValNode , ConstNullptrValNode , DummyValNode , IntrinsicValNode ,
  AsmPCValNode , ObjNode , GepObjNode , BaseObjNode ,
  FunObjNode , HeapObjNode , StackObjNode , GlobalObjNode ,
  ConstDataObjNode , ConstFPObjNode , ConstIntObjNode , ConstNullptrObjNode ,
  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 ,
  BasicBlockKd , OtherKd
}

Public Member Functions

 ICFGNode (NodeID i, GNodeK k)
 Constructor.
virtual const FunObjVar * getFun () const
 Return the function of this ICFGNode.
virtual const SVFBasicBlock * getBB () const
 Return the basic block of this ICFGNode.
virtual const std::string toString () const
void dump () const
void addVFGNode (const VFGNode *vfgNode)
const VFGNodeList & getVFGNodes () const
void addSVFStmt (const SVFStmt *edge)
const SVFStmtList & getSVFStmts () const
Public Member Functions inherited from SVF::GenericNode< ICFGNode, ICFGEdge >
 GenericNode (NodeID i, GNodeK k, const SVFType *svfType=nullptr)
 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)
EdgeType * hasIncomingEdge (EdgeType *edge) const
 Find incoming and outgoing edges.
EdgeType * hasOutgoingEdge (EdgeType *edge) const
const GEdgeSetTy & getOutEdges () const
const GEdgeSetTy & getInEdges () const
u32_t removeIncomingEdge (EdgeType *edge)
u32_t removeOutgoingEdge (EdgeType *edge)
Public Member Functions inherited from SVF::SVFValue
 SVFValue (NodeID i, GNodeK k, const SVFType *ty=nullptr)
NodeID getId () const
 Get ID.
GNodeK getNodeKind () const
 Get node kind.
virtual const SVFType * getType () const
virtual void setName (const std::string &nameInfo)
virtual void setName (std::string &&nameInfo)
virtual const std::string & getName () const
virtual void setSourceLoc (const std::string &sourceCodeInfo)
virtual const std::string getSourceLoc () const
const std::string valueOnlyToString () const
const bool hasLLVMValue () const

Static Public Member Functions

static bool classof (const ICFGNode *)
static bool classof (const GenericICFGNodeTy *node)
static bool classof (const SVFValue *node)
Static Public Member Functions inherited from SVF::GenericNode< ICFGNode, ICFGEdge >
static bool classof (const GenericNode< ICFGNode, ICFGEdge > *)
static bool classof (const SVFValue *)

Protected Attributes

const FunObjVar * fun
const SVFBasicBlock * bb
VFGNodeList VFGNodes
SVFStmtList pagEdges
Protected Attributes inherited from SVF::SVFValue
NodeID id
 Node ID.
GNodeK nodeKind
 Node kind.
const SVFType * type
 SVF type.
std::string name
std::string sourceLoc
 Source code information of this value.

Friends

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

Additional Inherited Members

Static Protected Member Functions inherited from SVF::SVFValue
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)

Detailed Description

Definition at line 55 of file ICFGNode.h.

Member Typedef Documentation

◆ CallPESet

Definition at line 62 of file ICFGNode.h.

◆ const_iterator

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

Definition at line 61 of file ICFGNode.h.

◆ ICFGNodeK

Definition at line 66 of file ICFGNode.h.

◆ iterator

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

Definition at line 60 of file ICFGNode.h.

◆ RetPESet

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

Definition at line 63 of file ICFGNode.h.

◆ SVFStmtList

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

Definition at line 65 of file ICFGNode.h.

◆ VFGNodeList

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

Definition at line 64 of file ICFGNode.h.

Constructor & Destructor Documentation

◆ ICFGNode()

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

Constructor.

Definition at line 70 of file ICFGNode.h.

70 : GenericICFGNodeTy(i, k), fun(nullptr), bb(nullptr)
71 {
72 }
const SVFBasicBlock * bb
Definition ICFGNode.h:146
const FunObjVar * fun
Definition ICFGNode.h:145
GenericNode< ICFGNode, ICFGEdge > GenericICFGNodeTy
Definition ICFGNode.h:53

Member Function Documentation

◆ addSVFStmt()

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

Set/Get methods of VFGNodes

Definition at line 111 of file ICFGNode.h.

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

◆ addVFGNode()

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

Set/Get methods of VFGNodes

Definition at line 98 of file ICFGNode.h.

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

◆ classof() [1/3]

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

Definition at line 134 of file ICFGNode.h.

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

◆ classof() [2/3]

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

Definition at line 129 of file ICFGNode.h.

130 {
131 return true;
132 }

◆ classof() [3/3]

bool SVF::ICFGNode::classof ( const SVFValue * node)
inlinestatic

Definition at line 139 of file ICFGNode.h.

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

◆ dump()

void ICFGNode::dump ( ) const

Definition at line 58 of file ICFG.cpp.

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

◆ getBB()

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

Return the basic block of this ICFGNode.

Definition at line 81 of file ICFGNode.h.

82 {
83 return bb;
84 }

◆ getFun()

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

Return the function of this ICFGNode.

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

Definition at line 75 of file ICFGNode.h.

76 {
77 return fun;
78 }

◆ getSVFStmts()

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

Definition at line 116 of file ICFGNode.h.

117 {
118 return pagEdges;
119 }

◆ getVFGNodes()

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

Definition at line 103 of file ICFGNode.h.

104 {
105 return VFGNodes;
106 }

◆ toString()

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

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

Definition at line 50 of file ICFG.cpp.

51{
52 std::string str;
53 std::stringstream rawstr(str);
54 rawstr << "ICFGNode" << getId();
55 return rawstr.str();
56}
NodeID getId() const
Get ID.
Definition SVFValue.h:158

◆ operator<<

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

Overloading operator << for dumping ICFG node ID.

Definition at line 89 of file ICFGNode.h.

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

Member Data Documentation

◆ bb

const SVFBasicBlock* SVF::ICFGNode::bb
protected

Definition at line 146 of file ICFGNode.h.

◆ fun

const FunObjVar* SVF::ICFGNode::fun
protected

Definition at line 145 of file ICFGNode.h.

◆ pagEdges

SVFStmtList SVF::ICFGNode::pagEdges
protected

Definition at line 148 of file ICFGNode.h.

◆ VFGNodes

VFGNodeList SVF::ICFGNode::VFGNodes
protected

Definition at line 147 of file ICFGNode.h.


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