-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Callgraph #1570
Callgraph #1570
Conversation
# Conflicts: # svf/lib/Util/SVFUtil.cpp
# Conflicts: # svf-llvm/lib/LLVMModule.cpp # svf/include/Graphs/CallGraph.h # svf/lib/Graphs/CallGraph.cpp # svf/lib/Util/CallGraphBuilder.cpp
remove callgraph field
svf/include/Util/CallGraphBuilder.h
Outdated
protected: | ||
CallGraph* callgraph; | ||
const SVFModule::FunctionSetType* svfFunctionSet; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typedef SVFModule::FunctionSetType FunctionSetType;
svf/lib/Util/CallGraphBuilder.cpp
Outdated
|
||
buildCallGraph(svfModule); | ||
|
||
CallGraph* callgraph = new ThreadCallGraph(*(PAG::getPAG()->getCallGraph())); | ||
ThreadCallGraph* cg = dyn_cast<ThreadCallGraph>(callgraph); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ThreadCallGraph* cg = new ThreadCallGraph(*(PAG::getPAG()->getCallGraph()));
svf/lib/Util/CallGraphBuilder.cpp
Outdated
|
||
buildCallGraph(svfModule); | ||
|
||
CallGraph* callgraph = new ThreadCallGraph(*(PAG::getPAG()->getCallGraph())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete this line
svf/lib/Util/CallGraphBuilder.cpp
Outdated
ThreadCallGraph* cg = dyn_cast<ThreadCallGraph>(callgraph); | ||
assert(cg && "not a thread callgraph?"); | ||
|
||
ThreadAPI* tdAPI = ThreadAPI::getThreadAPI(); | ||
for (SVFModule::const_iterator F = svfModule->begin(), E = svfModule->end(); F != E; ++F) | ||
for (const auto& item: *PAG::getPAG()->getCallGraph()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a tmp variable to store PAG::getPAG()->getCallGraph() at the beginning of the function
svf/lib/Util/CallGraphBuilder.cpp
Outdated
return callgraph; | ||
} | ||
|
||
CallGraph* ThreadCallGraphBuilder::buildThreadCallGraph(SVFModule* svfModule) | ||
CallGraph* CallGraphBuilder::buildThreadCallGraph() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return Threadcallgraph*
--- master.txt 2024-10-11 14:19:54 CallGraph Stats (Andersen analysis)****** Memory SSA Statistics****** Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector |
svf/include/Util/CallGraphBuilder.h
Outdated
public: | ||
CallGraphBuilder(CallGraph* cg, ICFG* i): callgraph(cg),icfg(i) | ||
|
||
CallGraphBuilder(const SVFModule::FunctionSetType* fs, ICFG* i): svfFunctionSet(fs),icfg(i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use FunctionSetType
svf/lib/Util/CallGraphBuilder.cpp
Outdated
buildCallGraph(svfModule); | ||
|
||
ThreadCallGraph* cg = dyn_cast<ThreadCallGraph>(callgraph); | ||
ThreadCallGraph* cg = new ThreadCallGraph(*(PAG::getPAG()->getCallGraph())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PAG::getPAG()->getCallGraph() -> svfirCallGraph
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1570 +/- ##
==========================================
+ Coverage 62.84% 62.86% +0.01%
==========================================
Files 245 244 -1
Lines 25665 25694 +29
Branches 4505 4514 +9
==========================================
+ Hits 16130 16152 +22
- Misses 9535 9542 +7
|
svf/include/Graphs/ThreadCallGraph.h
Outdated
@@ -172,7 +172,7 @@ class ThreadCallGraph: public CallGraph | |||
typedef Map<const CallICFGNode*, ParForEdgeSet> CallInstToParForEdgesMap; | |||
|
|||
/// Constructor | |||
ThreadCallGraph(); | |||
ThreadCallGraph(CallGraph& cg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be ThreadCallGraph& ?
add a copy constuctor for CallGraph class
bullding callgraphs in CallGraphBuilder
building threadCallGraphs in ThreadCallGraphBuilder
merge ThreadCallGraphBuilder into CallgraphBuilder
remove callgraph field in CallgraphBuilder