-
Notifications
You must be signed in to change notification settings - Fork 468
remove all SVFFunction in svf #1646
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
base: master
Are you sure you want to change the base?
Conversation
…st SVFFunction* F,
NodePairSet& cpySrcNodes);
…NodeMap; --> Map<const CallGraphNode*, PTACallGraphNode*> FunToCallGraphNodeMap; in PTACallGraphNode
…oPTACallGraphNodeMap cgNodeToPtaCallGraphNodeMap; in PTACallGraphNode
…tePair; --> std::pair<const CallICFGNode*, const CallGraphNode*> CallSitePair; in PTACallGraphNode
…t CallGraphNode*> FunctionSet; in PTACallGraphNode
…* fun; in ICFGNode
… GenericCallGraphNodeTy(i,CallNodeKd, f->getType()), fun(f)
…, and SaberCondAllocator
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1646 +/- ##
=======================================
Coverage 63.84% 63.84%
=======================================
Files 246 246
Lines 25993 26055 +62
Branches 4507 4509 +2
=======================================
+ Hits 16594 16635 +41
- Misses 9399 9420 +21
|
|
@jumormt pls review and make the code style consistent as you previous refactoring |
|
--- master-2.3.txt 2025-02-02 13:05:43 PTACallGraph Stats (Andersen analysis)****** Memory SSA Statistics****** PTACallGraph Stats (Flow-sensitive analysis)****** Persistent Points-To Cache Statistics: flow-sensitive analysis bitvector |
svf-llvm/lib/ICFGBuilder.cpp
Outdated
| llvmModuleSet()->getSVFValue(called_llvmval)); | ||
| calledFunc = llvmModuleSet()->getCallGraphNode(called_llvmfunc); | ||
| } | ||
| // else |
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.
Remove comments
| { | ||
| CallGraphNode* callNode = const_cast<CallGraphNode*>(item.first); | ||
| SVFFunction* fun = item.second; | ||
| callNode->init(fun->getFunctionType(), |
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.
Too many fields in the classs. Need to simplify fields and use methods for flags and some fields
|
|
||
| protected: | ||
| inline void setCallGraphNode(CallGraphNode *cgn) | ||
| inline void setCallGraphNode(const CallGraphNode *cgn) |
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 https://github.com/SVF-tools/SVF/pull/1646/files#diff-6873579e48857d104dff081895d5663ba73f00e17e370ac6c2304b02b8e4940eL58 to get callgraphnode from function
svf/include/Graphs/PTACallGraph.h
Outdated
| getCallEdgeEnd(cs); it != eit; ++it) | ||
| { | ||
| callees.insert((*it)->getDstNode()->getFunction()); | ||
| callees.insert((*it)->getDstNode()->getCallNode()); |
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.
getCallNode() -> getCallGraphNode()
| { | ||
| return callGraphSCC->isInCycle(callgraph->getCallGraphNode(fun)->getId()); | ||
| return callGraphSCC->isInCycle( | ||
| callgraph->getPTACallGraphNode(fun)->getId()); |
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.
fun->getId() is enough please also check other places
|
|
||
| protected: | ||
| FunToCallGraphNodeMap funToCallGraphNodeMap; ///< Call Graph node map | ||
| CgNodeToPTACallGraphNodeMap cgNodeToPtaCallGraphNodeMap; ///< Call Graph node map |
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.
We don't need this map. We can use id to get ptacallgraphnode from callgraphnode
svf/include/Util/CallGraphBuilder.h
Outdated
| CallGraph* buildSVFIRCallGraph(SVFModule* svfModule); | ||
| CallGraph* createSVFIRCallGraph(SVFModule* svfModule); | ||
|
|
||
| void connectSVFIRCallGraphEdge(CallGraph* 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.
addSVFIRCallGraphEdges
| FIFOWorkList<const SVFBasicBlock *> blkWorkList; | ||
| FIFOWorkList<const ICFGNode *> instWorklist; | ||
| for (const SVFBasicBlock * bb: callNode->getCalledFunction()->getReachableBBs()) | ||
| for (const SVFBasicBlock * bb: callNode->getCalledFunction()->getReachableBBs()) // HWG need to rethink this |
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.
remove comments
connectSVFIRCallGraphEdge -> addSVFIRCallGraphEdges
connectSVFIRCallGraphEdge -> addSVFIRCallGraphEdges
remove all SVFFunction in svf except SVFValue
svf-llvm remains some SVFFunction usages