Static Value-Flow Analysis
|
#include <ConsG.h>
Public Types | |
typedef OrderedMap< NodeID, ConstraintNode * > | ConstraintNodeIDToNodeMapTy |
typedef ConstraintEdge::ConstraintEdgeSetTy::iterator | ConstraintNodeIter |
typedef Map< NodeID, NodeID > | NodeToRepMap |
typedef Map< NodeID, NodeBS > | NodeToSubsMap |
typedef FIFOWorkList< NodeID > | WorkList |
Public Types inherited from SVF::GenericGraph< ConstraintNode, ConstraintEdge > | |
typedef ConstraintNode | NodeType |
typedef ConstraintEdge | EdgeType |
typedef OrderedMap< NodeID, NodeType * > | IDToNodeMapTy |
NodeID to GenericNode map. | |
typedef IDToNodeMapTy::iterator | iterator |
Node Iterators. | |
typedef IDToNodeMapTy::const_iterator | const_iterator |
Protected Member Functions | |
void | buildCG () |
void | destroy () |
void | clearSolitaries () |
SVFStmt::SVFStmtSetTy & | getPAGEdgeSet (SVFStmt::PEDGEK kind) |
NodeID | getValueNode (const SVFValue *value) const |
Wrappers used internally, not expose to Andersen Pass. | |
NodeID | getReturnNode (const SVFFunction *value) const |
NodeID | getVarargNode (const SVFFunction *value) const |
Additional Inherited Members | |
Public Attributes inherited from SVF::GenericGraph< ConstraintNode, ConstraintEdge > | |
u32_t | edgeNum |
total num of node | |
u32_t | nodeNum |
total num of edge | |
Constraint graph for Andersen's analysis ConstraintNodes are same as PAGNodes ConstraintEdges are self-defined edges (initialized with ConstraintEdges)
typedef ConstraintEdge::ConstraintEdgeSetTy::iterator SVF::ConstraintGraph::ConstraintNodeIter |
|
inline |
|
inlinevirtual |
Destructor.
AddrCGEdge * ConstraintGraph::addAddrCGEdge | ( | NodeID | src, |
NodeID | dst | ||
) |
Add a SVFIR edge into Edge map.
Add Address edge
Add an address edge
Definition at line 202 of file ConsG.cpp.
|
inline |
CopyCGEdge * ConstraintGraph::addCopyCGEdge | ( | NodeID | src, |
NodeID | dst | ||
) |
Add Copy edge.
Add Copy edge
Definition at line 222 of file ConsG.cpp.
LoadCGEdge * ConstraintGraph::addLoadCGEdge | ( | NodeID | src, |
NodeID | dst | ||
) |
Add Load edge.
Add Load edge
Definition at line 288 of file ConsG.cpp.
|
inline |
NormalGepCGEdge * ConstraintGraph::addNormalGepCGEdge | ( | NodeID | src, |
NodeID | dst, | ||
const AccessPath & | ap | ||
) |
Add Gep edge.
Add Gep edge
StoreCGEdge * ConstraintGraph::addStoreCGEdge | ( | NodeID | src, |
NodeID | dst | ||
) |
Add Store edge.
Add Store edge
Definition at line 309 of file ConsG.cpp.
VariantGepCGEdge * ConstraintGraph::addVariantGepCGEdge | ( | NodeID | src, |
NodeID | dst | ||
) |
Add variant gep edge
|
protected |
Start building constraint graph
Definition at line 40 of file ConsG.cpp.
|
protected |
Remove nodes that are neither pointers nor connected with any edge
We don't remove return SVFVar from an indirect callsite
Definition at line 150 of file ConsG.cpp.
|
protected |
void ConstraintGraph::dump | ( | std::string | name | ) |
Dump graph into dot file.
Dump constraint graph
Definition at line 591 of file ConsG.cpp.
|
inline |
Get SVFIR edge.
Get Address edges
Definition at line 316 of file ConsG.h.
Definition at line 320 of file ConsG.h.
|
inline |
|
inline |
Get/add/remove constraint node.
|
inline |
Get Copy/call/ret/gep edges.
|
inline |
Get an edge via its src and dst nodes and kind.
Definition at line 148 of file ConsG.h.
Get a field-insensitive node of a memory object.
The fi obj in PAG must be either an existing node or merged to another rep node in ConsG
Definition at line 339 of file ConsG.h.
Get a field of a memory object.
Create a node when it is (1) not exist on graph and (2) not merged
Definition at line 330 of file ConsG.h.
|
inline |
Wrappers for invoking SVFIR methods.
Definition at line 304 of file ConsG.h.
|
inline |
|
inline |
|
inlineprotected |
Definition at line 72 of file ConsG.h.
|
inlineprotected |
Definition at line 84 of file ConsG.h.
|
inline |
|
inlineprotected |
Definition at line 89 of file ConsG.h.
|
inline |
|
inline |
Check/Set PWC (positive weight cycle) flag.
Definition at line 350 of file ConsG.h.
|
inline |
Check if a given edge is a NormalGepCGEdge with 0 offset.
Definition at line 294 of file ConsG.h.
|
inline |
Move incoming/outgoing direct edges of a sub node to its rep node Return TRUE if there's a gep edge inside this SCC (PWC).
Definition at line 286 of file ConsG.h.
bool ConstraintGraph::moveInEdgesToRepNode | ( | ConstraintNode * | node, |
ConstraintNode * | rep | ||
) |
Move incoming direct edges of a sub node which is outside the SCC to its rep node Remove incoming direct edges of a sub node which is inside the SCC from its rep node Return TRUE if there's a gep edge inside this SCC (PWC).
Move incoming direct edges of a sub node which is outside SCC to its rep node Remove incoming direct edges of a sub node which is inside SCC from its rep node
only copy and gep edge can be removed
Definition at line 474 of file ConsG.cpp.
bool ConstraintGraph::moveOutEdgesToRepNode | ( | ConstraintNode * | node, |
ConstraintNode * | rep | ||
) |
Move outgoing direct edges of a sub node which is outside the SCC to its rep node Remove outgoing direct edges of sub node which is inside the SCC from its rep node Return TRUE if there's a gep edge inside this SCC (PWC).
Move outgoing direct edges of a sub node which is outside SCC to its rep node Remove outgoing direct edges of a sub node which is inside SCC from its rep node
only copy and gep edge can be removed
Definition at line 532 of file ConsG.cpp.
void ConstraintGraph::print | ( | ) |
Print CG into terminal.
Print this constraint graph including its nodes and edges
Definition at line 599 of file ConsG.cpp.
void ConstraintGraph::removeAddrEdge | ( | AddrCGEdge * | edge | ) |
Remove addr edge from their src and dst edge sets.
Remove addr edge from their src and dst edge sets
Definition at line 420 of file ConsG.cpp.
|
inline |
Definition at line 123 of file ConsG.h.
void ConstraintGraph::removeDirectEdge | ( | ConstraintEdge * | edge | ) |
Remove direct edge from their src and dst edge sets.
Remove edges from their src and dst edge sets
Definition at line 459 of file ConsG.cpp.
void ConstraintGraph::removeLoadEdge | ( | LoadCGEdge * | edge | ) |
Remove load edge from their src and dst edge sets.
Remove load edge from their src and dst edge sets
Definition at line 433 of file ConsG.cpp.
void ConstraintGraph::removeStoreEdge | ( | StoreCGEdge * | edge | ) |
Remove store edge from their src and dst edge sets.
Remove store edge from their src and dst edge sets
Definition at line 446 of file ConsG.cpp.
|
inline |
|
inline |
void ConstraintGraph::reTargetDstOfEdge | ( | ConstraintEdge * | edge, |
ConstraintNode * | newDstNode | ||
) |
Used for cycle elimination.
Remove edge from old dst target, change edge dst id and add modified edge into new dst
Re-target dst node of an edge
(1) Remove edge from old dst target, (2) Change edge dst id and (3) Add modified edge into new dst
Definition at line 335 of file ConsG.cpp.
void ConstraintGraph::reTargetSrcOfEdge | ( | ConstraintEdge * | edge, |
ConstraintNode * | newSrcNode | ||
) |
Remove edge from old src target, change edge dst id and add modified edge into new src.
Re-target src node of an edge (1) Remove edge from old src target, (2) Change edge src id and (3) Add modified edge into new src
Definition at line 379 of file ConsG.cpp.
|
inline |
void ConstraintGraph::view | ( | ) |
View graph from the debugger.
View dot graph of Constraint graph from debugger.
Definition at line 659 of file ConsG.cpp.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |