Static Value-Flow Analysis
Loading...
Searching...
No Matches
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.
 
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 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.
 
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.
 
NodeTypegetGNode (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< NodeTy, EdgeTy >
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< NodeTy, EdgeTy >
IDToNodeMapTy IDToNodeMap
 node map
 

Detailed Description

Definition at line 172 of file CFLGraph.h.

Member Typedef Documentation

◆ CFLEdgeSet

Definition at line 177 of file CFLGraph.h.

◆ 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 {
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
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

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

◆ 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:50

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