|
Static Value-Flow Analysis
|
#include <CallGraph.h>
Public Member Functions | |
| CallGraph (CGEK k=NormCallGraph) | |
| Constructor. | |
| CallGraph (const CallGraph &other) | |
| Copy constructor. | |
| virtual | ~CallGraph () |
| Destructor. | |
| CGEK | getKind () const |
| Return type of this callgraph. | |
| CallEdgeMap & | getIndCallMap () |
| Get callees from an indirect callsite. | |
| bool | hasIndCSCallees (const CallICFGNode *cs) const |
| const FunctionSet & | getIndCSCallees (const CallICFGNode *cs) const |
| u32_t | getTotalCallSiteNumber () const |
| u32_t | getNumOfResolvedIndCallEdge () const |
| const CallInstToCallGraphEdgesMap & | getCallInstToCallGraphEdgesMap () const |
| void | verifyCallGraph () |
| Issue a warning if the function which has indirect call sites can not be reached from program entry. | |
| void | addDirectCallGraphEdge (const CallICFGNode *call, const FunObjVar *callerFun, const FunObjVar *calleeFun) |
| Add direct call edges. | |
| void | addCallGraphNode (const FunObjVar *fun) |
| const CallGraphNode * | getCallGraphNode (const std::string &name) const |
| Get call graph node. | |
| CallGraphNode * | getCallGraphNode (NodeID id) const |
| CallGraphNode * | getCallGraphNode (const FunObjVar *fun) const |
| CallSiteID | getCallSiteID (const CallICFGNode *cs, const FunObjVar *callee) const |
| Get CallSiteID. | |
| bool | hasCallSiteID (const CallICFGNode *cs, const FunObjVar *callee) const |
| const CallSitePair & | getCallSitePair (CallSiteID id) const |
| const CallICFGNode * | getCallSite (CallSiteID id) const |
| const FunObjVar * | getCallerOfCallSite (CallSiteID id) const |
| const FunObjVar * | getCalleeOfCallSite (CallSiteID id) const |
| CallGraphEdge * | hasGraphEdge (CallGraphNode *src, CallGraphNode *dst, CallGraphEdge::CEDGEK kind, CallSiteID csId) const |
| Whether we have already created this call graph edge. | |
| CallGraphEdge * | getGraphEdge (CallGraphNode *src, CallGraphNode *dst, CallGraphEdge::CEDGEK kind, CallSiteID csId) |
| Get call graph edge via nodes. | |
| void | getCallees (const CallICFGNode *cs, FunctionSet &callees) |
| Get all callees for a callsite. | |
| bool | hasCallGraphEdge (const CallICFGNode *inst) const |
| Get call graph edge via call instruction. | |
| CallGraphEdgeSet::const_iterator | getCallEdgeBegin (const CallICFGNode *inst) const |
| CallGraphEdgeSet::const_iterator | getCallEdgeEnd (const CallICFGNode *inst) const |
| void | addIndirectCallGraphEdge (const CallICFGNode *cs, const FunObjVar *callerFun, const FunObjVar *calleeFun) |
| Add indirect call edges. | |
| void | getAllCallSitesInvokingCallee (const FunObjVar *callee, CallGraphEdge::CallInstSet &csSet) |
| Get callsites invoking the callee. | |
| void | getDirCallSitesInvokingCallee (const FunObjVar *callee, CallGraphEdge::CallInstSet &csSet) |
| void | getIndCallSitesInvokingCallee (const FunObjVar *callee, CallGraphEdge::CallInstSet &csSet) |
| bool | isReachableBetweenFunctions (const FunObjVar *srcFn, const FunObjVar *dstFn) const |
| Whether its reachable between two functions. | |
| void | dump (const std::string &filename) |
| Dump the graph. | |
| void | view () |
| View the graph from the debugger. | |
| Public Member Functions inherited from SVF::GenericGraph< CallGraphNode, CallGraphEdge > | |
| 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 () |
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< CallGraphNode, CallGraphEdge > | |
| 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< CallGraphNode, CallGraphEdge > | |
| u32_t | edgeNum |
| total num of node | |
| u32_t | nodeNum |
| total num of edge | |
Definition at line 235 of file CallGraph.h.
| typedef OrderedMap<const CallICFGNode*, FunctionSet> SVF::CallGraph::CallEdgeMap |
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.
| typedef Map<const CallICFGNode*, CallGraphEdgeSet> SVF::CallGraph::CallInstToCallGraphEdgesMap |
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.
| typedef Set<const FunObjVar*> SVF::CallGraph::FunctionSet |
Definition at line 247 of file CallGraph.h.
| typedef Map<const FunObjVar*, CallGraphNode*> SVF::CallGraph::FunToCallGraphNodeMap |
Definition at line 242 of file CallGraph.h.
Definition at line 246 of file CallGraph.h.
| enum SVF::CallGraph::CGEK |
| CallGraph::CallGraph | ( | CGEK | k = NormCallGraph | ) |
Constructor.
Definition at line 123 of file CallGraph.cpp.
| CallGraph::CallGraph | ( | const CallGraph & | other | ) |
Copy constructor.
copy call graph nodes
copy edges
Definition at line 130 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 379 of file CallGraph.cpp.
| void CallGraph::addCallGraphNode | ( | const FunObjVar * | fun | ) |
Add call graph node
Definition at line 372 of file CallGraph.cpp.
|
inlineprotected |
Add CallSiteID.
Definition at line 279 of file CallGraph.h.
|
protected |
Definition at line 164 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 415 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 399 of file CallGraph.cpp.
|
inlineprotected |
Add call graph edge.
Definition at line 296 of file CallGraph.h.
| 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 223 of file CallGraph.cpp.
|
protected |
Clean up memory.
Memory has been cleaned up at GenericGraph
Definition at line 174 of file CallGraph.cpp.
| void CallGraph::dump | ( | const std::string & | filename | ) |
Dump the graph.
Dump call graph into dot file
Definition at line 358 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 245 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 90 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 386 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 |
Definition at line 402 of file CallGraph.h.
| void CallGraph::getDirCallSitesInvokingCallee | ( | const FunObjVar * | callee, |
| CallGraphEdge::CallInstSet & | csSet ) |
Get direct callsite invoking this callee
Definition at line 267 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 205 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 284 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 189 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 181 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 327 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 301 of file CallGraph.cpp.
| void CallGraph::view | ( | ) |
View the graph from the debugger.
Definition at line 363 of file CallGraph.cpp.
|
friend |
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.