Static Value-Flow Analysis
|
#include <ThreadCallGraph.h>
Public Member Functions | |
ThreadCallGraph (const PTACallGraph &cg) | |
Constructor. More... | |
ThreadCallGraph (ThreadCallGraph &cg)=delete | |
virtual | ~ThreadCallGraph () |
Destructor. More... | |
void | updateCallGraph (PointerAnalysis *pta) |
Update call graph using pointer results. More... | |
void | updateJoinEdge (PointerAnalysis *pta) |
Update join edge using pointer analysis results. More... | |
bool | hasThreadForkEdge (const CallICFGNode *cs) const |
Get call graph edge via call instruction. More... | |
ForkEdgeSet::const_iterator | getForkEdgeBegin (const CallICFGNode *cs) const |
ForkEdgeSet::const_iterator | getForkEdgeEnd (const CallICFGNode *cs) const |
bool | hasThreadJoinEdge (const CallICFGNode *cs) const |
Get call graph edge via call instruction. More... | |
JoinEdgeSet::const_iterator | getJoinEdgeBegin (const CallICFGNode *cs) const |
JoinEdgeSet::const_iterator | getJoinEdgeEnd (const CallICFGNode *cs) const |
void | getJoinSites (const PTACallGraphNode *routine, InstSet &csSet) |
Public Member Functions inherited from SVF::PTACallGraph | |
PTACallGraph (CGEK k=NormCallGraph) | |
Constructor. More... | |
PTACallGraph (const PTACallGraph &other) | |
Copy constructor. More... | |
void | addCallGraphNode (const SVFFunction *fun) |
virtual | ~PTACallGraph () |
Destructor. More... | |
CGEK | getKind () const |
Return type of this callgraph. More... | |
CallEdgeMap & | getIndCallMap () |
Get callees from an indirect callsite. More... | |
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. More... | |
PTACallGraphNode * | getCallGraphNode (NodeID id) const |
Get call graph node. More... | |
PTACallGraphNode * | getCallGraphNode (const SVFFunction *fun) const |
CallSiteID | addCallSite (const CallICFGNode *cs, const SVFFunction *callee) |
Add/Get CallSiteID. More... | |
CallSiteID | getCallSiteID (const CallICFGNode *cs, const SVFFunction *callee) const |
bool | hasCallSiteID (const CallICFGNode *cs, const SVFFunction *callee) const |
const CallSitePair & | getCallSitePair (CallSiteID id) const |
const CallICFGNode * | getCallSite (CallSiteID id) const |
const SVFFunction * | getCallerOfCallSite (CallSiteID id) const |
const SVFFunction * | getCalleeOfCallSite (CallSiteID id) const |
PTACallGraphEdge * | hasGraphEdge (PTACallGraphNode *src, PTACallGraphNode *dst, PTACallGraphEdge::CEDGEK kind, CallSiteID csId) const |
Whether we have already created this call graph edge. More... | |
PTACallGraphEdge * | getGraphEdge (PTACallGraphNode *src, PTACallGraphNode *dst, PTACallGraphEdge::CEDGEK kind, CallSiteID csId) |
Get call graph edge via nodes. More... | |
void | getCallees (const CallICFGNode *cs, FunctionSet &callees) |
Get all callees for a callsite. More... | |
bool | hasCallGraphEdge (const CallICFGNode *inst) const |
Get call graph edge via call instruction. More... | |
CallGraphEdgeSet::const_iterator | getCallEdgeBegin (const CallICFGNode *inst) const |
CallGraphEdgeSet::const_iterator | getCallEdgeEnd (const CallICFGNode *inst) const |
void | addEdge (PTACallGraphEdge *edge) |
Add call graph edge. More... | |
void | addDirectCallGraphEdge (const CallICFGNode *call, const SVFFunction *callerFun, const SVFFunction *calleeFun) |
Add direct/indirect call edges. More... | |
void | addIndirectCallGraphEdge (const CallICFGNode *cs, const SVFFunction *callerFun, const SVFFunction *calleeFun) |
void | getAllCallSitesInvokingCallee (const SVFFunction *callee, PTACallGraphEdge::CallInstSet &csSet) |
Get callsites invoking the callee. More... | |
void | getDirCallSitesInvokingCallee (const SVFFunction *callee, PTACallGraphEdge::CallInstSet &csSet) |
void | getIndCallSitesInvokingCallee (const SVFFunction *callee, PTACallGraphEdge::CallInstSet &csSet) |
bool | isReachableBetweenFunctions (const SVFFunction *srcFn, const SVFFunction *dstFn) const |
Whether its reachable between two functions. More... | |
void | dump (const std::string &filename) |
Dump the graph. More... | |
void | view () |
View the graph from the debugger. More... | |
Public Member Functions inherited from SVF::GenericGraph< NodeTy, EdgeTy > | |
GenericGraph () | |
Constructor. More... | |
virtual | ~GenericGraph () |
Destructor. More... | |
void | destroy () |
Release memory. More... | |
iterator | begin () |
Iterators. More... | |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
void | addGNode (NodeID id, NodeType *node) |
Add a Node. More... | |
NodeType * | getGNode (NodeID id) const |
Get a node. More... | |
bool | hasGNode (NodeID id) const |
Has a node. More... | |
void | removeGNode (NodeType *node) |
Delete a node. More... | |
u32_t | getTotalNodeNum () const |
Get total number of node/edge. More... | |
u32_t | getTotalEdgeNum () const |
void | incNodeNum () |
Increase number of node/edge. More... | |
void | incEdgeNum () |
Static Public Member Functions | |
static bool | classof (const ThreadCallGraph *) |
ClassOf. More... | |
static bool | classof (const PTACallGraph *g) |
ThreadAPI * | tdAPI |
Thread API. More... | |
CallSiteSet | forksites |
all thread fork sites More... | |
CallSiteSet | joinsites |
all thread fork sites More... | |
CallSiteSet | parForSites |
all parallel for sites More... | |
CallInstToForkEdgesMap | callinstToThreadForkEdgesMap |
Map a call instruction to its corresponding fork edges. More... | |
CallInstToJoinEdgesMap | callinstToThreadJoinEdgesMap |
Map a call instruction to its corresponding join edges. More... | |
CallInstToParForEdgesMap | callinstToHareParForEdgesMap |
Map a call instruction to its corresponding hare_parallel_for edges. More... | |
bool | isForksite (const CallICFGNode *csInst) |
bool | isJoinsite (const CallICFGNode *csInst) |
bool | isParForSite (const CallICFGNode *csInst) |
CallSiteSet::const_iterator | forksitesBegin () const |
Fork sites iterators. More... | |
CallSiteSet::const_iterator | forksitesEnd () const |
CallSiteSet::const_iterator | joinsitesBegin () const |
Join sites iterators. More... | |
CallSiteSet::const_iterator | joinsitesEnd () const |
CallSiteSet::const_iterator | parForSitesBegin () const |
hare_parallel_for sites iterators More... | |
CallSiteSet::const_iterator | parForSitesEnd () const |
u32_t | getNumOfForksite () const |
Num of fork/join sites. More... | |
u32_t | getNumOfJoinsite () const |
u32_t | getNumOfParForSite () const |
ThreadAPI * | getThreadAPI () const |
Thread API. More... | |
bool | addForksite (const CallICFGNode *cs) |
Add fork sites which directly or indirectly create a thread. More... | |
bool | addJoinsite (const CallICFGNode *cs) |
bool | addParForSite (const CallICFGNode *cs) |
bool | addDirectForkEdge (const CallICFGNode *cs) |
Add direct/indirect thread fork edges. More... | |
bool | addIndirectForkEdge (const CallICFGNode *cs, const SVFFunction *callee) |
void | addDirectJoinEdge (const CallICFGNode *cs, const CallSiteSet &forksite) |
Add thread join edges. More... | |
void | addThreadForkEdgeSetMap (const CallICFGNode *cs, ThreadForkEdge *edge) |
map call instruction to its PTACallGraphEdge map More... | |
void | addThreadJoinEdgeSetMap (const CallICFGNode *cs, ThreadJoinEdge *edge) |
map call instruction to its PTACallGraphEdge map More... | |
void | addHareParForEdgeSetMap (const CallICFGNode *cs, HareParForEdge *edge) |
map call instruction to its PTACallGraphEdge map More... | |
ThreadJoinEdge * | hasThreadJoinEdge (const CallICFGNode *call, PTACallGraphNode *joinFunNode, PTACallGraphNode *threadRoutineFunNode, CallSiteID csId) const |
has thread join edge More... | |
Additional Inherited Members | |
Public Attributes inherited from SVF::GenericGraph< NodeTy, EdgeTy > | |
u32_t | edgeNum |
total num of node More... | |
u32_t | nodeNum |
total num of edge More... | |
Protected Member Functions inherited from SVF::PTACallGraph | |
void | destroy () |
Clean up memory. More... | |
Protected Attributes inherited from SVF::PTACallGraph | |
FunToCallGraphNodeMap | funToCallGraphNodeMap |
Call Graph node map. More... | |
CallInstToCallGraphEdgesMap | callinstToCallGraphEdgesMap |
Map a call instruction to its corresponding call edges. More... | |
NodeID | callGraphNodeNum |
u32_t | numOfResolvedIndCallEdge |
CGEK | kind |
Protected Attributes inherited from SVF::GenericGraph< NodeTy, EdgeTy > | |
IDToNodeMapTy | IDToNodeMap |
node map More... | |
Thread sensitive call graph
Definition at line 160 of file ThreadCallGraph.h.
typedef Map<const CallICFGNode*, ForkEdgeSet> SVF::ThreadCallGraph::CallInstToForkEdgesMap |
Definition at line 168 of file ThreadCallGraph.h.
typedef Map<const CallICFGNode*, JoinEdgeSet> SVF::ThreadCallGraph::CallInstToJoinEdgesMap |
Definition at line 170 of file ThreadCallGraph.h.
typedef Map<const CallICFGNode*, ParForEdgeSet> SVF::ThreadCallGraph::CallInstToParForEdgesMap |
Definition at line 172 of file ThreadCallGraph.h.
Definition at line 165 of file ThreadCallGraph.h.
typedef Set<CallSiteSet*> SVF::ThreadCallGraph::CtxSet |
Definition at line 166 of file ThreadCallGraph.h.
Definition at line 167 of file ThreadCallGraph.h.
typedef Set<const CallICFGNode*> SVF::ThreadCallGraph::InstSet |
Definition at line 164 of file ThreadCallGraph.h.
Definition at line 169 of file ThreadCallGraph.h.
Definition at line 171 of file ThreadCallGraph.h.
ThreadCallGraph::ThreadCallGraph | ( | const PTACallGraph & | cg | ) |
Constructor.
Constructor
Definition at line 42 of file ThreadCallGraph.cpp.
|
delete |
|
inlinevirtual |
bool ThreadCallGraph::addDirectForkEdge | ( | const CallICFGNode * | cs | ) |
Add direct/indirect thread fork edges.
Add direct fork edges
Definition at line 125 of file ThreadCallGraph.cpp.
void ThreadCallGraph::addDirectJoinEdge | ( | const CallICFGNode * | cs, |
const CallSiteSet & | forkset | ||
) |
Add thread join edges.
Add direct fork edges As join edge is a special return which is back to join site(s) rather than its fork site A ThreadJoinEdge is created from the functions where join sites reside in to the start routine function But we don't invoke addEdge() method to add the edge to src and dst, otherwise it makes a scc cycle
Definition at line 180 of file ThreadCallGraph.cpp.
|
inline |
Add fork sites which directly or indirectly create a thread.
Definition at line 333 of file ThreadCallGraph.h.
|
inline |
map call instruction to its PTACallGraphEdge map
Definition at line 383 of file ThreadCallGraph.h.
bool ThreadCallGraph::addIndirectForkEdge | ( | const CallICFGNode * | cs, |
const SVFFunction * | calleefun | ||
) |
Add indirect fork edge to update call graph
Definition at line 152 of file ThreadCallGraph.cpp.
|
inline |
Definition at line 338 of file ThreadCallGraph.h.
|
inline |
Definition at line 343 of file ThreadCallGraph.h.
|
inline |
|
inline |
|
inlinestatic |
Definition at line 190 of file ThreadCallGraph.h.
|
inlinestatic |
|
inline |
Fork sites iterators.
Definition at line 275 of file ThreadCallGraph.h.
|
inline |
Definition at line 279 of file ThreadCallGraph.h.
|
inline |
Definition at line 210 of file ThreadCallGraph.h.
|
inline |
Definition at line 216 of file ThreadCallGraph.h.
|
inline |
Definition at line 230 of file ThreadCallGraph.h.
|
inline |
Definition at line 236 of file ThreadCallGraph.h.
|
inline |
Definition at line 242 of file ThreadCallGraph.h.
|
inline |
Num of fork/join sites.
Definition at line 311 of file ThreadCallGraph.h.
|
inline |
Definition at line 315 of file ThreadCallGraph.h.
|
inline |
Definition at line 319 of file ThreadCallGraph.h.
|
inline |
|
inline |
Get call graph edge via call instruction.
whether this call instruction has a valid call graph edge
Definition at line 205 of file ThreadCallGraph.h.
|
inline |
|
inline |
Get call graph edge via call instruction.
whether this call instruction has a valid call graph edge
Definition at line 226 of file ThreadCallGraph.h.
|
inline |
Whether a callsite is a fork or join or hare_parallel_for
Definition at line 259 of file ThreadCallGraph.h.
|
inline |
Definition at line 263 of file ThreadCallGraph.h.
|
inline |
Definition at line 267 of file ThreadCallGraph.h.
|
inline |
Join sites iterators.
Definition at line 287 of file ThreadCallGraph.h.
|
inline |
Definition at line 291 of file ThreadCallGraph.h.
|
inline |
hare_parallel_for sites iterators
Definition at line 299 of file ThreadCallGraph.h.
|
inline |
Definition at line 303 of file ThreadCallGraph.h.
void ThreadCallGraph::updateCallGraph | ( | PointerAnalysis * | pta | ) |
Update call graph using pointer results.
Definition at line 56 of file ThreadCallGraph.cpp.
void ThreadCallGraph::updateJoinEdge | ( | PointerAnalysis * | pta | ) |
Update join edge using pointer analysis results.
Update join edge using pointer analysis results
Definition at line 101 of file ThreadCallGraph.cpp.
|
private |
Map a call instruction to its corresponding hare_parallel_for edges.
Definition at line 413 of file ThreadCallGraph.h.
|
private |
Map a call instruction to its corresponding fork edges.
Definition at line 411 of file ThreadCallGraph.h.
|
private |
Map a call instruction to its corresponding join edges.
Definition at line 412 of file ThreadCallGraph.h.
|
private |
all thread fork sites
Definition at line 408 of file ThreadCallGraph.h.
|
private |
all thread fork sites
Definition at line 409 of file ThreadCallGraph.h.
|
private |
all parallel for sites
Definition at line 410 of file ThreadCallGraph.h.
|
private |
Thread API.
Definition at line 407 of file ThreadCallGraph.h.