Static Value-Flow Analysis
|
#include <PTACallGraph.h>
Public Types | |
enum | CGEK { NormCallGraph , ThdCallGraph } |
typedef PTACallGraphEdge::CallGraphEdgeSet | CallGraphEdgeSet |
typedef Map< const SVFFunction *, PTACallGraphNode * > | FunToCallGraphNodeMap |
typedef Map< const CallICFGNode *, CallGraphEdgeSet > | CallInstToCallGraphEdgesMap |
typedef std::pair< const CallICFGNode *, const SVFFunction * > | CallSitePair |
typedef Map< CallSitePair, CallSiteID > | CallSiteToIdMap |
typedef Map< CallSiteID, CallSitePair > | IdToCallSiteMap |
typedef Set< const SVFFunction * > | FunctionSet |
typedef OrderedMap< const CallICFGNode *, FunctionSet > | CallEdgeMap |
typedef CallGraphEdgeSet::iterator | CallGraphEdgeIter |
typedef CallGraphEdgeSet::const_iterator | CallGraphEdgeConstIter |
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 |
Protected Member Functions | |
void | destroy () |
Clean up memory. | |
CallSiteID | addCallSite (const CallICFGNode *cs, const SVFFunction *callee) |
Add CallSiteID. | |
void | addEdge (PTACallGraphEdge *edge) |
Add call graph edge. | |
Protected Attributes | |
FunToCallGraphNodeMap | funToCallGraphNodeMap |
Call Graph node map. | |
CallInstToCallGraphEdgesMap | callinstToCallGraphEdgesMap |
Map a call instruction to its corresponding call edges. | |
NodeID | callGraphNodeNum |
u32_t | numOfResolvedIndCallEdge |
CGEK | kind |
Protected Attributes inherited from SVF::GenericGraph< NodeTy, EdgeTy > | |
IDToNodeMapTy | IDToNodeMap |
node map | |
Private Attributes | |
CallEdgeMap | indirectCallMap |
Indirect call map. | |
Static Private Attributes | |
static CallSiteToIdMap | csToIdMap |
Call site information. | |
static IdToCallSiteMap | idToCSMap |
Map a callsite ID to a pair of call instruction and callee. | |
static CallSiteID | totalCallSiteNum =1 |
CallSiteIDs, start from 1;. | |
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 | |
Definition at line 236 of file PTACallGraph.h.
Definition at line 247 of file PTACallGraph.h.
typedef CallGraphEdgeSet::const_iterator SVF::PTACallGraph::CallGraphEdgeConstIter |
Definition at line 249 of file PTACallGraph.h.
typedef CallGraphEdgeSet::iterator SVF::PTACallGraph::CallGraphEdgeIter |
Definition at line 248 of file PTACallGraph.h.
Definition at line 240 of file PTACallGraph.h.
Definition at line 242 of file PTACallGraph.h.
typedef std::pair<const CallICFGNode*, const SVFFunction*> SVF::PTACallGraph::CallSitePair |
Definition at line 243 of file PTACallGraph.h.
Definition at line 244 of file PTACallGraph.h.
Definition at line 246 of file PTACallGraph.h.
Definition at line 241 of file PTACallGraph.h.
Definition at line 245 of file PTACallGraph.h.
PTACallGraph::PTACallGraph | ( | CGEK | k = NormCallGraph | ) |
Constructor.
Definition at line 110 of file PTACallGraph.cpp.
Copy constructor.
copy call graph nodes
copy edges
Definition at line 117 of file PTACallGraph.cpp.
|
inlinevirtual |
|
inlineprotected |
Add CallSiteID.
Definition at line 278 of file PTACallGraph.h.
|
inlineprotected |
void PTACallGraph::addIndirectCallGraphEdge | ( | const CallICFGNode * | cs, |
const SVFFunction * | callerFun, | ||
const SVFFunction * | calleeFun | ||
) |
Add indirect call edges.
Add indirect call edge to update call graph
Definition at line 198 of file PTACallGraph.cpp.
|
protected |
Clean up memory.
Memory has been cleaned up at GenericGraph
Definition at line 154 of file PTACallGraph.cpp.
void PTACallGraph::dump | ( | const std::string & | filename | ) |
Dump the graph.
Dump call graph into dot file
Definition at line 327 of file PTACallGraph.cpp.
void PTACallGraph::getAllCallSitesInvokingCallee | ( | const SVFFunction * | callee, |
PTACallGraphEdge::CallInstSet & | csSet | ||
) |
Get callsites invoking the callee.
Get all callsite invoking this callee
Definition at line 220 of file PTACallGraph.cpp.
|
inline |
Definition at line 430 of file PTACallGraph.h.
|
inline |
Definition at line 437 of file PTACallGraph.h.
|
inline |
Definition at line 398 of file PTACallGraph.h.
|
inline |
Get all callees for a callsite.
Definition at line 411 of file PTACallGraph.h.
|
inline |
Definition at line 394 of file PTACallGraph.h.
|
inline |
Definition at line 360 of file PTACallGraph.h.
|
inline |
Get call graph node.
Definition at line 356 of file PTACallGraph.h.
|
inline |
Definition at line 346 of file PTACallGraph.h.
|
inline |
Definition at line 390 of file PTACallGraph.h.
|
inline |
Get CallSiteID.
Definition at line 371 of file PTACallGraph.h.
|
inline |
void PTACallGraph::getDirCallSitesInvokingCallee | ( | const SVFFunction * | callee, |
PTACallGraphEdge::CallInstSet & | csSet | ||
) |
Get direct callsite invoking this callee
Definition at line 242 of file PTACallGraph.cpp.
PTACallGraphEdge * PTACallGraph::getGraphEdge | ( | PTACallGraphNode * | src, |
PTACallGraphNode * | dst, | ||
PTACallGraphEdge::CEDGEK | kind, | ||
CallSiteID | csId | ||
) |
Get call graph edge via nodes.
get PTACallGraph edge via nodes
Definition at line 180 of file PTACallGraph.cpp.
|
inline |
Get callees from an indirect callsite.
Definition at line 321 of file PTACallGraph.h.
void PTACallGraph::getIndCallSitesInvokingCallee | ( | const SVFFunction * | callee, |
PTACallGraphEdge::CallInstSet & | csSet | ||
) |
Get indirect callsite invoking this callee
Definition at line 259 of file PTACallGraph.cpp.
|
inline |
Definition at line 329 of file PTACallGraph.h.
|
inline |
Return type of this callgraph.
Definition at line 314 of file PTACallGraph.h.
|
inline |
Definition at line 341 of file PTACallGraph.h.
|
inline |
Definition at line 336 of file PTACallGraph.h.
|
inline |
Get call graph edge via call instruction.
whether this call instruction has a valid call graph edge
Definition at line 426 of file PTACallGraph.h.
|
inline |
Definition at line 378 of file PTACallGraph.h.
PTACallGraphEdge * PTACallGraph::hasGraphEdge | ( | PTACallGraphNode * | src, |
PTACallGraphNode * | dst, | ||
PTACallGraphEdge::CEDGEK | kind, | ||
CallSiteID | csId | ||
) | const |
Whether we have already created this call graph edge.
Whether we have already created this call graph edge
Definition at line 161 of file PTACallGraph.cpp.
|
inline |
Definition at line 325 of file PTACallGraph.h.
bool PTACallGraph::isReachableBetweenFunctions | ( | const SVFFunction * | srcFn, |
const SVFFunction * | dstFn | ||
) | const |
Whether its reachable between two functions.
Whether its reachable between two functions
Definition at line 296 of file PTACallGraph.cpp.
void PTACallGraph::verifyCallGraph | ( | ) |
Issue a warning if the function which has indirect call sites can not be reached from program entry.
Issue a warning if the function which has indirect call sites can not be reached from program entry.
Definition at line 276 of file PTACallGraph.cpp.
void PTACallGraph::view | ( | ) |
View the graph from the debugger.
Definition at line 332 of file PTACallGraph.cpp.
|
protected |
Definition at line 269 of file PTACallGraph.h.
|
protected |
Map a call instruction to its corresponding call edges.
Definition at line 267 of file PTACallGraph.h.
|
staticprivate |
Call site information.
Map a pair of call instruction and callee to a callsite ID
Definition at line 261 of file PTACallGraph.h.
|
protected |
Call Graph node map.
Definition at line 266 of file PTACallGraph.h.
|
staticprivate |
Map a callsite ID to a pair of call instruction and callee.
Definition at line 262 of file PTACallGraph.h.
|
private |
Indirect call map.
Definition at line 258 of file PTACallGraph.h.
|
protected |
Definition at line 271 of file PTACallGraph.h.
|
protected |
Definition at line 270 of file PTACallGraph.h.
|
staticprivate |
CallSiteIDs, start from 1;.
Definition at line 263 of file PTACallGraph.h.