svf-tools 1.0.1092 → 1.0.1094

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.1092",
3
+ "version": "1.0.1094",
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": {
@@ -192,20 +192,21 @@ public:
192
192
  }
193
193
 
194
194
  // Given an VFG node, return true if it has a left hand side top level pointer (PAGnode)
195
- inline bool hasLHSTopLevPtr(const VFGNode* node) const {
195
+ inline bool hasLHSTopLevPtr(const VFGNode* node) const
196
+ {
196
197
  return node && SVFUtil::isa<AddrVFGNode,
197
- CopyVFGNode,
198
- GepVFGNode,
199
- LoadVFGNode,
200
- PHIVFGNode,
201
- CmpVFGNode,
202
- BinaryOPVFGNode,
203
- UnaryOPVFGNode,
204
- ActualParmVFGNode,
205
- FormalParmVFGNode,
206
- ActualRetVFGNode,
207
- FormalRetVFGNode,
208
- NullPtrVFGNode>(node);
198
+ CopyVFGNode,
199
+ GepVFGNode,
200
+ LoadVFGNode,
201
+ PHIVFGNode,
202
+ CmpVFGNode,
203
+ BinaryOPVFGNode,
204
+ UnaryOPVFGNode,
205
+ ActualParmVFGNode,
206
+ FormalParmVFGNode,
207
+ ActualRetVFGNode,
208
+ FormalRetVFGNode,
209
+ NullPtrVFGNode>(node);
209
210
  }
210
211
 
211
212
  // Given an VFG node, return its left hand side top level pointer (PAGnode)
@@ -4,14 +4,10 @@
4
4
  #define OPTIONS_H_
5
5
 
6
6
  #include <sstream>
7
- #include "FastCluster/fastcluster.h"
8
7
  #include "Util/CommandLine.h"
9
8
  #include "Util/PTAStat.h"
10
9
  #include "MemoryModel/PointerAnalysisImpl.h"
11
10
  #include "Util/NodeIDAllocator.h"
12
- #include "MSSA/MemSSA.h"
13
- #include "WPA/WPAPass.h"
14
- #include "AE/Svfexe/AbstractInterpretation.h"
15
11
 
16
12
  namespace SVF
17
13
  {
@@ -54,7 +50,7 @@ public:
54
50
  /// TODO: we can separate it into two options, and make Clusterer::cluster take in a method
55
51
  /// argument rather than plugging Options::ClusterMethod *inside* Clusterer::cluster
56
52
  /// directly, but it seems we will always want single anyway, and this is for testing.
57
- static const OptionMap<enum hclust_fast_methods> ClusterMethod;
53
+ static const OptionMap<u32_t> ClusterMethod;
58
54
 
59
55
  /// Cluster partitions separately.
60
56
  static const Option<bool> RegionedClustering;
@@ -143,7 +139,7 @@ public:
143
139
  static const Option<bool> DumpMSSA;
144
140
  static const Option<std::string> MSSAFun;
145
141
  // static const llvm::cl::opt<string> MSSAFun;
146
- static const OptionMap<MemSSA::MemPartition> MemPar;
142
+ static const OptionMap<u32_t> MemPar;
147
143
 
148
144
  // SVFG builder (SVFGBuilder.cpp)
149
145
  static const Option<bool> SVFGWithIndirectCall;
@@ -223,7 +219,7 @@ public:
223
219
  static const Option<bool> SABERFULLSVFG;
224
220
  static const Option<bool> PrintAliases;
225
221
  static OptionMultiple<PointerAnalysis::PTATY> PASelected;
226
- static OptionMultiple<WPAPass::AliasCheckRule> AliasRule;
222
+ static OptionMultiple<u32_t> AliasRule;
227
223
 
228
224
  // DOTGraphTraits
229
225
  static const Option<bool> ShowHiddenNode;
@@ -246,7 +242,7 @@ public:
246
242
  // Abstract Execution
247
243
  static const Option<u32_t> WidenDelay;
248
244
  /// recursion handling mode, Default: TOP
249
- static const OptionMap<AbstractInterpretation::HandleRecur> HandleRecur;
245
+ static const OptionMap<u32_t> HandleRecur;
250
246
  /// the max time consumptions (seconds). Default: 4 hours 14400s
251
247
  static const Option<u32_t> Timeout;
252
248
  /// bug info output file, Default: output.db
@@ -65,7 +65,8 @@ void SVFGOPT::buildSVFG()
65
65
  }
66
66
 
67
67
  /// Separate function to optimise the SVFG to avoid duplicate code
68
- void SVFGOPT::optimiseSVFG() {
68
+ void SVFGOPT::optimiseSVFG()
69
+ {
69
70
  if(Options::DumpVFG())
70
71
  dump("SVFG_before_opt");
71
72
 
@@ -40,13 +40,13 @@ using namespace SVFUtil;
40
40
  SVFG* SVFGBuilder::buildPTROnlySVFG(BVDataPTAImpl* pta)
41
41
  {
42
42
  return this->SVFGWithPostOpts ? build(pta, VFG::PTRONLYSVFG_OPT)
43
- : build(pta, VFG::PTRONLYSVFG);
43
+ : build(pta, VFG::PTRONLYSVFG);
44
44
  }
45
45
 
46
46
  SVFG* SVFGBuilder::buildFullSVFG(BVDataPTAImpl* pta)
47
47
  {
48
48
  return this->SVFGWithPostOpts ? build(pta, VFG::FULLSVFG_OPT)
49
- : build(pta, VFG::FULLSVFG);
49
+ : build(pta, VFG::FULLSVFG);
50
50
  }
51
51
 
52
52
  /*!
@@ -62,7 +62,7 @@ SVFG* SVFGBuilder::build(BVDataPTAImpl* pta, VFG::VFGK kind)
62
62
  {
63
63
 
64
64
  auto mssa = buildMSSA(
65
- pta, (VFG::PTRONLYSVFG == kind || VFG::PTRONLYSVFG_OPT == kind));
65
+ pta, (VFG::PTRONLYSVFG == kind || VFG::PTRONLYSVFG_OPT == kind));
66
66
 
67
67
  DBOUT(DGENERAL, outs() << pasMsg("Build Sparse Value-Flow Graph \n"));
68
68
  if (kind == VFG::FULLSVFG_OPT || kind == VFG::PTRONLYSVFG_OPT)
@@ -93,7 +93,7 @@ void SVFGBuilder::releaseMemory()
93
93
  }
94
94
 
95
95
  std::unique_ptr<MemSSA> SVFGBuilder::buildMSSA(BVDataPTAImpl* pta,
96
- bool ptrOnlyMSSA)
96
+ bool ptrOnlyMSSA)
97
97
  {
98
98
 
99
99
  DBOUT(DGENERAL, outs() << pasMsg("Build Memory SSA \n"));
@@ -306,7 +306,7 @@ std::vector<NodeID> NodeIDAllocator::Clusterer::cluster(BVDataPTAImpl *pta, cons
306
306
  overallStats[NumRegions] = std::to_string(numRegions);
307
307
 
308
308
  std::vector<hclust_fast_methods> methods;
309
- if (Options::ClusterMethod() == HCLUST_METHOD_SVF_BEST)
309
+ if ((enum hclust_fast_methods)Options::ClusterMethod() == HCLUST_METHOD_SVF_BEST)
310
310
  {
311
311
  methods.push_back(HCLUST_METHOD_SINGLE);
312
312
  methods.push_back(HCLUST_METHOD_COMPLETE);
@@ -314,7 +314,7 @@ std::vector<NodeID> NodeIDAllocator::Clusterer::cluster(BVDataPTAImpl *pta, cons
314
314
  }
315
315
  else
316
316
  {
317
- methods.push_back(Options::ClusterMethod());
317
+ methods.push_back((enum hclust_fast_methods)Options::ClusterMethod());
318
318
  }
319
319
 
320
320
  for (const hclust_fast_methods method : methods)
@@ -655,7 +655,7 @@ std::pair<hclust_fast_methods, std::vector<NodeID>> NodeIDAllocator::Clusterer::
655
655
  std::pair<hclust_fast_methods, std::vector<NodeID>> bestMapping = candidates[0];
656
656
  // Number of bits required for the best candidate.
657
657
  size_t bestWords = std::numeric_limits<size_t>::max();
658
- if (evalSubtitle != "" || Options::ClusterMethod() == HCLUST_METHOD_SVF_BEST)
658
+ if (evalSubtitle != "" || (enum hclust_fast_methods)Options::ClusterMethod() == HCLUST_METHOD_SVF_BEST)
659
659
  {
660
660
  for (const std::pair<hclust_fast_methods, std::vector<NodeID>> &candidate : candidates)
661
661
  {
@@ -2,7 +2,11 @@
2
2
 
3
3
  #include "Util/Options.h"
4
4
  #include "Util/CommandLine.h"
5
+ #include "FastCluster/fastcluster.h"
5
6
  #include "Util/ExtAPI.h"
7
+ #include "MSSA/MemSSA.h"
8
+ #include "WPA/WPAPass.h"
9
+ #include "AE/Svfexe/AbstractInterpretation.h"
6
10
 
7
11
  namespace SVF
8
12
  {
@@ -356,7 +360,7 @@ const OptionMap<PointsTo::Type> Options::PtType(
356
360
  }
357
361
  );
358
362
 
359
- const OptionMap<enum hclust_fast_methods> Options::ClusterMethod(
363
+ const OptionMap<u32_t> Options::ClusterMethod(
360
364
  "cluster-method",
361
365
  "hierarchical clustering method for objects",
362
366
  HCLUST_METHOD_SVF_BEST,
@@ -408,7 +412,7 @@ const Option<std::string> Options::MSSAFun(
408
412
  ""
409
413
  );
410
414
 
411
- const OptionMap<MemSSA::MemPartition> Options::MemPar(
415
+ const OptionMap<u32_t> Options::MemPar(
412
416
  "mem-par",
413
417
  "Memory region partition strategies (e.g., for SVFG construction)",
414
418
  MemSSA::MemPartition::IntraDisjoint,
@@ -697,7 +701,7 @@ OptionMultiple<PointerAnalysis::PTATY> Options::PASelected(
697
701
  );
698
702
 
699
703
 
700
- OptionMultiple<WPAPass::AliasCheckRule> Options::AliasRule(
704
+ OptionMultiple<u32_t> Options::AliasRule(
701
705
  "Select alias check rule",
702
706
  {
703
707
  {WPAPass::Conservative, "conservative", "return MayAlias if any pta says alias"},
@@ -779,7 +783,7 @@ const Option<u32_t> Options::LoopBound(
779
783
 
780
784
  const Option<u32_t> Options::WidenDelay(
781
785
  "widen-delay", "Loop Widen Delay", 3);
782
- const OptionMap<AbstractInterpretation::HandleRecur> Options::HandleRecur(
786
+ const OptionMap<u32_t> Options::HandleRecur(
783
787
  "handle-recur",
784
788
  "Recursion handling mode in abstract execution (Default -widen-narrow)",
785
789
  AbstractInterpretation::HandleRecur::WIDEN_NARROW,