svf-tools 1.0.977 → 1.0.978

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/package.json +1 -1
  2. package/svf/include/AE/Svfexe/AbstractInterpretation.h +1 -1
  3. package/svf/include/DDA/ContextDDA.h +2 -2
  4. package/svf/include/DDA/DDAVFSolver.h +5 -5
  5. package/svf/include/DDA/FlowDDA.h +1 -1
  6. package/svf/include/Graphs/{PTACallGraph.h → CallGraph.h} +41 -41
  7. package/svf/include/Graphs/ICFG.h +2 -2
  8. package/svf/include/Graphs/ThreadCallGraph.h +24 -30
  9. package/svf/include/Graphs/VFG.h +4 -4
  10. package/svf/include/MSSA/MemRegion.h +4 -4
  11. package/svf/include/MTA/LockAnalysis.h +42 -32
  12. package/svf/include/MTA/MHP.h +34 -54
  13. package/svf/include/MTA/MTAStat.h +1 -2
  14. package/svf/include/MTA/TCT.h +43 -25
  15. package/svf/include/MemoryModel/PointerAnalysis.h +13 -13
  16. package/svf/include/SABER/SaberSVFGBuilder.h +1 -1
  17. package/svf/include/SABER/SrcSnkDDA.h +7 -7
  18. package/svf/include/Util/CallGraphBuilder.h +5 -5
  19. package/svf/include/Util/CxtStmt.h +13 -12
  20. package/svf/include/Util/Options.h +1 -20
  21. package/svf/include/Util/SVFUtil.h +8 -43
  22. package/svf/include/Util/ThreadAPI.h +42 -85
  23. package/svf/lib/AE/Svfexe/AbstractInterpretation.cpp +1 -1
  24. package/svf/lib/CFL/CFLSVFGBuilder.cpp +1 -1
  25. package/svf/lib/DDA/ContextDDA.cpp +9 -9
  26. package/svf/lib/DDA/DDAClient.cpp +3 -3
  27. package/svf/lib/DDA/DDAPass.cpp +4 -4
  28. package/svf/lib/DDA/FlowDDA.cpp +2 -2
  29. package/svf/lib/Graphs/{PTACallGraph.cpp → CallGraph.cpp} +66 -66
  30. package/svf/lib/Graphs/ICFG.cpp +6 -6
  31. package/svf/lib/Graphs/SVFG.cpp +7 -7
  32. package/svf/lib/Graphs/SVFGReadWrite.cpp +6 -6
  33. package/svf/lib/Graphs/SVFGStat.cpp +1 -1
  34. package/svf/lib/Graphs/ThreadCallGraph.cpp +12 -84
  35. package/svf/lib/Graphs/VFG.cpp +1 -1
  36. package/svf/lib/MSSA/MemRegion.cpp +7 -7
  37. package/svf/lib/MTA/LockAnalysis.cpp +100 -92
  38. package/svf/lib/MTA/MHP.cpp +159 -138
  39. package/svf/lib/MTA/MTA.cpp +3 -41
  40. package/svf/lib/MTA/MTAStat.cpp +7 -33
  41. package/svf/lib/MTA/TCT.cpp +52 -52
  42. package/svf/lib/MemoryModel/PointerAnalysis.cpp +12 -12
  43. package/svf/lib/SABER/LeakChecker.cpp +4 -4
  44. package/svf/lib/SABER/SaberSVFGBuilder.cpp +4 -4
  45. package/svf/lib/SABER/SrcSnkDDA.cpp +1 -1
  46. package/svf/lib/Util/CallGraphBuilder.cpp +2 -17
  47. package/svf/lib/Util/Options.cpp +0 -62
  48. package/svf/lib/Util/PTAStat.cpp +7 -7
  49. package/svf/lib/Util/ThreadAPI.cpp +27 -6
  50. package/svf/lib/WPA/VersionedFlowSensitive.cpp +2 -2
  51. package/svf-llvm/include/SVF-LLVM/SVFIRBuilder.h +1 -1
  52. package/svf-llvm/lib/SVFIRBuilder.cpp +5 -5
  53. package/svf-llvm/lib/SVFIRExtAPI.cpp +0 -26
  54. package/svf-llvm/tools/AE/ae.cpp +1 -1
  55. package/svf-llvm/tools/Example/svf-ex.cpp +1 -1
  56. package/svf-llvm/tools/MTA/CMakeLists.txt +1 -1
  57. package/svf-llvm/tools/MTA/mta.cpp +0 -8
  58. package/svf/include/MTA/FSMPTA.h +0 -270
  59. package/svf/include/MTA/MTAResultValidator.h +0 -448
  60. package/svf/include/MTA/PCG.h +0 -229
  61. package/svf/lib/MTA/FSMPTA.cpp +0 -792
  62. package/svf/lib/MTA/PCG.cpp +0 -364
  63. package/svf-llvm/tools/MTA/LockResultValidator.cpp +0 -251
  64. package/svf-llvm/tools/MTA/LockResultValidator.h +0 -84
  65. package/svf-llvm/tools/MTA/MTAAnnotator.cpp +0 -293
  66. package/svf-llvm/tools/MTA/MTAAnnotator.h +0 -120
  67. package/svf-llvm/tools/MTA/MTAResultValidator.cpp +0 -716
  68. package/svf-llvm/tools/MTA/MTAResultValidator.h +0 -337
@@ -38,7 +38,7 @@ using namespace SVFUtil;
38
38
  * Constructor
39
39
  */
40
40
  ThreadCallGraph::ThreadCallGraph() :
41
- PTACallGraph(ThdCallGraph), tdAPI(ThreadAPI::getThreadAPI())
41
+ CallGraph(ThdCallGraph), tdAPI(ThreadAPI::getThreadAPI())
42
42
  {
43
43
  DBOUT(DGENERAL, outs() << SVFUtil::pasMsg("Building ThreadCallGraph\n"));
44
44
  }
@@ -58,8 +58,8 @@ void ThreadCallGraph::updateCallGraph(PointerAnalysis* pta)
58
58
  for (; iter != eiter; iter++)
59
59
  {
60
60
  const CallICFGNode* cs = iter->first;
61
- const PTACallGraph::FunctionSet &functions = iter->second;
62
- for (PTACallGraph::FunctionSet::const_iterator func_iter =
61
+ const CallGraph::FunctionSet &functions = iter->second;
62
+ for (CallGraph::FunctionSet::const_iterator func_iter =
63
63
  functions.begin(); func_iter != functions.end(); func_iter++)
64
64
  {
65
65
  const SVFFunction* callee = *func_iter;
@@ -89,29 +89,6 @@ void ThreadCallGraph::updateCallGraph(PointerAnalysis* pta)
89
89
  }
90
90
  }
91
91
  }
92
-
93
- // parallel_for sites
94
- for (CallSiteSet::const_iterator it = parForSitesBegin(), eit = parForSitesEnd(); it != eit; ++it)
95
- {
96
- const SVFValue* forkedval = tdAPI->getTaskFuncAtHareParForSite((*it)->getCallSite());
97
- if(SVFUtil::dyn_cast<SVFFunction>(forkedval)==nullptr)
98
- {
99
- SVFIR* pag = pta->getPAG();
100
- const NodeBS targets = pta->getPts(pag->getValueNode(forkedval)).toNodeBS();
101
- for (NodeBS::iterator ii = targets.begin(), ie = targets.end(); ii != ie; ii++)
102
- {
103
- if(ObjVar* objPN = SVFUtil::dyn_cast<ObjVar>(pag->getGNode(*ii)))
104
- {
105
- const MemObj* obj = pag->getObject(objPN);
106
- if(obj->isFunction())
107
- {
108
- const SVFFunction* svfCallee = SVFUtil::cast<SVFFunction>(obj->getValue());
109
- this->addIndirectForkEdge(*it, svfCallee);
110
- }
111
- }
112
- }
113
- }
114
- }
115
92
  }
116
93
 
117
94
 
@@ -123,7 +100,7 @@ void ThreadCallGraph::updateJoinEdge(PointerAnalysis* pta)
123
100
 
124
101
  for (CallSiteSet::const_iterator it = joinsitesBegin(), eit = joinsitesEnd(); it != eit; ++it)
125
102
  {
126
- const SVFValue* jointhread = tdAPI->getJoinedThread((*it)->getCallSite());
103
+ const SVFValue* jointhread = tdAPI->getJoinedThread(*it);
127
104
  // find its corresponding fork sites first
128
105
  CallSiteSet forkset;
129
106
  for (CallSiteSet::const_iterator it = forksitesBegin(), eit = forksitesEnd(); it != eit; ++it)
@@ -145,13 +122,13 @@ void ThreadCallGraph::updateJoinEdge(PointerAnalysis* pta)
145
122
  void ThreadCallGraph::addDirectForkEdge(const CallICFGNode* cs)
146
123
  {
147
124
 
148
- PTACallGraphNode* caller = getCallGraphNode(cs->getCaller());
125
+ CallGraphNode* caller = getCallGraphNode(cs->getCaller());
149
126
  const SVFFunction* forkee = SVFUtil::dyn_cast<SVFFunction>(tdAPI->getForkedFun(cs->getCallSite()));
150
127
  assert(forkee && "callee does not exist");
151
- PTACallGraphNode* callee = getCallGraphNode(forkee->getDefFunForMultipleModule());
128
+ CallGraphNode* callee = getCallGraphNode(forkee->getDefFunForMultipleModule());
152
129
  CallSiteID csId = addCallSite(cs, callee->getFunction());
153
130
 
154
- if (!hasGraphEdge(caller, callee, PTACallGraphEdge::TDForkEdge, csId))
131
+ if (!hasGraphEdge(caller, callee, CallGraphEdge::TDForkEdge, csId))
155
132
  {
156
133
  assert(cs->getCaller() == caller->getFunction() && "callee instruction not inside caller??");
157
134
 
@@ -168,12 +145,12 @@ void ThreadCallGraph::addDirectForkEdge(const CallICFGNode* cs)
168
145
  */
169
146
  void ThreadCallGraph::addIndirectForkEdge(const CallICFGNode* cs, const SVFFunction* calleefun)
170
147
  {
171
- PTACallGraphNode* caller = getCallGraphNode(cs->getCaller());
172
- PTACallGraphNode* callee = getCallGraphNode(calleefun);
148
+ CallGraphNode* caller = getCallGraphNode(cs->getCaller());
149
+ CallGraphNode* callee = getCallGraphNode(calleefun);
173
150
 
174
151
  CallSiteID csId = addCallSite(cs, callee->getFunction());
175
152
 
176
- if (!hasGraphEdge(caller, callee, PTACallGraphEdge::TDForkEdge, csId))
153
+ if (!hasGraphEdge(caller, callee, CallGraphEdge::TDForkEdge, csId))
177
154
  {
178
155
  assert(cs->getCaller() == caller->getFunction() && "callee instruction not inside caller??");
179
156
 
@@ -194,14 +171,14 @@ void ThreadCallGraph::addIndirectForkEdge(const CallICFGNode* cs, const SVFFunct
194
171
  void ThreadCallGraph::addDirectJoinEdge(const CallICFGNode* cs,const CallSiteSet& forkset)
195
172
  {
196
173
 
197
- PTACallGraphNode* joinFunNode = getCallGraphNode(cs->getCaller());
174
+ CallGraphNode* joinFunNode = getCallGraphNode(cs->getCaller());
198
175
 
199
176
  for (CallSiteSet::const_iterator it = forkset.begin(), eit = forkset.end(); it != eit; ++it)
200
177
  {
201
178
 
202
179
  const SVFFunction* threadRoutineFun = SVFUtil::dyn_cast<SVFFunction>(tdAPI->getForkedFun((*it)->getCallSite()));
203
180
  assert(threadRoutineFun && "thread routine function does not exist");
204
- PTACallGraphNode* threadRoutineFunNode = getCallGraphNode(threadRoutineFun);
181
+ CallGraphNode* threadRoutineFunNode = getCallGraphNode(threadRoutineFun);
205
182
  CallSiteID csId = addCallSite(cs, threadRoutineFun);
206
183
 
207
184
  if (!hasThreadJoinEdge(cs,joinFunNode,threadRoutineFunNode, csId))
@@ -214,52 +191,3 @@ void ThreadCallGraph::addDirectJoinEdge(const CallICFGNode* cs,const CallSiteSet
214
191
  }
215
192
  }
216
193
  }
217
-
218
- /*!
219
- * Add a direct ParFor edges
220
- */
221
- void ThreadCallGraph::addDirectParForEdge(const CallICFGNode* cs)
222
- {
223
-
224
- PTACallGraphNode* caller = getCallGraphNode(cs->getCaller());
225
- const SVFFunction* taskFunc = SVFUtil::dyn_cast<SVFFunction>(tdAPI->getTaskFuncAtHareParForSite(cs->getCallSite()));
226
- assert(taskFunc && "callee does not exist");
227
-
228
- PTACallGraphNode* callee = getCallGraphNode(taskFunc);
229
-
230
- CallSiteID csId = addCallSite(cs, callee->getFunction());
231
-
232
- if (!hasGraphEdge(caller, callee, PTACallGraphEdge::TDForkEdge, csId))
233
- {
234
- assert(cs->getCaller() == caller->getFunction() && "callee instruction not inside caller??");
235
-
236
- HareParForEdge* edge = new HareParForEdge(caller, callee, csId);
237
- edge->addDirectCallSite(cs);
238
-
239
- addEdge(edge);
240
- addHareParForEdgeSetMap(cs, edge);
241
- }
242
- }
243
-
244
- /*!
245
- * Add an indirect ParFor edge to update call graph
246
- */
247
- void ThreadCallGraph::addIndirectParForEdge(const CallICFGNode* cs, const SVFFunction* calleefun)
248
- {
249
-
250
- PTACallGraphNode* caller = getCallGraphNode(cs->getCaller());
251
- PTACallGraphNode* callee = getCallGraphNode(calleefun);
252
-
253
- CallSiteID csId = addCallSite(cs, callee->getFunction());
254
-
255
- if (!hasGraphEdge(caller, callee, PTACallGraphEdge::HareParForEdge,csId))
256
- {
257
- assert(cs->getCaller() == caller->getFunction() && "callee instruction not inside caller??");
258
-
259
- HareParForEdge* edge = new HareParForEdge(caller, callee, csId);
260
- edge->addInDirectCallSite(cs);
261
-
262
- addEdge(edge);
263
- addHareParForEdgeSetMap(cs, edge);
264
- }
265
- }
@@ -438,7 +438,7 @@ PHIVFGNode::PHIVFGNode(NodeID id, const PAGNode* r,VFGNodeK k): VFGNode(id, k),
438
438
  * 2) connect VFG edges
439
439
  * between two statements (PAGEdges)
440
440
  */
441
- VFG::VFG(PTACallGraph* cg, VFGK k): totalVFGNode(0), callgraph(cg), pag(SVFIR::getPAG()), kind(k)
441
+ VFG::VFG(CallGraph* cg, VFGK k): totalVFGNode(0), callgraph(cg), pag(SVFIR::getPAG()), kind(k)
442
442
  {
443
443
 
444
444
  DBOUT(DGENERAL, outs() << pasMsg("\tCreate VFG Top Level Node\n"));
@@ -41,7 +41,7 @@ u32_t MRVer::totalVERNum = 0;
41
41
  MRGenerator::MRGenerator(BVDataPTAImpl* p, bool ptrOnly) :
42
42
  pta(p), ptrOnlyMSSA(ptrOnly)
43
43
  {
44
- callGraph = pta->getPTACallGraph();
44
+ callGraph = pta->getCallGraph();
45
45
  callGraphSCC = new SCC(callGraph);
46
46
  }
47
47
 
@@ -248,7 +248,7 @@ void MRGenerator::collectModRefForCall()
248
248
  const NodeBS& subNodes = callGraphSCC->subNodes(callGraphNodeID);
249
249
  for(NodeBS::iterator it = subNodes.begin(), eit = subNodes.end(); it!=eit; ++it)
250
250
  {
251
- PTACallGraphNode* subCallGraphNode = callGraph->getCallGraphNode(*it);
251
+ CallGraphNode* subCallGraphNode = callGraph->getCallGraphNode(*it);
252
252
  /// Get mod-ref of all callsites calling callGraphNode
253
253
  modRefAnalysis(subCallGraphNode,worklist);
254
254
  }
@@ -630,17 +630,17 @@ bool MRGenerator::handleCallsiteModRef(NodeBS& mod, NodeBS& ref, const CallICFGN
630
630
  * Call site mod-ref analysis
631
631
  * Compute mod-ref of all callsites invoking this call graph node
632
632
  */
633
- void MRGenerator::modRefAnalysis(PTACallGraphNode* callGraphNode, WorkList& worklist)
633
+ void MRGenerator::modRefAnalysis(CallGraphNode* callGraphNode, WorkList& worklist)
634
634
  {
635
635
 
636
636
  /// add ref/mod set of callee to its invocation callsites at caller
637
- for(PTACallGraphNode::iterator it = callGraphNode->InEdgeBegin(), eit = callGraphNode->InEdgeEnd();
637
+ for(CallGraphNode::iterator it = callGraphNode->InEdgeBegin(), eit = callGraphNode->InEdgeEnd();
638
638
  it!=eit; ++it)
639
639
  {
640
- PTACallGraphEdge* edge = *it;
640
+ CallGraphEdge* edge = *it;
641
641
 
642
642
  /// handle direct callsites
643
- for(PTACallGraphEdge::CallInstSet::iterator cit = edge->getDirectCalls().begin(),
643
+ for(CallGraphEdge::CallInstSet::iterator cit = edge->getDirectCalls().begin(),
644
644
  ecit = edge->getDirectCalls().end(); cit!=ecit; ++cit)
645
645
  {
646
646
  NodeBS mod, ref;
@@ -650,7 +650,7 @@ void MRGenerator::modRefAnalysis(PTACallGraphNode* callGraphNode, WorkList& work
650
650
  worklist.push(edge->getSrcID());
651
651
  }
652
652
  /// handle indirect callsites
653
- for(PTACallGraphEdge::CallInstSet::iterator cit = edge->getIndirectCalls().begin(),
653
+ for(CallGraphEdge::CallInstSet::iterator cit = edge->getIndirectCalls().begin(),
654
654
  ecit = edge->getIndirectCalls().end(); cit!=ecit; ++cit)
655
655
  {
656
656
  NodeBS mod, ref;