|
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 |
| Public Types inherited from SVF::GenericGraph< ICFGNode, ICFGEdge > | |
| typedef ICFGNode | NodeType |
| typedef ICFGEdge | 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 |
| Public Member Functions inherited from SVF::GenericGraph< ICFGNode, ICFGEdge > | |
| 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 |
| Public Attributes inherited from SVF::GenericGraph< ICFGNode, ICFGEdge > | |
| u32_t | edgeNum |
| total num of node | |
| u32_t | nodeNum |
| total num of edge | |
Protected Member Functions | |
| ICFGEdge * | addIntraEdge (ICFGNode *srcNode, ICFGNode *dstNode) |
| Add intraprocedural and interprocedural control-flow edges. | |
| ICFGEdge * | addConditionalIntraEdge (ICFGNode *srcNode, ICFGNode *dstNode, s64_t branchCondVal) |
| ICFGEdge * | addCallEdge (ICFGNode *srcNode, ICFGNode *dstNode) |
| ICFGEdge * | addRetEdge (ICFGNode *srcNode, ICFGNode *dstNode) |
| void | removeICFGEdge (ICFGEdge *edge) |
| Remove a ICFG edge. | |
| void | removeICFGNode (ICFGNode *node) |
| Remove a ICFGNode. | |
| void | checkIntraEdgeParents (const ICFGNode *srcNode, const ICFGNode *dstNode) |
| sanitize Intra edges, verify that both nodes belong to the same function. | |
| virtual IntraICFGNode * | addIntraICFGNode (const SVFBasicBlock *bb, bool isRet) |
| virtual CallICFGNode * | addCallICFGNode (const SVFBasicBlock *bb, const SVFType *ty, const FunObjVar *calledFunc, bool isVararg, bool isvcall, s32_t vcallIdx, const std::string &funNameOfVcall) |
| virtual RetICFGNode * | addRetICFGNode (CallICFGNode *call) |
| virtual FunEntryICFGNode * | addFunEntryICFGNode (const FunObjVar *svfFunc) |
| virtual FunEntryICFGNode * | addFunEntryICFGNode (FunEntryICFGNode *funEntryICFGNode) |
| virtual void | addGlobalICFGNode (GlobalICFGNode *globalICFGNode) |
| virtual FunExitICFGNode * | addFunExitICFGNode (const FunObjVar *svfFunc) |
| virtual FunExitICFGNode * | addFunExitICFGNode (FunExitICFGNode *funExitICFGNode) |
| virtual void | addICFGNode (ICFGNode *node) |
| Add a ICFG node. | |
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 | ICFGSimplification |
| class | GraphDBClient |
Additional Inherited Members | |
| Protected Attributes inherited from SVF::GenericGraph< ICFGNode, ICFGEdge > | |
| IDToNodeMapTy | IDToNodeMap |
| node map | |
| typedef ICFGNodeIDToNodeMapTy::const_iterator SVF::ICFG::const_iterator |
| typedef Map<const FunObjVar*, FunEntryICFGNode *> SVF::ICFG::FunToFunEntryNodeMapTy |
| typedef Map<const FunObjVar*, FunExitICFGNode *> SVF::ICFG::FunToFunExitNodeMapTy |
| typedef OrderedMap<NodeID, ICFGNode *> SVF::ICFG::ICFGNodeIDToNodeMapTy |
| typedef Map<const ICFGNode *, SVFLoopVec> SVF::ICFG::ICFGNodeToSVFLoopVec |
| typedef ICFGNodeIDToNodeMapTy::iterator SVF::ICFG::iterator |
| typedef std::vector<const SVFLoop *> SVF::ICFG::SVFLoopVec |
| ICFG::ICFG | ( | ) |
|
override |
Destructor.
Definition at line 212 of file ICFG.cpp.
Add interprocedural call edges between two nodes
Definition at line 375 of file ICFG.cpp.
|
inlineprotectedvirtual |
Definition at line 179 of file ICFG.h.
|
protected |
Add conditional intraprocedural edges between two nodes
Definition at line 353 of file ICFG.cpp.
|
inlineprotectedvirtual |
Definition at line 200 of file ICFG.h.
|
inlineprotectedvirtual |
Definition at line 206 of file ICFG.h.
|
inlineprotectedvirtual |
Definition at line 214 of file ICFG.h.
|
inlineprotectedvirtual |
Definition at line 225 of file ICFG.h.
|
protectedvirtual |
|
inlineprivate |
Add ICFG edge, only used by addIntraEdge, addCallEdge, addRetEdge etc.
Definition at line 252 of file ICFG.h.
|
protectedvirtual |
Add a ICFG node.
Add intraprocedural and interprocedural control-flow edges.
Add intraprocedural edges between two nodes
Definition at line 334 of file ICFG.cpp.
|
inlineprotectedvirtual |
Definition at line 171 of file ICFG.h.
Insert (node, loop) to icfgNodeToSVFLoopVec.
|
inlineprotectedvirtual |
Definition at line 192 of file ICFG.h.
|
inlineprotected |
sanitize Intra edges, verify that both nodes belong to the same function.
Definition at line 161 of file ICFG.h.
| void ICFG::dump | ( | const std::string & | file, |
| bool | simple = false ) |
Dump graph into dot file.
Dump ICFG
Definition at line 412 of file ICFG.cpp.
|
inlineprivate |
Get/Add a function entry node.
Definition at line 262 of file ICFG.h.
| 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 243 of file ICFG.cpp.
|
inlineprivate |
Get/Add a function exit node.
Definition at line 271 of file ICFG.h.
| FunExitICFGNode * ICFG::getFunExitICFGNode | ( | const FunObjVar * | fun | ) |
Add a function exit node.
Definition at line 250 of file ICFG.cpp.
|
inline |
| ICFGEdge * ICFG::getICFGEdge | ( | const ICFGNode * | src, |
| const ICFGNode * | dst, | ||
| ICFGEdge::ICFGEdgeK | kind ) |
Get a SVFG edge according to src and dst.
Return the corresponding ICFGEdge
Definition at line 312 of file ICFG.cpp.
Get a ICFG node.
|
inline |
|
inline |
|
inline |
Whether has the ICFGNode.
| ICFGEdge * ICFG::hasInterICFGEdge | ( | ICFGNode * | src, |
| ICFGNode * | dst, | ||
| ICFGEdge::ICFGEdgeK | kind ) |
Whether we has an inter ICFG edge
Definition at line 277 of file ICFG.cpp.
| ICFGEdge * ICFG::hasIntraICFGEdge | ( | ICFGNode * | src, |
| ICFGNode * | dst, | ||
| ICFGEdge::ICFGEdgeK | kind ) |
Whether we has a SVFG edge.
Whether we has an intra ICFG edge
Definition at line 260 of file ICFG.cpp.
| ICFGEdge * ICFG::hasThreadICFGEdge | ( | ICFGNode * | src, |
| ICFGNode * | dst, | ||
| ICFGEdge::ICFGEdgeK | kind ) |
Whether we has an thread ICFG edge
Definition at line 294 of file ICFG.cpp.
|
inline |
|
inlineprotected |
|
inlineprotected |
Remove a ICFGNode.
| 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 428 of file ICFG.cpp.
| void ICFG::view | ( | ) |
View graph from the debugger.
View ICFG
Definition at line 420 of file ICFG.cpp.
|
private |
map a function to its FunExitICFGNode
|
private |
map a function to its FunEntryICFGNode
|
private |
|
private |