#include <CallGraphBuilder.h>
Definition at line 41 of file CallGraphBuilder.h.
◆ CallGraphBuilder()
| SVF::CallGraphBuilder::CallGraphBuilder |
( |
| ) |
|
|
default |
◆ buildPAGCallGraph()
| CallGraph * CallGraphBuilder::buildPAGCallGraph |
( |
const std::vector< const FunObjVar * > & | funset | ) |
|
Buidl PAG callgraoh.
Definition at line 41 of file CallGraphBuilder.cpp.
42{
43 CallGraph* callgraph = new CallGraph();
44 for (const FunObjVar* svfFunc: funset)
45 {
47 }
48
49 for (
const auto&
item : *callgraph)
50 {
51 for (
auto it : *(
item.second)->getFunction())
52 {
53 const SVFBasicBlock* svfbb = it.second;
55 {
57 {
60 {
61 callgraph->addDirectCallGraphEdge(callBlockNode,(
item.second)->getFunction(),callee);
62 }
63 }
64 }
65 }
66 }
67 return callgraph;
68}
void addCallGraphNode(CallGraphNode *cgNode)
add call graph node from database [only used this function when loading cgNodes from db results]
const FunObjVar * getCalledFunction() const
const std::vector< const ICFGNode * > & getICFGNodeList() const
std::enable_if_t<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type > cast(const Y &Val)
bool isNonInstricCallSite(const ICFGNode *inst)
Whether an instruction is a callsite in the application code, excluding llvm intrinsic calls.
◆ buildPTACallGraph()
| CallGraph * CallGraphBuilder::buildPTACallGraph |
( |
| ) |
|
Buidl PTA callgraoh.
Definition at line 70 of file CallGraphBuilder.cpp.
71{
72 return new CallGraph(*(
PAG::getPAG()->getCallGraph()));
73}
static PAG * getPAG(bool buildFromFile=false)
Singleton design here to make sure we only have one instance during any analysis.
◆ buildThreadCallGraph()
Build thread-aware callgraph.
Definition at line 75 of file CallGraphBuilder.cpp.
76{
78 ThreadCallGraph* cg = new ThreadCallGraph(*pagCallGraph);
79
81 for (
const auto&
item: *pagCallGraph)
82 {
83 for (
auto it : *(
item.second)->getFunction())
84 {
85 const SVFBasicBlock* svfbb = it.second;
87 {
89 {
94 {
96 }
97
98 else
99 {
101 }
102 }
103 }
104 }
105 }
106
107 for (
const auto&
item: *pagCallGraph)
108 {
109 for (
auto it : *(
item.second)->getFunction())
110 {
111 const SVFBasicBlock* svfbb = it.second;
113 {
115 {
118 }
119 }
120 }
121 }
122
123 return cg;
124}
const CallGraph * getCallGraph()
Get CG.
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.
bool addDirectForkEdge(const CallICFGNode *cs)
Add direct/indirect thread fork edges.
bool addForksite(const CallICFGNode *cs)
Add fork sites which directly or indirectly create a thread.
bool addJoinsite(const CallICFGNode *cs)
void addThreadForkEdgeSetMap(const CallICFGNode *cs, ThreadForkEdge *edge)
map call instruction to its PTACallGraphEdge map
LLVM_NODISCARD bool isa(const Y &Val)
The documentation for this class was generated from the following files: