Static Value-Flow Analysis
|
#include <ICFG.h>
Public Types | |
typedef OrderedMap< NodeID, ICFGNode * > | ICFGNodeIDToNodeMapTy |
typedef ICFGEdge::ICFGEdgeSetTy | ICFGEdgeSetTy |
typedef ICFGNodeIDToNodeMapTy::iterator | iterator |
typedef ICFGNodeIDToNodeMapTy::const_iterator | const_iterator |
typedef Map< const FunObjVar *, FunEntryICFGNode * > | FunToFunEntryNodeMapTy |
typedef Map< const FunObjVar *, FunExitICFGNode * > | FunToFunExitNodeMapTy |
typedef std::vector< const SVFLoop * > | SVFLoopVec |
typedef Map< const ICFGNode *, SVFLoopVec > | ICFGNodeToSVFLoopVec |
![]() | |
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 | |
ICFG () | |
Constructor. | |
~ICFG () override | |
Destructor. | |
ICFGNode * | getICFGNode (NodeID id) const |
Get a ICFG node. | |
bool | hasICFGNode (NodeID id) const |
Whether has the ICFGNode. | |
ICFGEdge * | hasIntraICFGEdge (ICFGNode *src, ICFGNode *dst, ICFGEdge::ICFGEdgeK kind) |
Whether we has a SVFG edge. | |
ICFGEdge * | hasInterICFGEdge (ICFGNode *src, ICFGNode *dst, ICFGEdge::ICFGEdgeK kind) |
ICFGEdge * | hasThreadICFGEdge (ICFGNode *src, ICFGNode *dst, ICFGEdge::ICFGEdgeK kind) |
ICFGEdge * | getICFGEdge (const ICFGNode *src, const ICFGNode *dst, ICFGEdge::ICFGEdgeK kind) |
Get a SVFG edge according to src and dst. | |
void | dump (const std::string &file, bool simple=false) |
Dump graph into dot file. | |
void | view () |
View graph from the debugger. | |
void | updateCallGraph (CallGraph *callgraph) |
update ICFG for indirect calls | |
bool | isInLoop (const ICFGNode *node) |
Whether node is in a loop. | |
void | addNodeToSVFLoop (const ICFGNode *node, const SVFLoop *loop) |
Insert (node, loop) to icfgNodeToSVFLoopVec. | |
SVFLoopVec & | getSVFLoops (const ICFGNode *node) |
Get loops where a node resides. | |
const ICFGNodeToSVFLoopVec & | getIcfgNodeToSVFLoopVec () const |
FunEntryICFGNode * | getFunEntryICFGNode (const FunObjVar *fun) |
Add a function entry node. | |
FunExitICFGNode * | getFunExitICFGNode (const FunObjVar *fun) |
Add a function exit node. | |
GlobalICFGNode * | getGlobalICFGNode () const |
![]() | |
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 | |
NodeID | totalICFGNode |
![]() | |
u32_t | edgeNum |
total num of node | |
u32_t | nodeNum |
total num of edge | |
Private Member Functions | |
bool | addICFGEdge (ICFGEdge *edge) |
Add ICFG edge, only used by addIntraEdge, addCallEdge, addRetEdge etc. | |
FunEntryICFGNode * | getFunEntryBlock (const FunObjVar *fun) |
Get/Add a function entry node. | |
FunExitICFGNode * | getFunExitBlock (const FunObjVar *fun) |
Get/Add a function exit node. | |
Private Attributes | |
FunToFunEntryNodeMapTy | FunToFunEntryNodeMap |
map a function to its FunExitICFGNode | |
FunToFunExitNodeMapTy | FunToFunExitNodeMap |
map a function to its FunEntryICFGNode | |
GlobalICFGNode * | globalBlockNode |
unique basic block for all globals | |
ICFGNodeToSVFLoopVec | icfgNodeToSVFLoopVec |
map ICFG node to the SVF loops where it resides | |
Friends | |
class | ICFGBuilder |
class | SVFIRWriter |
class | SVFIRReader |
class | ICFGSimplification |
Additional Inherited Members | |
![]() | |
IDToNodeMapTy | IDToNodeMap |
node map | |
typedef ICFGNodeIDToNodeMapTy::const_iterator SVF::ICFG::const_iterator |
typedef ICFGNodeIDToNodeMapTy::iterator SVF::ICFG::iterator |
ICFG::ICFG | ( | ) |
|
override |
Destructor.
Definition at line 222 of file ICFG.cpp.
Add interprocedural call edges between two nodes
Definition at line 374 of file ICFG.cpp.
|
inlineprotectedvirtual |
|
protected |
Add conditional intraprocedural edges between two nodes
Definition at line 352 of file ICFG.cpp.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Add ICFG edge, only used by addIntraEdge, addCallEdge, addRetEdge etc.
Add a ICFG node.
Definition at line 215 of file ICFG.h.
|
inlineprotectedvirtual |
Insert (node, loop) to icfgNodeToSVFLoopVec.
Add interprocedural return edges between two nodes
|
inlineprotectedvirtual |
|
inlineprotected |
sanitize Intra edges, verify that both nodes belong to the same function.
Dump graph into dot file.
Dump ICFG
Definition at line 411 of file ICFG.cpp.
|
inlineprivate |
FunEntryICFGNode * ICFG::getFunEntryICFGNode | ( | const FunObjVar * | fun | ) |
Add a function entry node.
Get a basic block ICFGNode TODO:: need to fix the assertions
Definition at line 242 of file ICFG.cpp.
|
inlineprivate |
FunExitICFGNode * ICFG::getFunExitICFGNode | ( | const FunObjVar * | fun | ) |
Add a function exit node.
Definition at line 249 of file ICFG.cpp.
|
inline |
ICFGEdge * ICFG::getICFGEdge | ( | const ICFGNode * | src, |
const ICFGNode * | dst, | ||
ICFGEdge::ICFGEdgeK | kind | ||
) |
Get a ICFG node.
|
inline |
|
inline |
ICFGEdge * ICFG::hasInterICFGEdge | ( | ICFGNode * | src, |
ICFGNode * | dst, | ||
ICFGEdge::ICFGEdgeK | kind | ||
) |
Whether we has an inter ICFG edge
Definition at line 276 of file ICFG.cpp.
ICFGEdge * ICFG::hasIntraICFGEdge | ( | ICFGNode * | src, |
ICFGNode * | dst, | ||
ICFGEdge::ICFGEdgeK | kind | ||
) |
ICFGEdge * ICFG::hasThreadICFGEdge | ( | ICFGNode * | src, |
ICFGNode * | dst, | ||
ICFGEdge::ICFGEdgeK | kind | ||
) |
Whether we has an thread ICFG edge
|
inlineprotected |
|
inlineprotected |
Remove a ICFGNode.
Definition at line 155 of file ICFG.h.
void ICFG::updateCallGraph | ( | CallGraph * | callgraph | ) |
update ICFG for indirect calls
Update ICFG for indirect calls
if this is an external function (no function body), connect calleeEntryNode to calleeExitNode
Remove callBlockNode to retBlockNode intraICFGEdge since we found at least one inter procedural edge
Definition at line 427 of file ICFG.cpp.
void ICFG::view | ( | ) |
View graph from the debugger.
View ICFG
Definition at line 419 of file ICFG.cpp.
|
friend |
|
private |
map a function to its FunExitICFGNode
|
private |
map a function to its FunEntryICFGNode
|
private |
|
private |