#include <CallGraphBuilder.h>
Definition at line 44 of file CallGraphBuilder.h.
◆ CallGraphBuilder()
SVF::CallGraphBuilder::CallGraphBuilder |
( |
| ) |
|
|
default |
◆ buildPTACallGraph()
Buidl PTA callgraoh.
Definition at line 69 of file CallGraphBuilder.cpp.
70{
73}
CallGraph * getCallGraph()
static SVFIR * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
llvm::IRBuilder IRBuilder
◆ buildSVFIRCallGraph()
Buidl SVFIR callgraoh.
Definition at line 41 of file CallGraphBuilder.cpp.
42{
45 {
47 }
48
49 for (
const auto&
item : *callgraph)
50 {
52 {
54 {
56 {
59 {
61 }
62 }
63 }
64 }
65 }
66 return callgraph;
67}
void addCallGraphNode(const SVFFunction *fun)
void addDirectCallGraphEdge(const CallICFGNode *call, const SVFFunction *callerFun, const SVFFunction *calleeFun)
Add direct call edges.
const SVFFunction * getCalledFunction() const
const SVFFunction * getFunction(const std::string &name)
Get the corresponding Function based on its name.
bool isNonInstricCallSite(const ICFGNode *inst)
Whether an instruction is a callsite in the application code, excluding llvm intrinsic calls.
◆ buildThreadCallGraph()
Build thread-aware callgraph.
Definition at line 75 of file CallGraphBuilder.cpp.
76{
79
82 {
84 {
86 {
87 if (SVFUtil::isa<CallICFGNode>(inst) && tdAPI->
isTDFork(SVFUtil::cast<CallICFGNode>(inst)))
88 {
92 if (SVFUtil::isa<FunValVar>(
svfVar))
93 {
94 cg->addDirectForkEdge(cs);
95 }
96
97 else
98 {
99 cg->addThreadForkEdgeSetMap(cs,
nullptr);
100 }
101 }
102 }
103 }
104 }
105
107 {
109 {
111 {
112 if (SVFUtil::isa<CallICFGNode>(node) && tdAPI->
isTDJoin(SVFUtil::cast<CallICFGNode>(node)))
113 {
114 const CallICFGNode* cs = SVFUtil::cast<CallICFGNode>(node);
116 }
117 }
118 }
119 }
120
122}
const ValVar * getForkedFun(const CallICFGNode *inst) const
bool isTDFork(const CallICFGNode *inst) const
Return true if this call create a new thread.
bool isTDJoin(const CallICFGNode *inst) const
Return true if this call wait for a worker thread.
static ThreadAPI * getThreadAPI()
Return a static reference.
The documentation for this class was generated from the following files: