|
Static Value-Flow Analysis
|
#include <CallGraph.h>
Public Types | |
| enum | CGEK { NormCallGraph , ThdCallGraph } |
| typedef CallGraphEdge::CallGraphEdgeSet | CallGraphEdgeSet |
| typedef Map< const FunObjVar *, CallGraphNode * > | FunToCallGraphNodeMap |
| typedef Map< const CallICFGNode *, CallGraphEdgeSet > | CallInstToCallGraphEdgesMap |
| typedef std::pair< const CallICFGNode *, const FunObjVar * > | CallSitePair |
| typedef Map< CallSitePair, CallSiteID > | CallSiteToIdMap |
| typedef Map< CallSiteID, CallSitePair > | IdToCallSiteMap |
| typedef Set< const FunObjVar * > | 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 FunObjVar *callee) |
| Add CallSiteID. | |
| CallSiteID | addCallSite (const CallICFGNode *cs, const FunObjVar *callee, const CallSiteID csid, std::pair< const CallICFGNode *, const FunObjVar * > newCS) |
| void | addEdge (CallGraphEdge *edge) |
| Add call graph edge. | |
| void | addDirectCallGraphEdge (CallGraphEdge *cgEdge) |
| add direct call graph edge from database [only used this function when loading cgEdges from db results] | |
| void | addCallGraphNode (CallGraphNode *cgNode) |
| add call graph node from database [only used this function when loading cgNodes from db results] | |
| CallGraphEdge * | hasGraphEdge (CallGraphEdge *cgEdge) const |
| Whether we have already created this 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;. | |
Friends | |
| class | GraphDBClient |
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 235 of file CallGraph.h.
Definition at line 248 of file CallGraph.h.
| typedef CallGraphEdgeSet::const_iterator SVF::CallGraph::CallGraphEdgeConstIter |
Definition at line 250 of file CallGraph.h.
| typedef CallGraphEdgeSet::iterator SVF::CallGraph::CallGraphEdgeIter |
Definition at line 249 of file CallGraph.h.
Definition at line 241 of file CallGraph.h.
Definition at line 243 of file CallGraph.h.
| typedef std::pair<const CallICFGNode*, const FunObjVar*> SVF::CallGraph::CallSitePair |
Definition at line 244 of file CallGraph.h.
Definition at line 245 of file CallGraph.h.
Definition at line 247 of file CallGraph.h.
Definition at line 242 of file CallGraph.h.
Definition at line 246 of file CallGraph.h.
| CallGraph::CallGraph | ( | CGEK | k = NormCallGraph | ) |
Constructor.
Definition at line 122 of file CallGraph.cpp.
Copy constructor.
copy call graph nodes
copy edges
Definition at line 129 of file CallGraph.cpp.
|
inlinevirtual |
|
protected |
add call graph node from database [only used this function when loading cgNodes from db results]
Definition at line 378 of file CallGraph.cpp.
Add call graph node
Definition at line 371 of file CallGraph.cpp.
|
inlineprotected |
Add CallSiteID.
Definition at line 279 of file CallGraph.h.
|
protected |
Definition at line 163 of file CallGraph.cpp.
|
protected |
add direct call graph edge from database [only used this function when loading cgEdges from db results]
Definition at line 414 of file CallGraph.cpp.
| void CallGraph::addDirectCallGraphEdge | ( | const CallICFGNode * | cs, |
| const FunObjVar * | callerFun, | ||
| const FunObjVar * | calleeFun | ||
| ) |
Add direct call edges.
Add direct call edges
Definition at line 398 of file CallGraph.cpp.
|
inlineprotected |
| void CallGraph::addIndirectCallGraphEdge | ( | const CallICFGNode * | cs, |
| const FunObjVar * | callerFun, | ||
| const FunObjVar * | calleeFun | ||
| ) |
Add indirect call edges.
Add indirect call edge to update call graph
Definition at line 222 of file CallGraph.cpp.
|
protected |
Clean up memory.
Memory has been cleaned up at GenericGraph
Definition at line 173 of file CallGraph.cpp.
| void CallGraph::dump | ( | const std::string & | filename | ) |
Dump the graph.
Dump call graph into dot file
Definition at line 357 of file CallGraph.cpp.
| void CallGraph::getAllCallSitesInvokingCallee | ( | const FunObjVar * | callee, |
| CallGraphEdge::CallInstSet & | csSet | ||
| ) |
Get callsites invoking the callee.
Get all callsite invoking this callee
Definition at line 244 of file CallGraph.cpp.
|
inline |
Definition at line 445 of file CallGraph.h.
|
inline |
Definition at line 452 of file CallGraph.h.
|
inline |
Definition at line 413 of file CallGraph.h.
|
inline |
Get all callees for a callsite.
Definition at line 426 of file CallGraph.h.
| const FunObjVar * CallGraph::getCallerOfCallSite | ( | CallSiteID | id | ) | const |
Definition at line 89 of file CallGraph.cpp.
|
inline |
Definition at line 378 of file CallGraph.h.
| const CallGraphNode * CallGraph::getCallGraphNode | ( | const std::string & | name | ) | const |
Get call graph node.
Definition at line 385 of file CallGraph.cpp.
|
inline |
Definition at line 374 of file CallGraph.h.
|
inline |
Definition at line 356 of file CallGraph.h.
|
inline |
Definition at line 408 of file CallGraph.h.
|
inline |
Get CallSiteID.
Definition at line 389 of file CallGraph.h.
|
inline |
| void CallGraph::getDirCallSitesInvokingCallee | ( | const FunObjVar * | callee, |
| CallGraphEdge::CallInstSet & | csSet | ||
| ) |
Get direct callsite invoking this callee
Definition at line 266 of file CallGraph.cpp.
| CallGraphEdge * CallGraph::getGraphEdge | ( | CallGraphNode * | src, |
| CallGraphNode * | dst, | ||
| CallGraphEdge::CEDGEK | kind, | ||
| CallSiteID | csId | ||
| ) |
Get call graph edge via nodes.
get PTACallGraph edge via nodes
Definition at line 204 of file CallGraph.cpp.
|
inline |
Get callees from an indirect callsite.
Definition at line 331 of file CallGraph.h.
| void CallGraph::getIndCallSitesInvokingCallee | ( | const FunObjVar * | callee, |
| CallGraphEdge::CallInstSet & | csSet | ||
| ) |
Get indirect callsite invoking this callee
Definition at line 283 of file CallGraph.cpp.
|
inline |
Definition at line 339 of file CallGraph.h.
|
inline |
Return type of this callgraph.
Definition at line 324 of file CallGraph.h.
|
inline |
Definition at line 351 of file CallGraph.h.
|
inline |
Definition at line 346 of file CallGraph.h.
|
inline |
Get call graph edge via call instruction.
whether this call instruction has a valid call graph edge
Definition at line 441 of file CallGraph.h.
|
inline |
Definition at line 396 of file CallGraph.h.
|
protected |
Whether we have already created this call graph edge.
Definition at line 188 of file CallGraph.cpp.
| CallGraphEdge * CallGraph::hasGraphEdge | ( | CallGraphNode * | src, |
| CallGraphNode * | dst, | ||
| CallGraphEdge::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 180 of file CallGraph.cpp.
|
inline |
Definition at line 335 of file CallGraph.h.
| bool CallGraph::isReachableBetweenFunctions | ( | const FunObjVar * | srcFn, |
| const FunObjVar * | dstFn | ||
| ) | const |
Whether its reachable between two functions.
Whether its reachable between two functions
Definition at line 326 of file CallGraph.cpp.
| void CallGraph::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 300 of file CallGraph.cpp.
| void CallGraph::view | ( | ) |
View the graph from the debugger.
Definition at line 362 of file CallGraph.cpp.
Definition at line 237 of file CallGraph.h.
|
protected |
Definition at line 270 of file CallGraph.h.
|
protected |
Map a call instruction to its corresponding call edges.
Definition at line 268 of file CallGraph.h.
|
staticprivate |
Call site information.
Map a pair of call instruction and callee to a callsite ID
Definition at line 262 of file CallGraph.h.
|
protected |
Call Graph node map.
Definition at line 267 of file CallGraph.h.
|
staticprivate |
Map a callsite ID to a pair of call instruction and callee.
Definition at line 263 of file CallGraph.h.
|
private |
Indirect call map.
Definition at line 259 of file CallGraph.h.
|
protected |
Definition at line 272 of file CallGraph.h.
|
protected |
Definition at line 271 of file CallGraph.h.
|
staticprivate |
CallSiteIDs, start from 1;.
Definition at line 264 of file CallGraph.h.