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

#include <CFLGraph.h>

Inheritance diagram for SVF::CFLGraph:
SVF::GenericGraph< NodeTy, EdgeTy >

Public Types

typedef CFGrammar::Symbol Symbol
 
typedef CFGrammar::Kind Kind
 
typedef GenericNode< CFLNode, CFLEdge >::GEdgeSetTy CFLEdgeSet
 
- Public Types inherited from SVF::GenericGraph< NodeTy, EdgeTy >
typedef NodeTy NodeType
 
typedef EdgeTy EdgeType
 
typedef OrderedMap< NodeID, NodeType * > IDToNodeMapTy
 NodeID to GenericNode map. More...
 
typedef IDToNodeMapTy::iterator iterator
 Node Iterators. More...
 
typedef IDToNodeMapTy::const_iterator const_iterator
 

Public Member Functions

 CFLGraph (Kind kind)
 
 ~CFLGraph () override=default
 
Kind getStartKind () const
 
virtual void addCFLNode (NodeID id, CFLNode *node)
 
virtual const CFLEdgeaddCFLEdge (CFLNode *src, CFLNode *dst, CFLEdge::GEdgeFlag label)
 
virtual const CFLEdgehasEdge (CFLNode *src, CFLNode *dst, CFLEdge::GEdgeFlag label)
 
void dump (const std::string &filename)
 
void view ()
 
const CFLEdgeSetgetCFLEdges () const
 
- Public Member Functions inherited from SVF::GenericGraph< NodeTy, EdgeTy >
 GenericGraph ()
 Constructor. More...
 
virtual ~GenericGraph ()
 Destructor. More...
 
void destroy ()
 Release memory. More...
 
iterator begin ()
 Iterators. More...
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
void addGNode (NodeID id, NodeType *node)
 Add a Node. More...
 
NodeTypegetGNode (NodeID id) const
 Get a node. More...
 
bool hasGNode (NodeID id) const
 Has a node. More...
 
void removeGNode (NodeType *node)
 Delete a node. More...
 
u32_t getTotalNodeNum () const
 Get total number of node/edge. More...
 
u32_t getTotalEdgeNum () const
 
void incNodeNum ()
 Increase number of node/edge. More...
 
void incEdgeNum ()
 

Public Attributes

Kind startKind
 
- Public Attributes inherited from SVF::GenericGraph< NodeTy, EdgeTy >
u32_t edgeNum
 total num of node More...
 
u32_t nodeNum
 total num of edge More...
 

Private Attributes

CFLEdgeSet cflEdgeSet
 

Additional Inherited Members

- Protected Attributes inherited from SVF::GenericGraph< NodeTy, EdgeTy >
IDToNodeMapTy IDToNodeMap
 node map More...
 

Detailed Description

Definition at line 173 of file CFLGraph.h.

Member Typedef Documentation

◆ CFLEdgeSet

Definition at line 178 of file CFLGraph.h.

◆ Kind

Definition at line 177 of file CFLGraph.h.

◆ Symbol

Definition at line 176 of file CFLGraph.h.

Constructor & Destructor Documentation

◆ CFLGraph()

SVF::CFLGraph::CFLGraph ( Kind  kind)
inline

Definition at line 181 of file CFLGraph.h.

182  {
183  startKind = kind;
184  }
Kind startKind
Definition: CFLGraph.h:179

◆ ~CFLGraph()

SVF::CFLGraph::~CFLGraph ( )
overridedefault

Member Function Documentation

◆ addCFLEdge()

const CFLEdge * CFLGraph::addCFLEdge ( CFLNode src,
CFLNode dst,
CFLEdge::GEdgeFlag  label 
)
virtual

Definition at line 47 of file CFLGraph.cpp.

48 {
49  CFLEdge* edge = new CFLEdge(src,dst,label);
50  if(cflEdgeSet.insert(edge).second)
51  {
52  src->addOutgoingEdge(edge);
53  dst->addIngoingEdge(edge);
54  return edge;
55  }
56  else
57  {
58  delete edge;
59  return nullptr;
60  }
61 }
CFLEdgeSet cflEdgeSet
Definition: CFLGraph.h:205
bool addIngoingEdge(CFLEdge *inEdge)
Definition: CFLGraph.h:113
bool addOutgoingEdge(CFLEdge *OutEdge)
Definition: CFLGraph.h:127

◆ addCFLNode()

void CFLGraph::addCFLNode ( NodeID  id,
CFLNode node 
)
virtual

Definition at line 42 of file CFLGraph.cpp.

43 {
44  addGNode(id, node);
45 }
void addGNode(NodeID id, NodeType *node)
Add a Node.
Definition: GenericGraph.h:646

◆ dump()

void CFLGraph::dump ( const std::string filename)

Definition at line 73 of file CFLGraph.cpp.

74 {
76 }
static void WriteGraphToFile(SVF::OutStream &O, const std::string &GraphName, const GraphType &GT, bool simple=false)
Definition: GraphPrinter.h:56
std::ostream & outs()
Overwrite llvm::outs()
Definition: SVFUtil.h:50

◆ getCFLEdges()

const CFLEdgeSet& SVF::CFLGraph::getCFLEdges ( ) const
inline

Definition at line 199 of file CFLGraph.h.

200  {
201  return cflEdgeSet;
202  }

◆ getStartKind()

CFLGraph::Kind CFLGraph::getStartKind ( ) const

Definition at line 37 of file CFLGraph.cpp.

38 {
39  return this->startKind;
40 }

◆ hasEdge()

const CFLEdge * CFLGraph::hasEdge ( CFLNode src,
CFLNode dst,
CFLEdge::GEdgeFlag  label 
)
virtual

Definition at line 63 of file CFLGraph.cpp.

64 {
65  CFLEdge edge(src,dst,label);
66  auto it = cflEdgeSet.find(&edge);
67  if(it !=cflEdgeSet.end())
68  return *it;
69  else
70  return nullptr;
71 }

◆ view()

void CFLGraph::view ( )

Definition at line 78 of file CFLGraph.cpp.

79 {
80  SVF::ViewGraph(this, "CFL Graph");
81 }
void ViewGraph(const GraphType &G, const std::string &name, bool ShortNames=false, GraphProgram::Name Program=GraphProgram::DOT)
Definition: GraphWriter.h:371

Member Data Documentation

◆ cflEdgeSet

CFLEdgeSet SVF::CFLGraph::cflEdgeSet
private

Definition at line 205 of file CFLGraph.h.

◆ startKind

Kind SVF::CFLGraph::startKind

Definition at line 179 of file CFLGraph.h.


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