Static Value-Flow Analysis
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
SVF::CFLNode Class Reference

#include <CFLGraph.h>

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

Public Types

typedef std::map< GrammarBase::Symbol, CFLEdge::CFLEdgeSetTyCFLEdgeDataTy
 Different Kind(label) associated edges set. More...
 
- Public Types inherited from SVF::GenericNode< CFLNode, CFLEdge >
typedef CFLNode NodeType
 
typedef CFLEdge EdgeType
 
typedef OrderedSet< EdgeType *, typename EdgeType::equalGEdgeGEdgeSetTy
 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

 CFLNode (NodeID i=0, GNodeK k=CFLNodeKd)
 
 ~CFLNode () override=default
 
const CFLEdge::CFLEdgeSetTygetInEdgeWithTy (GrammarBase::Symbol s)
 
const CFLEdge::CFLEdgeSetTygetOutEdgeWithTy (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)
 Constructor. More...
 
virtual ~GenericNode ()
 Destructor. More...
 
bool hasIncomingEdge () const
 Has incoming/outgoing edge set. More...
 
EdgeTypehasIncomingEdge (EdgeType *edge) const
 Find incoming and outgoing edges. More...
 
bool hasOutgoingEdge () const
 
EdgeTypehasOutgoingEdge (EdgeType *edge) const
 
iterator OutEdgeBegin ()
 iterators More...
 
const_iterator OutEdgeBegin () const
 
iterator OutEdgeEnd ()
 
const_iterator OutEdgeEnd () const
 
iterator InEdgeBegin ()
 
const_iterator InEdgeBegin () const
 
iterator InEdgeEnd ()
 
const_iterator InEdgeEnd () const
 
virtual iterator directOutEdgeBegin ()
 Iterators used for SCC detection, overwrite it in child class if necessary. More...
 
virtual const_iterator directOutEdgeBegin () const
 
virtual iterator directOutEdgeEnd ()
 
virtual const_iterator directOutEdgeEnd () const
 
virtual iterator directInEdgeBegin ()
 
virtual const_iterator directInEdgeBegin () const
 
virtual iterator directInEdgeEnd ()
 
virtual const_iterator directInEdgeEnd () const
 
bool addIncomingEdge (EdgeType *inEdge)
 Add incoming and outgoing edges. More...
 
bool addOutgoingEdge (EdgeType *outEdge)
 
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 CFLNode *)
 Methods for support type inquiry through isa, cast, and dyn_cast: More...
 
static bool classof (const GenericICFGNodeTy *node)
 
static bool classof (const SVFBaseNode *node)
 
- Static Public Member Functions inherited from SVF::GenericNode< CFLNode, CFLEdge >
static bool classof (const GenericNode< CFLNode, CFLEdge > *)
 
static bool classof (const SVFBaseNode *)
 

Private Attributes

CFLEdgeDataTy inCFLEdges
 
CFLEdgeDataTy outCFLEdges
 

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

Detailed Description

Definition at line 76 of file CFLGraph.h.

Member Typedef Documentation

◆ CFLEdgeDataTy

Different Kind(label) associated edges set.

Definition at line 87 of file CFLGraph.h.

Constructor & Destructor Documentation

◆ CFLNode()

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

Definition at line 79 of file CFLGraph.h.

79  :
80  GenericCFLNodeTy(i, k)
81  {
82  }
GenericNode< CFLNode, CFLEdge > GenericCFLNodeTy
Definition: CFLGraph.h:75

◆ ~CFLNode()

SVF::CFLNode::~CFLNode ( )
overridedefault

Member Function Documentation

◆ addInEdgeWithKind()

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

Definition at line 104 of file CFLGraph.h.

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

◆ addIngoingEdge()

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

Definition at line 113 of file CFLGraph.h.

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

◆ addOutEdgeWithKind()

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

Definition at line 118 of file CFLGraph.h.

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

◆ addOutgoingEdge()

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

Definition at line 127 of file CFLGraph.h.

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

◆ classof() [1/3]

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

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

Definition at line 154 of file CFLGraph.h.

155  {
156  return true;
157  }

◆ classof() [2/3]

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

Definition at line 159 of file CFLGraph.h.

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

◆ classof() [3/3]

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

Definition at line 164 of file CFLGraph.h.

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

◆ getInEdgeWithTy()

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

Definition at line 94 of file CFLGraph.h.

95  {
96  return inCFLEdges[s];
97  }

◆ getOutEdgeWithTy()

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

Definition at line 99 of file CFLGraph.h.

100  {
101  return outCFLEdges[s];
102  }

◆ removeCFLInEdge()

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

Definition at line 132 of file CFLGraph.h.

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

◆ removeCFLOutEdge()

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

Definition at line 142 of file CFLGraph.h.

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

Member Data Documentation

◆ inCFLEdges

CFLEdgeDataTy SVF::CFLNode::inCFLEdges
private

Definition at line 90 of file CFLGraph.h.

◆ outCFLEdges

CFLEdgeDataTy SVF::CFLNode::outCFLEdges
private

Definition at line 91 of file CFLGraph.h.


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