svf-tools 1.0.539 → 1.0.540

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 (180) hide show
  1. package/SVF-doxygen/html/html/AndersenStat_8cpp_source.html +2 -2
  2. package/SVF-doxygen/html/html/Andersen_8h_source.html +1 -1
  3. package/SVF-doxygen/html/html/BreakConstantExpr_8h_source.html +2 -1
  4. package/SVF-doxygen/html/html/CFGNormalizer_8h_source.html +1 -1
  5. package/SVF-doxygen/html/html/CFLAlias_8cpp_source.html +5 -4
  6. package/SVF-doxygen/html/html/CFLAlias_8h_source.html +15 -15
  7. package/SVF-doxygen/html/html/CFLGramGraphChecker_8h_source.html +4 -4
  8. package/SVF-doxygen/html/html/CFLGrammar_8txt.html +39 -39
  9. package/SVF-doxygen/html/html/CFLGraphBuilder_8cpp_source.html +20 -8
  10. package/SVF-doxygen/html/html/CFLGraphBuilder_8h_source.html +16 -15
  11. package/SVF-doxygen/html/html/CHGBuilder_8cpp.html +1 -1
  12. package/SVF-doxygen/html/html/CHGBuilder_8cpp_source.html +2 -1
  13. package/SVF-doxygen/html/html/CHGBuilder_8h_source.html +2 -1
  14. package/SVF-doxygen/html/html/CPPUtil_8h.html +4 -4
  15. package/SVF-doxygen/html/html/DDAStat_8cpp_source.html +2 -2
  16. package/SVF-doxygen/html/html/DDAStat_8h.html +1 -1
  17. package/SVF-doxygen/html/html/DDAStat_8h_source.html +1 -1
  18. package/SVF-doxygen/html/html/ExtAPI_8h_source.html +1 -1
  19. package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +2 -2
  20. package/SVF-doxygen/html/html/GrammarBuilder_8cpp_source.html +4 -4
  21. package/SVF-doxygen/html/html/GrammarBuilder_8h_source.html +3 -3
  22. package/SVF-doxygen/html/html/ICFGStat_8h.html +1 -1
  23. package/SVF-doxygen/html/html/ICFGStat_8h_source.html +1 -1
  24. package/SVF-doxygen/html/html/LLVMLoopAnalysis_8cpp_source.html +1 -1
  25. package/SVF-doxygen/html/html/LLVMModule_8cpp_source.html +2 -1
  26. package/SVF-doxygen/html/html/LLVMUtil_8h_source.html +1 -1
  27. package/SVF-doxygen/html/html/LockAnalysis_8cpp.html +1 -1
  28. package/SVF-doxygen/html/html/LockAnalysis_8cpp_source.html +1 -1
  29. package/SVF-doxygen/html/html/MHP_8cpp.html +1 -1
  30. package/SVF-doxygen/html/html/MHP_8cpp_source.html +1 -1
  31. package/SVF-doxygen/html/html/MTAResultValidator_8h_source.html +2 -1
  32. package/SVF-doxygen/html/html/MTAStat_8cpp_source.html +1 -1
  33. package/SVF-doxygen/html/html/MTAStat_8h.html +1 -1
  34. package/SVF-doxygen/html/html/MTAStat_8h_source.html +1 -1
  35. package/SVF-doxygen/html/html/NodeIDAllocator_8cpp.html +1 -1
  36. package/SVF-doxygen/html/html/NodeIDAllocator_8cpp_source.html +1 -1
  37. package/SVF-doxygen/html/html/Options_8cpp_source.html +5 -3
  38. package/SVF-doxygen/html/html/Options_8h.html +1 -1
  39. package/SVF-doxygen/html/html/Options_8h_source.html +5 -3
  40. package/SVF-doxygen/html/html/PEGGrammar_8txt.html +314 -0
  41. package/SVF-doxygen/html/html/PTAStat_8cpp.html +1 -1
  42. package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +5 -5
  43. package/SVF-doxygen/html/html/PTAStat_8h.html +2 -2
  44. package/SVF-doxygen/html/html/PTAStat_8h_source.html +2 -2
  45. package/SVF-doxygen/html/html/PointerAnalysis_8cpp.html +1 -1
  46. package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +2 -2
  47. package/SVF-doxygen/html/html/SVFGStat_8cpp_source.html +1 -1
  48. package/SVF-doxygen/html/html/SVFGStat_8h.html +1 -1
  49. package/SVF-doxygen/html/html/SVFGStat_8h_source.html +1 -1
  50. package/SVF-doxygen/html/html/SVFUtil_8h.html +1 -1
  51. package/SVF-doxygen/html/html/SaberCondAllocator_8cpp_source.html +2 -1
  52. package/SVF-doxygen/html/html/TypeAnalysis_8cpp.html +1 -1
  53. package/SVF-doxygen/html/html/TypeAnalysis_8cpp_source.html +1 -1
  54. package/SVF-doxygen/html/html/Util_2BasicTypes_8h.html +1 -1
  55. package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +2 -2
  56. package/SVF-doxygen/html/html/WPAStat_8h.html +1 -1
  57. package/SVF-doxygen/html/html/WPAStat_8h_source.html +1 -1
  58. package/SVF-doxygen/html/html/cfl_8cpp.html +1 -1
  59. package/SVF-doxygen/html/html/cfl_8cpp_source.html +1 -1
  60. package/SVF-doxygen/html/html/classSVF_1_1AliasCFLGraphBuilder-members.html +12 -11
  61. package/SVF-doxygen/html/html/classSVF_1_1AliasCFLGraphBuilder.html +73 -4
  62. package/SVF-doxygen/html/html/classSVF_1_1Andersen.html +1 -1
  63. package/SVF-doxygen/html/html/classSVF_1_1AndersenSCD.html +1 -1
  64. package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +1 -1
  65. package/SVF-doxygen/html/html/classSVF_1_1AndersenStat.html +3 -3
  66. package/SVF-doxygen/html/html/classSVF_1_1AndersenWaveDiff.html +1 -1
  67. package/SVF-doxygen/html/html/classSVF_1_1BreakConstantGEPs.html +1 -1
  68. package/SVF-doxygen/html/html/classSVF_1_1CFLAlias.html +50 -49
  69. package/SVF-doxygen/html/html/classSVF_1_1CFLGraphBuilder.html +26 -26
  70. package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +10 -7
  71. package/SVF-doxygen/html/html/classSVF_1_1DDAStat.html +2 -2
  72. package/SVF-doxygen/html/html/classSVF_1_1ExtAPI.html +11 -11
  73. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +2 -2
  74. package/SVF-doxygen/html/html/classSVF_1_1GrammarBuilder.html +10 -10
  75. package/SVF-doxygen/html/html/classSVF_1_1LLVMLoopAnalysis.html +1 -1
  76. package/SVF-doxygen/html/html/classSVF_1_1LLVMModuleSet.html +2 -1
  77. package/SVF-doxygen/html/html/classSVF_1_1MTA.html +1 -1
  78. package/SVF-doxygen/html/html/classSVF_1_1MTAStat.html +4 -4
  79. package/SVF-doxygen/html/html/classSVF_1_1MemSSAStat.html +1 -1
  80. package/SVF-doxygen/html/html/classSVF_1_1MergeFunctionRets.html +3 -2
  81. package/SVF-doxygen/html/html/classSVF_1_1Options-members.html +8 -6
  82. package/SVF-doxygen/html/html/classSVF_1_1Options.html +54 -2
  83. package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +16 -16
  84. package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +1 -1
  85. package/SVF-doxygen/html/html/classSVF_1_1SVFGStat.html +2 -2
  86. package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +3 -3
  87. package/SVF-doxygen/html/html/classSVF_1_1SaberCheckerAPI.html +1 -1
  88. package/SVF-doxygen/html/html/classSVF_1_1ThreadAPI.html +1 -1
  89. package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis.html +1 -1
  90. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +2 -2
  91. package/SVF-doxygen/html/html/dir_95e22971b5dbae2382075a3453e365b4.html +2 -0
  92. package/SVF-doxygen/html/html/dir_eef3a4ca6ca2cab0eb5fbea30ec32c1a.html +0 -2
  93. package/SVF-doxygen/html/html/files.html +15 -15
  94. package/SVF-doxygen/html/html/functions_b.html +3 -0
  95. package/SVF-doxygen/html/html/functions_c.html +22 -20
  96. package/SVF-doxygen/html/html/functions_f.html +10 -12
  97. package/SVF-doxygen/html/html/functions_func_b.html +3 -0
  98. package/SVF-doxygen/html/html/functions_func_p.html +2 -2
  99. package/SVF-doxygen/html/html/functions_i.html +6 -6
  100. package/SVF-doxygen/html/html/functions_l.html +6 -6
  101. package/SVF-doxygen/html/html/functions_n.html +3 -0
  102. package/SVF-doxygen/html/html/functions_p.html +19 -18
  103. package/SVF-doxygen/html/html/functions_r.html +4 -2
  104. package/SVF-doxygen/html/html/functions_s.html +13 -11
  105. package/SVF-doxygen/html/html/functions_t.html +3 -3
  106. package/SVF-doxygen/html/html/functions_v.html +3 -3
  107. package/SVF-doxygen/html/html/functions_vars_n.html +3 -0
  108. package/SVF-doxygen/html/html/functions_vars_p.html +3 -0
  109. package/SVF-doxygen/html/html/globals.html +1 -0
  110. package/SVF-doxygen/html/html/globals_a.html +3 -1
  111. package/SVF-doxygen/html/html/globals_c.html +6 -5
  112. package/SVF-doxygen/html/html/globals_e.html +1 -0
  113. package/SVF-doxygen/html/html/globals_f.html +7 -5
  114. package/SVF-doxygen/html/html/globals_g.html +7 -3
  115. package/SVF-doxygen/html/html/globals_m.html +6 -3
  116. package/SVF-doxygen/html/html/globals_v.html +2 -1
  117. package/SVF-doxygen/html/html/globals_vars.html +22 -7
  118. package/SVF-doxygen/html/html/namespaceSVF.html +2 -2
  119. package/SVF-doxygen/html/html/namespaceSVF_1_1SVFUtil.html +1 -1
  120. package/SVF-doxygen/html/html/namespaceSVF_1_1cppUtil.html +4 -4
  121. package/SVF-doxygen/html/html/search/all_0.js +1 -1
  122. package/SVF-doxygen/html/html/search/all_1.js +2 -2
  123. package/SVF-doxygen/html/html/search/all_10.js +11 -9
  124. package/SVF-doxygen/html/html/search/all_11.js +2 -2
  125. package/SVF-doxygen/html/html/search/all_12.js +8 -8
  126. package/SVF-doxygen/html/html/search/all_13.js +6 -6
  127. package/SVF-doxygen/html/html/search/all_14.js +1 -1
  128. package/SVF-doxygen/html/html/search/all_15.js +2 -2
  129. package/SVF-doxygen/html/html/search/all_2.js +1 -0
  130. package/SVF-doxygen/html/html/search/all_3.js +4 -4
  131. package/SVF-doxygen/html/html/search/all_5.js +1 -1
  132. package/SVF-doxygen/html/html/search/all_6.js +6 -6
  133. package/SVF-doxygen/html/html/search/all_7.js +4 -4
  134. package/SVF-doxygen/html/html/search/all_9.js +2 -2
  135. package/SVF-doxygen/html/html/search/all_b.js +1 -1
  136. package/SVF-doxygen/html/html/search/all_c.js +5 -5
  137. package/SVF-doxygen/html/html/search/all_d.js +2 -2
  138. package/SVF-doxygen/html/html/search/all_e.js +5 -4
  139. package/SVF-doxygen/html/html/search/files_c.js +1 -0
  140. package/SVF-doxygen/html/html/search/functions_1.js +1 -0
  141. package/SVF-doxygen/html/html/search/functions_f.js +2 -2
  142. package/SVF-doxygen/html/html/search/variables_0.js +1 -1
  143. package/SVF-doxygen/html/html/search/variables_1.js +2 -2
  144. package/SVF-doxygen/html/html/search/variables_10.js +2 -1
  145. package/SVF-doxygen/html/html/search/variables_13.js +3 -3
  146. package/SVF-doxygen/html/html/search/variables_14.js +1 -1
  147. package/SVF-doxygen/html/html/search/variables_15.js +1 -1
  148. package/SVF-doxygen/html/html/search/variables_3.js +1 -1
  149. package/SVF-doxygen/html/html/search/variables_5.js +1 -1
  150. package/SVF-doxygen/html/html/search/variables_6.js +2 -2
  151. package/SVF-doxygen/html/html/search/variables_7.js +4 -4
  152. package/SVF-doxygen/html/html/search/variables_c.js +1 -1
  153. package/SVF-doxygen/html/html/search/variables_d.js +1 -1
  154. package/SVF-doxygen/html/html/search/variables_e.js +4 -3
  155. package/include/CFL/CFGNormalizer.h +3 -3
  156. package/include/CFL/CFLAlias.h +5 -1
  157. package/include/CFL/CFLGraphBuilder.h +11 -1
  158. package/include/CFL/PEGGrammar.txt +28 -0
  159. package/include/DDA/DDAStat.h +1 -1
  160. package/include/Graphs/ICFGStat.h +1 -1
  161. package/include/Graphs/SVFGStat.h +1 -1
  162. package/include/MTA/MTAStat.h +1 -1
  163. package/include/SVF-FE/LLVMUtil.h +2 -2
  164. package/include/Util/ExtAPI.h +2 -2
  165. package/include/Util/Options.h +3 -1
  166. package/include/{MemoryModel → Util}/PTAStat.h +0 -0
  167. package/include/WPA/Andersen.h +3 -3
  168. package/include/WPA/WPAStat.h +1 -1
  169. package/lib/CFL/CFLAlias.cpp +12 -7
  170. package/lib/CFL/CFLGraphBuilder.cpp +135 -0
  171. package/lib/CFL/GrammarBuilder.cpp +12 -8
  172. package/lib/MTA/LockAnalysis.cpp +1 -1
  173. package/lib/MTA/MHP.cpp +1 -1
  174. package/lib/MemoryModel/PointerAnalysis.cpp +1 -1
  175. package/lib/SVF-FE/CHGBuilder.cpp +1 -1
  176. package/lib/Util/NodeIDAllocator.cpp +1 -1
  177. package/lib/Util/Options.cpp +16 -4
  178. package/lib/Util/PTAStat.cpp +4 -3
  179. package/lib/WPA/TypeAnalysis.cpp +1 -1
  180. package/package.json +1 -1
@@ -5,7 +5,7 @@
5
5
 
6
6
  #include <sstream>
7
7
  #include "FastCluster/fastcluster.h"
8
- #include "MemoryModel/PTAStat.h"
8
+ #include "Util/PTAStat.h"
9
9
  #include "MemoryModel/PointerAnalysisImpl.h"
10
10
  #include "Util/NodeIDAllocator.h"
11
11
  #include "MSSA/MemSSA.h"
@@ -253,6 +253,8 @@ public:
253
253
  static const llvm::cl::opt<std::string> CFLGraph;
254
254
  static const llvm::cl::opt<bool> PrintCFL;
255
255
  static const llvm::cl::opt<bool> FlexSymMap;
256
+ static const llvm::cl::opt<bool> PEGTransfer;
257
+ static const llvm::cl::opt<bool> NullDummyNode;
256
258
 
257
259
  // Loop Analysis
258
260
  static const llvm::cl::opt<bool> LoopAnalysis;
File without changes
@@ -27,8 +27,8 @@
27
27
  * Author: Yulei Sui
28
28
  */
29
29
 
30
- #ifndef ANDERSENPASS_H_
31
- #define ANDERSENPASS_H_
30
+ #ifndef INCLUDE_WPA_ANDERSEN_H_
31
+ #define INCLUDE_WPA_ANDERSEN_H_
32
32
 
33
33
  #include "MemoryModel/PointerAnalysisImpl.h"
34
34
  #include "WPA/WPAStat.h"
@@ -433,4 +433,4 @@ public:
433
433
 
434
434
  } // End namespace SVF
435
435
 
436
- #endif /* ANDERSENPASS_H_ */
436
+ #endif /* INCLUDE_WPA_ANDERSEN_H_ */
@@ -31,7 +31,7 @@
31
31
  #ifndef FLOWSENSITIVESTAT_H_
32
32
  #define FLOWSENSITIVESTAT_H_
33
33
 
34
- #include "MemoryModel/PTAStat.h"
34
+ #include "Util/PTAStat.h"
35
35
  #include "WPA/FlowSensitive.h"
36
36
  #include "WPA/VersionedFlowSensitive.h"
37
37
 
@@ -206,7 +206,15 @@ void CFLAlias::analyze()
206
206
  PointerAnalysis::initialize();
207
207
  GrammarBase *grammarBase = grammarBuilder.build();
208
208
  ConstraintGraph *consCG = new ConstraintGraph(svfir);
209
- graph = cflGraphBuilder.buildBigraph(consCG, grammarBase->getStartKind(), grammarBase);
209
+ if (Options::PEGTransfer)
210
+ {
211
+ graph = cflGraphBuilder.buildBiPEGgraph(consCG, grammarBase->getStartKind(), grammarBase, svfir);
212
+ }
213
+ else
214
+ {
215
+ graph = cflGraphBuilder.buildBigraph(consCG, grammarBase->getStartKind(), grammarBase);
216
+ }
217
+
210
218
  cflChecker.check(grammarBase, &cflGraphBuilder, graph);
211
219
  grammar = normalizer.normalize(grammarBase);
212
220
  cflChecker.check(grammar, &cflGraphBuilder, graph);
@@ -228,12 +236,9 @@ void CFLAlias::analyze()
228
236
  solver->solve();
229
237
  if(Options::PrintCFL == true)
230
238
  {
231
- std::string svfirName = Options::CFLGraph.c_str();
232
- svfir->dump(svfirName.append("_IR"));
233
- std::string grammarName = Options::CFLGraph.c_str();
234
- grammar->dump(grammarName.append("_Grammar"));
235
- std::string CFLGraphFileName = Options::CFLGraph.c_str();
236
- graph->dump(CFLGraphFileName.append("_CFL"));
239
+ svfir->dump("IR");
240
+ grammar->dump("Grammar");
241
+ graph->dump("CFLGraph");
237
242
  }
238
243
  if (Options::CFLGraph.empty())
239
244
  {
@@ -222,4 +222,139 @@ CFLGraph* AliasCFLGraphBuilder::buildBigraph(ConstraintGraph *graph, Kind startK
222
222
  return cflGraph;
223
223
  }
224
224
 
225
+ CFLGraph* AliasCFLGraphBuilder::buildBiPEGgraph(ConstraintGraph *graph, Kind startKind, GrammarBase *grammar, SVFIR* pag)
226
+ {
227
+ CFLGraph *cflGraph = new CFLGraph(startKind);
228
+ externMap = true;
229
+ for(auto pairV : grammar->getTerminals())
230
+ {
231
+ if(label2KindMap.find(pairV.first) == label2KindMap.end())
232
+ {
233
+ label2KindMap.insert(pairV);
234
+ }
235
+ if(kind2LabelMap.find(pairV.second) == kind2LabelMap.end())
236
+ {
237
+ kind2LabelMap.insert(make_pair(pairV.second, pairV.first));
238
+ }
239
+ }
240
+ for(auto pairV : grammar->getNonterminals())
241
+ {
242
+ if(label2KindMap.find(pairV.first) == label2KindMap.end())
243
+ {
244
+ label2KindMap.insert(pairV);
245
+ }
246
+ if(kind2LabelMap.find(pairV.second) == kind2LabelMap.end())
247
+ {
248
+ kind2LabelMap.insert(make_pair(pairV.second, pairV.first));
249
+ }
250
+ }
251
+ for(auto it = graph->begin(); it!= graph->end(); it++)
252
+ {
253
+ CFLNode* node = new CFLNode((*it).first);
254
+ cflGraph->addCFLNode((*it).first, node);
255
+ }
256
+ for(auto it = graph->begin(); it!= graph->end(); it++)
257
+ {
258
+ ConstraintNode* node = (*it).second;
259
+ for(ConstraintEdge* edge : node->getOutEdges())
260
+ {
261
+ /// Process Store
262
+ if (edge->getEdgeKind() == ConstraintEdge::Store)
263
+ {
264
+ if (pag->isNullPtr(edge->getSrcID()) && (Options::NullDummyNode == false))
265
+ continue;
266
+ /// Check Dst of Store Dereference Node
267
+ ConstraintNode* Dst = edge->getDstNode();
268
+ ConstraintNode* DerefNode = nullptr;
269
+ CFLNode* CFLDerefNode = nullptr;
270
+ for (ConstraintEdge* DstInEdge : Dst->getInEdges())
271
+ {
272
+ if (DstInEdge->getEdgeKind() == ConstraintEdge::Addr)
273
+ {
274
+ DerefNode = DstInEdge->getSrcNode();
275
+ CFLDerefNode = cflGraph->getGNode(DstInEdge->getSrcID());
276
+ break;
277
+ }
278
+ }
279
+ if (DerefNode == nullptr)
280
+ {
281
+
282
+ NodeID refId = pag->addDummyValNode();
283
+ CFLDerefNode = new CFLNode(refId);
284
+ cflGraph->addCFLNode(refId, CFLDerefNode);
285
+ /// Add Addr Edge
286
+ cflGraph->addCFLEdge(CFLDerefNode, cflGraph->getGNode(edge->getDstID()), ConstraintEdge::Addr);
287
+ std::string key = kind2LabelMap[ConstraintEdge::Addr];
288
+ key.append("bar");
289
+ cflGraph->addCFLEdge(cflGraph->getGNode(edge->getDstID()), CFLDerefNode, label2KindMap[key]);
290
+ }
291
+ /// Add Copy Edge
292
+ cflGraph->addCFLEdge(cflGraph->getGNode(edge->getSrcID()), cflGraph->getGNode(CFLDerefNode->getId()), ConstraintEdge::Copy);
293
+ std::string key = kind2LabelMap[ConstraintEdge::Copy];
294
+ key.append("bar");
295
+ cflGraph->addCFLEdge(cflGraph->getGNode(CFLDerefNode->getId()), cflGraph->getGNode(edge->getSrcID()), label2KindMap[key]);
296
+ }
297
+ /// Process Load
298
+ else if ( edge->getEdgeKind() == ConstraintEdge::Load)
299
+ {
300
+ /// Check Src of Load Dereference Node
301
+ ConstraintNode* Src = edge->getSrcNode();
302
+ ConstraintNode* DerefNode = nullptr;
303
+ CFLNode* CFLDerefNode = nullptr;
304
+ for (ConstraintEdge* SrcInEdge : Src->getInEdges())
305
+ {
306
+ if (SrcInEdge->getEdgeKind() == ConstraintEdge::Addr)
307
+ {
308
+ DerefNode = SrcInEdge->getSrcNode();
309
+ CFLDerefNode = cflGraph->getGNode(SrcInEdge->getSrcID());
310
+ }
311
+ }
312
+ if (DerefNode == nullptr)
313
+ {
314
+ NodeID refId = pag->addDummyValNode();
315
+ CFLDerefNode = new CFLNode(refId);
316
+ cflGraph->addCFLNode(refId, CFLDerefNode);
317
+ /// Add Addr Edge
318
+ cflGraph->addCFLEdge(CFLDerefNode, cflGraph->getGNode(edge->getSrcID()), ConstraintEdge::Addr);
319
+ std::string key = kind2LabelMap[ConstraintEdge::Addr];
320
+ key.append("bar");
321
+ cflGraph->addCFLEdge(cflGraph->getGNode(edge->getSrcID()), CFLDerefNode, label2KindMap[key]);
322
+ }
323
+ /// Add Copy Edge
324
+ cflGraph->addCFLEdge(cflGraph->getGNode(CFLDerefNode->getId()), cflGraph->getGNode(edge->getDstID()), ConstraintEdge::Copy);
325
+ std::string key = kind2LabelMap[ConstraintEdge::Copy];
326
+ key.append("bar");
327
+ cflGraph->addCFLEdge(cflGraph->getGNode(edge->getDstID()), cflGraph->getGNode(CFLDerefNode->getId()), label2KindMap[key]);
328
+ }
329
+ else
330
+ {
331
+ CFLGrammar::Kind edgeLabel = edge->getEdgeKind();
332
+ // Need to get the offset from the Const Edge
333
+ // The offset present edge is only from Normal Gep CG at moment
334
+ if(NormalGepCGEdge::classof(edge))
335
+ {
336
+ NormalGepCGEdge *nGepEdge = SVFUtil::dyn_cast<NormalGepCGEdge>(edge);
337
+ CFLGrammar::Attribute attr = nGepEdge->getConstantFieldIdx();
338
+ addAttribute(edgeLabel, attr);
339
+ edgeLabel = CFLGrammar::getAttributedKind(attr, edgeLabel);
340
+ cflGraph->addCFLEdge(cflGraph->getGNode(edge->getSrcID()), cflGraph->getGNode(edge->getDstID()), edgeLabel);
341
+ std::string key = kind2LabelMap[edge->getEdgeKind()];
342
+ key.append("bar"); // for example Gep_i should be Gepbar_i, not Gep_ibar
343
+ cflGraph->addCFLEdge(cflGraph->getGNode(edge->getDstID()), cflGraph->getGNode(edge->getSrcID()), CFLGrammar::getAttributedKind(attr, label2KindMap[key]));
344
+ addAttribute(label2KindMap[key], attr);
345
+ }
346
+ else
347
+ {
348
+ cflGraph->addCFLEdge(cflGraph->getGNode(edge->getSrcID()), cflGraph->getGNode(edge->getDstID()), edgeLabel);
349
+ std::string key = kind2LabelMap[edge->getEdgeKind()];
350
+ key.append("bar");
351
+ cflGraph->addCFLEdge(cflGraph->getGNode(edge->getDstID()), cflGraph->getGNode(edge->getSrcID()), label2KindMap[key]);
352
+ }
353
+ }
354
+ }
355
+ }
356
+ return cflGraph;
357
+ }
358
+
359
+
225
360
  } // end of SVF namespace
@@ -42,6 +42,7 @@ const inline std::string GrammarBuilder::parseProductionsString() const
42
42
  std::string lineString;
43
43
  std::string lines = "";
44
44
  std::string startString;
45
+ std::string symbolString;
45
46
  const std::string WHITESPACE = " \n\r\t\f\v";
46
47
  int lineNum = 0;
47
48
  while (getline(textFile, lineString))
@@ -50,25 +51,28 @@ const inline std::string GrammarBuilder::parseProductionsString() const
50
51
  {
51
52
  startString = stripSpace(lineString);
52
53
  }
54
+ if(lineNum == 3)
55
+ {
56
+ symbolString = lineString.substr(lineString.find_first_not_of(WHITESPACE), lineString.find_last_not_of(WHITESPACE)+1);
57
+ }
53
58
 
54
59
  lines.append(lineString.substr(lineString.find_first_not_of(WHITESPACE), lineString.find_last_not_of(WHITESPACE)+1));
55
60
  lineNum++;
56
61
  }
57
62
 
58
- std::regex reg("Start:([\\s\\S]*)Terminal:([\\s\\S]*)Productions:([\\s\\S]*)");
63
+ std::regex reg("Start:([\\s\\S]*)Terminal:(.*)Productions:([\\s\\S]*)");
59
64
  std::smatch matches;
60
65
  if (std::regex_search(lines, matches, reg))
61
66
  {
62
67
  lines = matches.str(3);
63
68
  }
64
- std::string terminalString = matches.str(2);
65
- std::string symbolString;
66
- size_t pos;
67
- while ((pos = terminalString.find(" ")) != std::string::npos)
69
+ std::string sString;
70
+ size_t pos = 0;
71
+ while ((pos = symbolString.find(" ")) != std::string::npos)
68
72
  {
69
- symbolString = stripSpace(terminalString.substr(0, pos));
70
- terminalString.erase(0, pos + 1); //Capital is Nonterminal, Otherwise is terminal
71
- grammar->insertSymbol(symbolString);
73
+ sString = stripSpace(symbolString.substr(0, pos));
74
+ symbolString.erase(0, pos + 1); //Capital is Nonterminal, Otherwise is terminal
75
+ grammar->insertSymbol(sString);
72
76
  }
73
77
  grammar->insertSymbol(symbolString);
74
78
  grammar->setStartKind(grammar->insertSymbol(startString));
@@ -10,7 +10,7 @@
10
10
  #include "MTA/MTA.h"
11
11
  #include "MTA/MTAResultValidator.h"
12
12
  #include "Util/SVFUtil.h"
13
- #include "MemoryModel/PTAStat.h"
13
+ #include "Util/PTAStat.h"
14
14
  #include "MTA/LockResultValidator.h"
15
15
 
16
16
 
package/lib/MTA/MHP.cpp CHANGED
@@ -11,7 +11,7 @@
11
11
  #include "MTA/LockAnalysis.h"
12
12
  #include "MTA/MTAResultValidator.h"
13
13
  #include "Util/SVFUtil.h"
14
- #include "MemoryModel/PTAStat.h"
14
+ #include "Util/PTAStat.h"
15
15
  #include "SVF-FE/BasicTypes.h"
16
16
 
17
17
  using namespace SVF;
@@ -37,7 +37,7 @@
37
37
 
38
38
  #include "MemoryModel/PointerAnalysisImpl.h"
39
39
  #include "MemoryModel/PAGBuilderFromFile.h"
40
- #include "MemoryModel/PTAStat.h"
40
+ #include "Util/PTAStat.h"
41
41
  #include "Graphs/ThreadCallGraph.h"
42
42
  #include "Graphs/ICFG.h"
43
43
 
@@ -43,7 +43,7 @@
43
43
  #include "Util/SVFUtil.h"
44
44
  #include "SVF-FE/LLVMUtil.h"
45
45
  #include "Util/SVFModule.h"
46
- #include "MemoryModel/PTAStat.h"
46
+ #include "Util/PTAStat.h"
47
47
 
48
48
  using namespace SVF;
49
49
  using namespace SVFUtil;
@@ -6,7 +6,7 @@
6
6
 
7
7
  #include "FastCluster/fastcluster.h"
8
8
  #include "MemoryModel/PointerAnalysisImpl.h"
9
- #include "MemoryModel/PTAStat.h"
9
+ #include "Util/PTAStat.h"
10
10
  #include "Util/NodeIDAllocator.h"
11
11
  #include "Util/BasicTypes.h"
12
12
  #include "Util/SVFBasicTypes.h"
@@ -790,25 +790,37 @@ const llvm::cl::opt<std::string> Options::GrammarFilename(
790
790
  const llvm::cl::opt<std::string> Options::CFLGraph(
791
791
  "cflgraph",
792
792
  llvm::cl::init(""),
793
- llvm::cl::desc("<dot file as the CFLGraph input>")
793
+ llvm::cl::desc("<Dot file as the CFLGraph input>")
794
794
  );
795
795
 
796
796
  const llvm::cl::opt<bool> Options::PrintCFL(
797
797
  "print-cfl",
798
798
  llvm::cl::init(false),
799
- llvm::cl::desc("print ir, grammar and cflgraph for debug.")
799
+ llvm::cl::desc("Print ir, grammar and cflgraph for debug.")
800
800
  );
801
801
 
802
802
  const llvm::cl::opt<bool> Options::FlexSymMap(
803
803
  "flex-symmap",
804
804
  llvm::cl::init(false),
805
- llvm::cl::desc("extend exist sym map while read graph from dot if sym not in map.")
805
+ llvm::cl::desc("Extend exist sym map while read graph from dot if sym not in map.")
806
+ );
807
+
808
+ const llvm::cl::opt<bool> Options::PEGTransfer(
809
+ "peg-transfer",
810
+ llvm::cl::init(false),
811
+ llvm::cl::desc("When explicit to true, cfl graph builder will transfer PAG load and store edges to copy and addr.")
812
+ );
813
+
814
+ const llvm::cl::opt<bool> Options::NullDummyNode(
815
+ "null-dummy",
816
+ llvm::cl::init(true),
817
+ llvm::cl::desc("When explicit to false, ir graph builder will skip null poiner assignment instead of generate new DummyValVarNode.")
806
818
  );
807
819
 
808
820
  const llvm::cl::opt<bool> Options::LoopAnalysis(
809
821
  "loop-analysis",
810
822
  llvm::cl::init(true),
811
- llvm::cl::desc("analyze every func and get loop info and loop bounds.")
823
+ llvm::cl::desc("Analyze every func and get loop info and loop bounds.")
812
824
  );
813
825
 
814
826
  const llvm::cl::opt<unsigned> Options::LoopBound(
@@ -29,20 +29,20 @@
29
29
 
30
30
  #include <iomanip>
31
31
  #include "Graphs/PTACallGraph.h"
32
- #include "MemoryModel/PTAStat.h"
32
+ #include "Util/PTAStat.h"
33
33
  #include "MemoryModel/PointerAnalysisImpl.h"
34
34
  #include "MemoryModel/SVFIR.h"
35
35
  #include "Util/Options.h"
36
36
 
37
37
  using namespace SVF;
38
38
 
39
- const char* PTAStat:: TotalAnalysisTime = "TotalTime"; ///< SVFIR value nodes
39
+ const char* PTAStat:: TotalAnalysisTime = "TotalTime"; ///< SVFIR value nodes ??
40
40
  const char* PTAStat:: SCCDetectionTime = "SCCDetectTime"; ///< Total SCC detection time
41
41
  const char* PTAStat:: SCCMergeTime = "SCCMergeTime"; ///< Total SCC merge time
42
42
 
43
43
  const char* PTAStat:: ProcessLoadStoreTime = "LoadStoreTime"; ///< process load and store time
44
44
  const char* PTAStat:: ProcessCopyGepTime = "CopyGepTime"; ///< process copy and gep time
45
- const char* PTAStat:: UpdateCallGraphTime = "UpdateCGTime"; ///< process copy and gep time
45
+ const char* PTAStat:: UpdateCallGraphTime = "UpdateCGTime"; ///< process copy and gep time ??
46
46
 
47
47
  const char* PTAStat:: TotalNumOfPointers = "TotalPointers"; ///< SVFIR value nodes
48
48
  const char* PTAStat:: TotalNumOfObjects = "TotalObjects"; ///< Total SVFIR object node
@@ -113,6 +113,7 @@ PTAStat::PTAStat(PointerAnalysis* p) : startTime(0), endTime(0), pta(p)
113
113
 
114
114
  double PTAStat::getClk(bool mark)
115
115
  {
116
+ std::cout << Options::MarkedClocksOnly;
116
117
  if (Options::MarkedClocksOnly && !mark) return 0.0;
117
118
 
118
119
  if (Options::ClockType == ClockType::Wall)
@@ -32,7 +32,7 @@
32
32
  #include "SVF-FE/ICFGBuilder.h"
33
33
  #include "Graphs/CHG.h"
34
34
  #include "WPA/TypeAnalysis.h"
35
- #include "MemoryModel/PTAStat.h"
35
+ #include "Util/PTAStat.h"
36
36
  #include "Graphs/ICFGStat.h"
37
37
  #include "Graphs/VFG.h"
38
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.539",
3
+ "version": "1.0.540",
4
4
  "description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
5
5
  "main": "index.js",
6
6
  "scripts": {