Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
SVF::GenericNode< NodeTy, EdgeTy > Class Template Reference

#include <GenericGraph.h>

Inheritance diagram for SVF::GenericNode< NodeTy, EdgeTy >:
SVF::SVFValue SVF::CDGNode SVF::CHNode SVF::CallGraphNode SVF::ICFGNode SVF::SVFBasicBlock SVF::SVFVar SVF::TCTNode SVF::VFGNode

Public Types

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::SVFValue
enum  GNodeK {
  IntraBlock , GlobalBlock , FunEntryBlock , FunExitBlock ,
  FunCallBlock , FunRetBlock , ValNode , ArgValNode ,
  FunValNode , GepValNode , RetValNode , VarargValNode ,
  GlobalValNode , ConstAggValNode , ConstDataValNode , BlackHoleValNode ,
  ConstFPValNode , ConstIntValNode , ConstNullptrValNode , DummyValNode ,
  ObjNode , GepObjNode , BaseObjNode , FunObjNode ,
  HeapObjNode , StackObjNode , GlobalObjNode , ConstAggObjNode ,
  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 ,
  DCHNodeKd , BasicBlockKd , OtherKd
}
 

Public Member Functions

 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)
 
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::SVFValue
 SVFValue (NodeID i, GNodeK k, const SVFType *ty=nullptr)
 
NodeID getId () const
 Get ID.
 
GNodeK getNodeKind () const
 Get node kind.
 
virtual const SVFTypegetType () 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
 

Static Public Member Functions

static bool classof (const GenericNode< NodeTy, EdgeTy > *)
 
static bool classof (const SVFValue *)
 

Private Attributes

GEdgeSetTy InEdges
 all incoming edge of this node
 
GEdgeSetTy OutEdges
 all outgoing edge of this node
 

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 SVFTypetype
 SVF type.
 
std::string name
 
std::string sourceLoc
 Source code information of this value.
 

Detailed Description

template<class NodeTy, class EdgeTy>
class SVF::GenericNode< NodeTy, EdgeTy >

Generic node on the graph as base class

Definition at line 141 of file GenericGraph.h.

Member Typedef Documentation

◆ const_iterator

template<class NodeTy , class EdgeTy >
typedef GEdgeSetTy::const_iterator SVF::GenericNode< NodeTy, EdgeTy >::const_iterator

Definition at line 152 of file GenericGraph.h.

◆ EdgeType

Definition at line 146 of file GenericGraph.h.

◆ GEdgeSetTy

template<class NodeTy , class EdgeTy >
typedef OrderedSet<EdgeType*, typename EdgeType::equalGEdge> SVF::GenericNode< NodeTy, EdgeTy >::GEdgeSetTy

Edge kind.

Definition at line 148 of file GenericGraph.h.

◆ iterator

template<class NodeTy , class EdgeTy >
typedef GEdgeSetTy::iterator SVF::GenericNode< NodeTy, EdgeTy >::iterator

Edge iterator

Definition at line 151 of file GenericGraph.h.

◆ NodeType

Definition at line 145 of file GenericGraph.h.

Constructor & Destructor Documentation

◆ GenericNode()

template<class NodeTy , class EdgeTy >
SVF::GenericNode< NodeTy, EdgeTy >::GenericNode ( NodeID  i,
GNodeK  k,
const SVFType svfType = nullptr 
)
inline

Constructor.

Definition at line 162 of file GenericGraph.h.

162 : SVFValue(i, k, svfType)
163 {
164
165 }
SVFValue(NodeID i, GNodeK k, const SVFType *ty=nullptr)
Definition SVFValue.h:154
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ ~GenericNode()

template<class NodeTy , class EdgeTy >
virtual SVF::GenericNode< NodeTy, EdgeTy >::~GenericNode ( )
inlinevirtual

Destructor.

Definition at line 168 of file GenericGraph.h.

169 {
170 for (auto * edge : OutEdges)
171 delete edge;
172 }
GEdgeSetTy OutEdges
all outgoing edge of this node

Member Function Documentation

◆ addIncomingEdge()

template<class NodeTy , class EdgeTy >
bool SVF::GenericNode< NodeTy, EdgeTy >::addIncomingEdge ( EdgeType inEdge)
inline

Add incoming and outgoing edges.

Definition at line 273 of file GenericGraph.h.

274 {
275 return InEdges.insert(inEdge).second;
276 }
GEdgeSetTy InEdges
all incoming edge of this node

◆ addOutgoingEdge()

template<class NodeTy , class EdgeTy >
bool SVF::GenericNode< NodeTy, EdgeTy >::addOutgoingEdge ( EdgeType outEdge)
inline

Definition at line 277 of file GenericGraph.h.

278 {
279 return OutEdges.insert(outEdge).second;
280 }

◆ classof() [1/2]

template<class NodeTy , class EdgeTy >
static bool SVF::GenericNode< NodeTy, EdgeTy >::classof ( const GenericNode< NodeTy, EdgeTy > *  )
inlinestatic

Definition at line 321 of file GenericGraph.h.

322 {
323 return true;
324 }

◆ classof() [2/2]

template<class NodeTy , class EdgeTy >
static bool SVF::GenericNode< NodeTy, EdgeTy >::classof ( const SVFValue )
inlinestatic

Definition at line 326 of file GenericGraph.h.

327 {
328 return true;
329 }

◆ directInEdgeBegin() [1/2]

template<class NodeTy , class EdgeTy >
virtual iterator SVF::GenericNode< NodeTy, EdgeTy >::directInEdgeBegin ( )
inlinevirtual

Reimplemented in SVF::ConstraintNode.

Definition at line 244 of file GenericGraph.h.

245 {
246 return InEdges.begin();
247 }

◆ directInEdgeBegin() [2/2]

template<class NodeTy , class EdgeTy >
virtual const_iterator SVF::GenericNode< NodeTy, EdgeTy >::directInEdgeBegin ( ) const
inlinevirtual

Reimplemented in SVF::ConstraintNode.

Definition at line 261 of file GenericGraph.h.

262 {
263 return InEdges.begin();
264 }

◆ directInEdgeEnd() [1/2]

template<class NodeTy , class EdgeTy >
virtual iterator SVF::GenericNode< NodeTy, EdgeTy >::directInEdgeEnd ( )
inlinevirtual

Reimplemented in SVF::ConstraintNode.

Definition at line 248 of file GenericGraph.h.

249 {
250 return InEdges.end();
251 }

◆ directInEdgeEnd() [2/2]

template<class NodeTy , class EdgeTy >
virtual const_iterator SVF::GenericNode< NodeTy, EdgeTy >::directInEdgeEnd ( ) const
inlinevirtual

Reimplemented in SVF::ConstraintNode.

Definition at line 265 of file GenericGraph.h.

266 {
267 return InEdges.end();
268 }

◆ directOutEdgeBegin() [1/2]

template<class NodeTy , class EdgeTy >
virtual iterator SVF::GenericNode< NodeTy, EdgeTy >::directOutEdgeBegin ( )
inlinevirtual

Iterators used for SCC detection, overwrite it in child class if necessary.

Reimplemented in SVF::ConstraintNode.

Definition at line 236 of file GenericGraph.h.

237 {
238 return OutEdges.begin();
239 }

◆ directOutEdgeBegin() [2/2]

template<class NodeTy , class EdgeTy >
virtual const_iterator SVF::GenericNode< NodeTy, EdgeTy >::directOutEdgeBegin ( ) const
inlinevirtual

Reimplemented in SVF::ConstraintNode.

Definition at line 253 of file GenericGraph.h.

254 {
255 return OutEdges.begin();
256 }

◆ directOutEdgeEnd() [1/2]

template<class NodeTy , class EdgeTy >
virtual iterator SVF::GenericNode< NodeTy, EdgeTy >::directOutEdgeEnd ( )
inlinevirtual

Reimplemented in SVF::ConstraintNode.

Definition at line 240 of file GenericGraph.h.

241 {
242 return OutEdges.end();
243 }

◆ directOutEdgeEnd() [2/2]

template<class NodeTy , class EdgeTy >
virtual const_iterator SVF::GenericNode< NodeTy, EdgeTy >::directOutEdgeEnd ( ) const
inlinevirtual

Reimplemented in SVF::ConstraintNode.

Definition at line 257 of file GenericGraph.h.

258 {
259 return OutEdges.end();
260 }

◆ getInEdges()

template<class NodeTy , class EdgeTy >
const GEdgeSetTy & SVF::GenericNode< NodeTy, EdgeTy >::getInEdges ( ) const
inline

Definition at line 180 of file GenericGraph.h.

181 {
182 return InEdges;
183 }

◆ getOutEdges()

template<class NodeTy , class EdgeTy >
const GEdgeSetTy & SVF::GenericNode< NodeTy, EdgeTy >::getOutEdges ( ) const
inline

Get incoming/outgoing edge set

Definition at line 176 of file GenericGraph.h.

177 {
178 return OutEdges;
179 }

◆ hasIncomingEdge() [1/2]

template<class NodeTy , class EdgeTy >
bool SVF::GenericNode< NodeTy, EdgeTy >::hasIncomingEdge ( ) const
inline

Has incoming/outgoing edge set.

Definition at line 188 of file GenericGraph.h.

189 {
190 return (InEdges.empty() == false);
191 }

◆ hasIncomingEdge() [2/2]

template<class NodeTy , class EdgeTy >
EdgeType * SVF::GenericNode< NodeTy, EdgeTy >::hasIncomingEdge ( EdgeType edge) const
inline

Find incoming and outgoing edges.

Definition at line 303 of file GenericGraph.h.

304 {
306 if (it != InEdges.end())
307 return *it;
308 else
309 return nullptr;
310 }
GEdgeSetTy::const_iterator const_iterator

◆ hasOutgoingEdge() [1/2]

template<class NodeTy , class EdgeTy >
bool SVF::GenericNode< NodeTy, EdgeTy >::hasOutgoingEdge ( ) const
inline

Definition at line 192 of file GenericGraph.h.

193 {
194 return (OutEdges.empty() == false);
195 }

◆ hasOutgoingEdge() [2/2]

template<class NodeTy , class EdgeTy >
EdgeType * SVF::GenericNode< NodeTy, EdgeTy >::hasOutgoingEdge ( EdgeType edge) const
inline

Definition at line 311 of file GenericGraph.h.

312 {
314 if (it != OutEdges.end())
315 return *it;
316 else
317 return nullptr;
318 }

◆ InEdgeBegin() [1/2]

template<class NodeTy , class EdgeTy >
iterator SVF::GenericNode< NodeTy, EdgeTy >::InEdgeBegin ( )
inline

Definition at line 208 of file GenericGraph.h.

209 {
210 return InEdges.begin();
211 }

◆ InEdgeBegin() [2/2]

template<class NodeTy , class EdgeTy >
const_iterator SVF::GenericNode< NodeTy, EdgeTy >::InEdgeBegin ( ) const
inline

Definition at line 224 of file GenericGraph.h.

225 {
226 return InEdges.begin();
227 }

◆ InEdgeEnd() [1/2]

template<class NodeTy , class EdgeTy >
iterator SVF::GenericNode< NodeTy, EdgeTy >::InEdgeEnd ( )
inline

Definition at line 212 of file GenericGraph.h.

213 {
214 return InEdges.end();
215 }

◆ InEdgeEnd() [2/2]

template<class NodeTy , class EdgeTy >
const_iterator SVF::GenericNode< NodeTy, EdgeTy >::InEdgeEnd ( ) const
inline

Definition at line 228 of file GenericGraph.h.

229 {
230 return InEdges.end();
231 }

◆ OutEdgeBegin() [1/2]

template<class NodeTy , class EdgeTy >
iterator SVF::GenericNode< NodeTy, EdgeTy >::OutEdgeBegin ( )
inline

iterators

Definition at line 200 of file GenericGraph.h.

201 {
202 return OutEdges.begin();
203 }

◆ OutEdgeBegin() [2/2]

template<class NodeTy , class EdgeTy >
const_iterator SVF::GenericNode< NodeTy, EdgeTy >::OutEdgeBegin ( ) const
inline

Definition at line 216 of file GenericGraph.h.

217 {
218 return OutEdges.begin();
219 }

◆ OutEdgeEnd() [1/2]

template<class NodeTy , class EdgeTy >
iterator SVF::GenericNode< NodeTy, EdgeTy >::OutEdgeEnd ( )
inline

Definition at line 204 of file GenericGraph.h.

205 {
206 return OutEdges.end();
207 }

◆ OutEdgeEnd() [2/2]

template<class NodeTy , class EdgeTy >
const_iterator SVF::GenericNode< NodeTy, EdgeTy >::OutEdgeEnd ( ) const
inline

Definition at line 220 of file GenericGraph.h.

221 {
222 return OutEdges.end();
223 }

◆ removeIncomingEdge()

template<class NodeTy , class EdgeTy >
u32_t SVF::GenericNode< NodeTy, EdgeTy >::removeIncomingEdge ( EdgeType edge)
inline

Remove incoming and outgoing edges

Definition at line 285 of file GenericGraph.h.

286 {
287 iterator it = InEdges.find(edge);
288 assert(it != InEdges.end() && "can not find in edge in SVFG node");
289 InEdges.erase(it);
290 return 1;
291 }
GEdgeSetTy::iterator iterator

◆ removeOutgoingEdge()

template<class NodeTy , class EdgeTy >
u32_t SVF::GenericNode< NodeTy, EdgeTy >::removeOutgoingEdge ( EdgeType edge)
inline

Definition at line 292 of file GenericGraph.h.

293 {
294 iterator it = OutEdges.find(edge);
295 assert(it != OutEdges.end() && "can not find out edge in SVFG node");
296 OutEdges.erase(it);
297 return 1;
298 }

Member Data Documentation

◆ InEdges

template<class NodeTy , class EdgeTy >
GEdgeSetTy SVF::GenericNode< NodeTy, EdgeTy >::InEdges
private

all incoming edge of this node

Definition at line 157 of file GenericGraph.h.

◆ OutEdges

template<class NodeTy , class EdgeTy >
GEdgeSetTy SVF::GenericNode< NodeTy, EdgeTy >::OutEdges
private

all outgoing edge of this node

Definition at line 158 of file GenericGraph.h.


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