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

#include <CFLGraph.h>

Inheritance diagram for SVF::CFLNode:
SVF::GenericNode< CFLNode, CFLEdge > SVF::SVFValue

Public Types

typedef std::map< GrammarBase::Symbol, CFLEdge::CFLEdgeSetTy > CFLEdgeDataTy
 Different Kind(label) associated edges set.
Public Types inherited from SVF::GenericNode< CFLNode, CFLEdge >
typedef CFLNode NodeType
typedef CFLEdge 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

 CFLNode (NodeID i=0, GNodeK k=CFLNodeKd)
 ~CFLNode () override=default
const CFLEdge::CFLEdgeSetTy & getInEdgeWithTy (GrammarBase::Symbol s)
const CFLEdge::CFLEdgeSetTy & getOutEdgeWithTy (GrammarBase::Symbol s)
bool addInEdgeWithKind (CFLEdge *inEdge, GrammarBase::Symbol s)
bool addIngoingEdge (CFLEdge *inEdge)
bool addOutEdgeWithKind (CFLEdge *outEdge, GrammarBase::Symbol s)
bool addOutgoingEdge (CFLEdge *OutEdge)
bool removeCFLInEdge (CFLEdge *inEdge)
bool removeCFLOutEdge (CFLEdge *outEdge)
Public Member Functions inherited from SVF::GenericNode< CFLNode, CFLEdge >
 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 CFLNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast:
static bool classof (const GenericICFGNodeTy *node)
static bool classof (const SVFValue *node)
Static Public Member Functions inherited from SVF::GenericNode< CFLNode, CFLEdge >
static bool classof (const GenericNode< CFLNode, CFLEdge > *)
static bool classof (const SVFValue *)

Private Attributes

CFLEdgeDataTy inCFLEdges
CFLEdgeDataTy outCFLEdges

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)
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.

Detailed Description

Definition at line 75 of file CFLGraph.h.

Member Typedef Documentation

◆ CFLEdgeDataTy

Different Kind(label) associated edges set.

Definition at line 86 of file CFLGraph.h.

Constructor & Destructor Documentation

◆ CFLNode()

SVF::CFLNode::CFLNode ( NodeID i = 0,
GNodeK k = CFLNodeKd )
inline

Definition at line 78 of file CFLGraph.h.

78 :
80 {
81 }
GenericNode< CFLNode, CFLEdge > GenericCFLNodeTy
Definition CFLGraph.h:74

◆ ~CFLNode()

SVF::CFLNode::~CFLNode ( )
overridedefault

Member Function Documentation

◆ addInEdgeWithKind()

bool SVF::CFLNode::addInEdgeWithKind ( CFLEdge * inEdge,
GrammarBase::Symbol s )
inline

Definition at line 103 of file CFLGraph.h.

104 {
105 assert(inEdge->getDstID() == this->getId());
106 bool added1 = GenericNode::addIncomingEdge(inEdge);
107 bool added2 = inCFLEdges[s].insert(inEdge).second;
108
109 return added1 && added2;
110 }
CFLEdgeDataTy inCFLEdges
Definition CFLGraph.h:89
bool addIncomingEdge(EdgeType *inEdge)
Add incoming and outgoing edges.

◆ addIngoingEdge()

bool SVF::CFLNode::addIngoingEdge ( CFLEdge * inEdge)
inline

Definition at line 112 of file CFLGraph.h.

113 {
114 return addInEdgeWithKind(inEdge, inEdge->getEdgeKind());
115 }
bool addInEdgeWithKind(CFLEdge *inEdge, GrammarBase::Symbol s)
Definition CFLGraph.h:103

◆ addOutEdgeWithKind()

bool SVF::CFLNode::addOutEdgeWithKind ( CFLEdge * outEdge,
GrammarBase::Symbol s )
inline

Definition at line 117 of file CFLGraph.h.

118 {
119 assert(outEdge->getSrcID() == this->getId());
120 bool added1 = GenericNode::addOutgoingEdge(outEdge);
121 bool added2 = outCFLEdges[s].insert(outEdge).second;
122
123 return added1 && added2;
124 }
CFLEdgeDataTy outCFLEdges
Definition CFLGraph.h:90
bool addOutgoingEdge(EdgeType *outEdge)

◆ addOutgoingEdge()

bool SVF::CFLNode::addOutgoingEdge ( CFLEdge * OutEdge)
inline

Definition at line 126 of file CFLGraph.h.

127 {
128 return addOutEdgeWithKind(OutEdge, OutEdge->getEdgeKind());
129 }
bool addOutEdgeWithKind(CFLEdge *outEdge, GrammarBase::Symbol s)
Definition CFLGraph.h:117

◆ classof() [1/3]

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

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

Definition at line 153 of file CFLGraph.h.

154 {
155 return true;
156 }

◆ classof() [2/3]

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

Definition at line 158 of file CFLGraph.h.

159 {
160 return node->getNodeKind() == CFLNodeKd;
161 }

◆ classof() [3/3]

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

Definition at line 163 of file CFLGraph.h.

164 {
165 return node->getNodeKind() == CFLNodeKd;
166 }

◆ getInEdgeWithTy()

const CFLEdge::CFLEdgeSetTy & SVF::CFLNode::getInEdgeWithTy ( GrammarBase::Symbol s)
inline

Definition at line 93 of file CFLGraph.h.

94 {
95 return inCFLEdges[s];
96 }

◆ getOutEdgeWithTy()

const CFLEdge::CFLEdgeSetTy & SVF::CFLNode::getOutEdgeWithTy ( GrammarBase::Symbol s)
inline

Definition at line 98 of file CFLGraph.h.

99 {
100 return outCFLEdges[s];
101 }

◆ removeCFLInEdge()

bool SVF::CFLNode::removeCFLInEdge ( CFLEdge * inEdge)
inline

Definition at line 131 of file CFLGraph.h.

132 {
133 u32_t num1 = removeIncomingEdge(inEdge);
134
135 GrammarBase::Symbol s = inEdge->getEdgeKind();
136 u32_t num2 = inCFLEdges[s].erase(inEdge);
137
138 return num1 && num2;
139 }
u32_t removeIncomingEdge(EdgeType *edge)
struct SVF::GrammarBase::Symbol Symbol
unsigned u32_t
Definition GeneralType.h:67

◆ removeCFLOutEdge()

bool SVF::CFLNode::removeCFLOutEdge ( CFLEdge * outEdge)
inline

Definition at line 141 of file CFLGraph.h.

142 {
143 u32_t num1 = removeOutgoingEdge(outEdge);
144
145 GrammarBase::Symbol s = outEdge->getEdgeKind();
146 u32_t num2 = outCFLEdges[s].erase(outEdge);
147
148 return num1 && num2;
149 }
u32_t removeOutgoingEdge(EdgeType *edge)

Member Data Documentation

◆ inCFLEdges

CFLEdgeDataTy SVF::CFLNode::inCFLEdges
private

Definition at line 89 of file CFLGraph.h.

◆ outCFLEdges

CFLEdgeDataTy SVF::CFLNode::outCFLEdges
private

Definition at line 90 of file CFLGraph.h.


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