remove all SVFFunction in svf#1646
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 |
| { | ||
| CallGraphNode* callNode = const_cast<CallGraphNode*>(item.first); | ||
| SVFFunction* fun = item.second; | ||
| callNode->init(fun->getFunctionType(), |
There was a problem hiding this comment.
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.
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.
getCallNode() -> getCallGraphNode()
| { | ||
| return callGraphSCC->isInCycle(callgraph->getCallGraphNode(fun)->getId()); | ||
| return callGraphSCC->isInCycle( | ||
| callgraph->getPTACallGraphNode(fun)->getId()); |
There was a problem hiding this comment.
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.
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); |
| 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 |
connectSVFIRCallGraphEdge -> addSVFIRCallGraphEdges
connectSVFIRCallGraphEdge -> addSVFIRCallGraphEdges
remove all SVFFunction in svf except SVFValue
svf-llvm remains some SVFFunction usages