Static Value-Flow Analysis
|
#include <VFG.h>
Additional Inherited Members | |
Public Attributes inherited from SVF::GenericGraph< NodeTy, EdgeTy > | |
u32_t | edgeNum |
total num of node | |
u32_t | nodeNum |
total num of edge | |
typedef VFGNodeIDToNodeMapTy::const_iterator SVF::VFG::const_iterator |
typedef VFGNodeIDToNodeMapTy::iterator SVF::VFG::iterator |
typedef Map<std::pair<NodeID,const CallICFGNode*>, ActualParmVFGNode *> SVF::VFG::PAGNodeToActualParmMapTy |
typedef VFGEdge::VFGEdgeSetTy::iterator SVF::VFG::VFGNodeIter |
VFG::VFG | ( | PTACallGraph * | cg, |
VFGK | k = FULLSVFG |
||
) |
Constructor.
Constructor
Definition at line 441 of file VFG.cpp.
|
inlinevirtual |
Destructor.
|
inlineprotected |
Add an actual parameter VFG node To be noted that multiple actual parameters may have same value (PAGNode) So we need to make a pair <PAGNodeID,CallSiteID> to find the right VFGParmNode
do not set def here, this node is not a variable definition
|
inlineprotected |
Add a callsite Receive VFG node.
|
inlineprotected |
|
inlineprotected |
Add a BranchVFGNode.
Definition at line 630 of file VFG.h.
VFGEdge * VFG::addCallEdge | ( | NodeID | srcId, |
NodeID | dstId, | ||
CallSiteID | csId | ||
) |
Add interprocedural call edges for top level pointers
Definition at line 701 of file VFG.cpp.
|
inlineprotected |
Add a formal parameter VFG node.
Definition at line 538 of file VFG.h.
|
inlineprotected |
Add a callee Return VFG node To be noted that here we assume returns of a procedure have already been unified into one Otherwise, we need to handle formalRet using <PAGNodeID,CallSiteID> pair to find FormalRetVFG node same as handling actual parameters
if this uniqueFunRet is a phi node, which means it will receive values from multiple return instructions of fun we will set this phi node's def later Ideally, every function uniqueFunRet should be a PhiNode (SVFIRBuilder.cpp), unless it does not have ret instruction
Definition at line 552 of file VFG.h.
|
inlineprotected |
Add inter VF edge from actual to formal parameters.
Definition at line 362 of file VFG.h.
|
inlineprotected |
Add inter VF edge from actual to formal parameters.
|
inlineprotected |
Add inter VF edge from callee return to callsite receive parameter.
|
inlineprotected |
Add inter VF edge from callee return to callsite receive parameter.
Add control-flow edges for top level pointers
Add def-use edges for top level pointers
Definition at line 675 of file VFG.cpp.
|
inlineprotected |
VFGEdge * VFG::addRetEdge | ( | NodeID | srcId, |
NodeID | dstId, | ||
CallSiteID | csId | ||
) |
Add interprocedural return edges for top level pointers
|
inlineprotected |
Add a VFG node for program statement.
Definition at line 477 of file VFG.h.
|
inlineprotected |
|
protected |
Create edges between VFG nodes across functions.
Add a VFG node.
Definition at line 464 of file VFG.h.
|
protected |
Create VFG nodes.
Create VFG nodes for top level pointers
for external function we do not create acutalRet VFGNode they are in the formal of AddrVFGNode if the external function returns an allocated memory if fun has body, it may also exist in isExtCall, e.g., xmalloc() in bzip2, spec2000.
Definition at line 463 of file VFG.cpp.
|
inlineprotected |
sanitize Intra edges, verify that both nodes belong to the same function.
|
inlineprotectedvirtual |
Connect VFG nodes between caller and callee for indirect call site.
Connect actual-param and formal param
Reimplemented in SVF::SVFGOPT.
Definition at line 386 of file VFG.h.
|
virtual |
Connect VFG nodes between caller and callee for indirect call site.
Connect actual params/return to formal params/return for top-level variables. Also connect indirect actual in/out and formal in/out.
Reimplemented in SVF::SVFG.
Definition at line 973 of file VFG.cpp.
|
protected |
Create edges between VFG nodes within a function.
Connect def-use chains for direct value-flow, (value-flow of top level pointers)
do not handle AddrSVFG node, as it is already the source of a definition
for all other cases, like copy/gep/load/ret, connect the RHS pointer to its def
for store, connect the RHS/LHS pointer to its def
connect formal ret to its definition node
connect formal ret to actual ret
Do not process FormalRetVFGNode, as they are connected by copy within callee We assume one procedure only has unique return
connect direct value-flow edges (parameter passing) for thread fork/join
add fork edge
add join edge
Definition at line 742 of file VFG.cpp.
|
inlineprotectedvirtual |
Connect formal-ret and actual ret.
Reimplemented in SVF::SVFGOPT.
Definition at line 395 of file VFG.h.
|
protected |
Clean up memory.
Memory has been cleaned up at GenericGraph
Dump graph into dot file.
Dump VFG
Definition at line 937 of file VFG.cpp.
|
inline |
Definition at line 235 of file VFG.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get callsite given a callsiteID.
Definition at line 178 of file VFG.h.
|
inline |
Given a pagNode, return its definition site.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Given a VFG node, return its left hand side top level pointer
Definition at line 1024 of file VFG.cpp.
|
inline |
|
inlineprotectedvirtual |
Get PAGEdge set.
Definition at line 436 of file VFG.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Return all the VFGNodes of a function
VFGEdge * VFG::hasInterVFGEdge | ( | VFGNode * | src, |
VFGNode * | dst, | ||
VFGEdge::VFGEdgeK | kind, | ||
CallSiteID | csId | ||
) |
Whether we has an inter VFG edge
Definition at line 910 of file VFG.cpp.
VFGEdge * VFG::hasIntraVFGEdge | ( | VFGNode * | src, |
VFGNode * | dst, | ||
VFGEdge::VFGEdgeK | kind | ||
) |
VFGEdge * VFG::hasThreadVFGEdge | ( | VFGNode * | src, |
VFGNode * | dst, | ||
VFGEdge::VFGEdgeK | kind | ||
) |
Whether we has an thread VFG edge
|
inline |
const SVFFunction * VFG::isFunEntryVFGNode | ( | const VFGNode * | node | ) | const |
Whether a node is function entry VFGNode.
Whether this is an function entry VFGNode (formal parameter, formal In)
|
inline |
Return true if this VFG only contains pointer related SVFGNodes for pointer analysis.
|
inline |
|
inline |
Remove a VFGNode.
Definition at line 326 of file VFG.h.
void VFG::updateCallGraph | ( | PointerAnalysis * | pta | ) |
Update VFG based on pointer analysis results.
Definition at line 951 of file VFG.cpp.
|
inline |
void VFG::view | ( | ) |
Dump graph into dot file.
View VFG from the debugger.
Definition at line 945 of file VFG.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
map a PAGEdge to its StmtVFGNode
|
protected |
|
protected |
|
protected |
map a PAGNode to its BinaryOPVFGNode
|
protected |
map a PAGNode to its BranchVFGNode
|
protected |
map a PAGNode to its CmpVFGNode
|
protected |
|
protected |
|
protected |
|
protected |
map a PAGNode to its PHIVFGNode
|
protected |
map a PAGNode to its UnaryOPVFGNode