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

#include <CFLGraph.h>

Inheritance diagram for SVF::CFLGraph:
SVF::GenericGraph< CFLNode, CFLEdge >

Public Types

typedef CFGrammar::Symbol Symbol
typedef CFGrammar::Kind Kind
typedef GenericNode< CFLNode, CFLEdge >::GEdgeSetTy CFLEdgeSet
Public Types inherited from SVF::GenericGraph< CFLNode, CFLEdge >
typedef CFLNode NodeType
typedef CFLEdge EdgeType
typedef OrderedMap< NodeID, NodeType * > IDToNodeMapTy
 NodeID to GenericNode map.
typedef IDToNodeMapTy::iterator iterator
 Node Iterators.
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 CFLEdge * addCFLEdge (CFLNode *src, CFLNode *dst, CFLEdge::GEdgeFlag label)
virtual const CFLEdge * hasEdge (CFLNode *src, CFLNode *dst, CFLEdge::GEdgeFlag label)
void dump (const std::string &filename)
void view ()
const CFLEdgeSet & getCFLEdges () const
Public Member Functions inherited from SVF::GenericGraph< CFLNode, CFLEdge >
 GenericGraph ()
 Constructor.
virtual ~GenericGraph ()
 Destructor.
void destroy ()
 Release memory.
iterator begin ()
 Iterators.
iterator end ()
const_iterator begin () const
const_iterator end () const
void addGNode (NodeID id, NodeType *node)
 Add a Node.
NodeType * getGNode (NodeID id) const
 Get a node.
bool hasGNode (NodeID id) const
 Has a node.
void removeGNode (NodeType *node)
 Delete a node.
u32_t getTotalNodeNum () const
 Get total number of node/edge.
u32_t getTotalEdgeNum () const
void incNodeNum ()
 Increase number of node/edge.
void incEdgeNum ()

Public Attributes

Kind startKind
Public Attributes inherited from SVF::GenericGraph< CFLNode, CFLEdge >
u32_t edgeNum
 total num of node
u32_t nodeNum
 total num of edge

Private Attributes

CFLEdgeSet cflEdgeSet

Additional Inherited Members

Protected Attributes inherited from SVF::GenericGraph< CFLNode, CFLEdge >
IDToNodeMapTy IDToNodeMap
 node map

Detailed Description

Definition at line 172 of file CFLGraph.h.

Member Typedef Documentation

◆ CFLEdgeSet

◆ Kind

Definition at line 176 of file CFLGraph.h.

◆ Symbol

Definition at line 175 of file CFLGraph.h.

Constructor & Destructor Documentation

◆ CFLGraph()

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

Definition at line 180 of file CFLGraph.h.

181 {
182 startKind = kind;
183 }

◆ ~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:204
bool addIngoingEdge(CFLEdge *inEdge)
Definition CFLGraph.h:112
bool addOutgoingEdge(CFLEdge *OutEdge)
Definition CFLGraph.h:126

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

◆ 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)
std::ostream & outs()
Overwrite llvm::outs().
Definition SVFUtil.h:58

◆ getCFLEdges()

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

Definition at line 198 of file CFLGraph.h.

199 {
200 return cflEdgeSet;
201 }

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

Member Data Documentation

◆ cflEdgeSet

CFLEdgeSet SVF::CFLGraph::cflEdgeSet
private

Definition at line 204 of file CFLGraph.h.

◆ startKind

Kind SVF::CFLGraph::startKind

Definition at line 178 of file CFLGraph.h.


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