svf-tools 1.0.1288 → 1.0.1290

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 (38) hide show
  1. package/package.json +1 -1
  2. package/svf/include/CFL/CFLAlias.h +1 -1
  3. package/svf/include/CFL/CFLBase.h +3 -1
  4. package/svf/include/CFL/CFLVF.h +1 -1
  5. package/svf/include/DDA/FlowDDA.h +1 -1
  6. package/svf/include/Graphs/GraphWriter.h +1 -0
  7. package/svf/include/Graphs/SCC.h +1 -0
  8. package/svf/include/MTA/MTA.h +1 -0
  9. package/svf/include/MTA/TCT.h +1 -0
  10. package/svf/include/MemoryModel/PTATY.h +55 -0
  11. package/svf/include/MemoryModel/PointerAnalysis.h +2 -40
  12. package/svf/include/MemoryModel/PointerAnalysisImpl.h +8 -14
  13. package/svf/include/Util/Options.h +9 -6
  14. package/svf/include/Util/SVFStat.h +3 -1
  15. package/svf/include/WPA/Andersen.h +16 -15
  16. package/svf/include/WPA/AndersenPWC.h +3 -2
  17. package/svf/include/WPA/FlowSensitive.h +2 -2
  18. package/svf/include/WPA/VersionedFlowSensitive.h +3 -2
  19. package/svf/lib/AE/Core/AbstractState.cpp +2 -1
  20. package/svf/lib/DDA/ContextDDA.cpp +1 -1
  21. package/svf/lib/DDA/DDAPass.cpp +4 -5
  22. package/svf/lib/Graphs/CallGraph.cpp +2 -0
  23. package/svf/lib/Graphs/SVFG.cpp +3 -2
  24. package/svf/lib/Graphs/VFG.cpp +5 -4
  25. package/svf/lib/MSSA/MemRegion.cpp +1 -0
  26. package/svf/lib/MSSA/MemSSA.cpp +2 -1
  27. package/svf/lib/MemoryModel/AccessPath.cpp +3 -1
  28. package/svf/lib/MemoryModel/PointerAnalysis.cpp +2 -1
  29. package/svf/lib/MemoryModel/PointerAnalysisImpl.cpp +14 -13
  30. package/svf/lib/SVFIR/SVFIR.cpp +1 -0
  31. package/svf/lib/SVFIR/SVFVariables.cpp +1 -0
  32. package/svf/lib/Util/Options.cpp +27 -20
  33. package/svf/lib/Util/PTAStat.cpp +5 -4
  34. package/svf/lib/Util/SVFStat.cpp +3 -0
  35. package/svf/lib/Util/SVFUtil.cpp +5 -1
  36. package/svf/lib/WPA/VersionedFlowSensitive.cpp +1 -0
  37. package/svf/lib/WPA/WPAPass.cpp +14 -13
  38. package/svf-llvm/include/SVF-LLVM/LLVMModule.h +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.1288",
3
+ "version": "1.0.1290",
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": {
@@ -44,7 +44,7 @@ class CFLAlias : public CFLBase
44
44
  public:
45
45
  typedef OrderedMap<const CallICFGNode*, NodeID> CallSite2DummyValPN;
46
46
 
47
- CFLAlias(SVFIR* ir) : CFLBase(ir, PointerAnalysis::CFLFICI_WPA)
47
+ CFLAlias(SVFIR* ir) : CFLBase(ir, PTATY::CFLFICI_WPA)
48
48
  {
49
49
  }
50
50
 
@@ -36,8 +36,10 @@
36
36
  #include "CFL/CFLGraphBuilder.h"
37
37
  #include "CFL/CFLGramGraphChecker.h"
38
38
  #include "MemoryModel/PointerAnalysis.h"
39
+ #include "MemoryModel/PointerAnalysisImpl.h"
39
40
  #include "Graphs/ConsG.h"
40
41
  #include "Util/Options.h"
42
+ #include "Util/PTAStat.h"
41
43
  #include "SVFIR/SVFType.h"
42
44
 
43
45
  namespace SVF
@@ -50,7 +52,7 @@ class CFLBase : public BVDataPTAImpl
50
52
  {
51
53
 
52
54
  public:
53
- CFLBase(SVFIR* ir, PointerAnalysis::PTATY pty) : BVDataPTAImpl(ir, pty), svfir(ir), graph(nullptr), grammar(nullptr), solver(nullptr)
55
+ CFLBase(SVFIR* ir, PTATY pty) : BVDataPTAImpl(ir, pty), svfir(ir), graph(nullptr), grammar(nullptr), solver(nullptr)
54
56
  {
55
57
  }
56
58
 
@@ -42,7 +42,7 @@ class CFLVF : public CFLBase
42
42
  {
43
43
 
44
44
  public:
45
- CFLVF(SVFIR* ir) : CFLBase(ir, PointerAnalysis::CFLFSCS_WPA)
45
+ CFLVF(SVFIR* ir) : CFLBase(ir, PTATY::CFLFSCS_WPA)
46
46
  {
47
47
  }
48
48
 
@@ -58,7 +58,7 @@ public:
58
58
  typedef BVDataPTAImpl::CallEdgeMap CallEdgeMap;
59
59
  typedef BVDataPTAImpl::FunctionSet FunctionSet;
60
60
  /// Constructor
61
- FlowDDA(SVFIR* _pag, DDAClient* client): BVDataPTAImpl(_pag, PointerAnalysis::FlowS_DDA),
61
+ FlowDDA(SVFIR* _pag, DDAClient* client): BVDataPTAImpl(_pag, PTATY::FlowS_DDA),
62
62
  DDAVFSolver<NodeID,PointsTo,LocDPItem>(),
63
63
  _client(client)
64
64
  {
@@ -24,6 +24,7 @@
24
24
 
25
25
  #include "Graphs/GraphTraits.h"
26
26
  #include "Graphs/DOTGraphTraits.h"
27
+ #include "Util/Options.h"
27
28
  #include <algorithm>
28
29
  #include <cstddef>
29
30
  #include <iterator>
@@ -41,6 +41,7 @@
41
41
  #define SCC_H_
42
42
 
43
43
  #include "SVFIR/SVFValue.h" // for NodeBS
44
+ #include "Util/WorkList.h" // for NodeBS
44
45
  #include <limits.h>
45
46
  #include <stack>
46
47
  #include <map>
@@ -36,6 +36,7 @@
36
36
 
37
37
  #include <set>
38
38
  #include <vector>
39
+ #include "SVFIR/SVFIR.h"
39
40
  #include "SVFIR/SVFValue.h"
40
41
 
41
42
  namespace SVF
@@ -30,6 +30,7 @@
30
30
  #ifndef TCTNodeDetector_H_
31
31
  #define TCTNodeDetector_H_
32
32
 
33
+ #include "MemoryModel/PointerAnalysis.h"
33
34
  #include "Graphs/SCC.h"
34
35
  #include "Graphs/ThreadCallGraph.h"
35
36
  #include "Util/CxtStmt.h"
@@ -0,0 +1,55 @@
1
+ #ifndef PTATY_H
2
+ #define PTATY_H
3
+
4
+ namespace SVF
5
+ {
6
+
7
+ /// Pointer analysis type list
8
+ enum PTATY
9
+ {
10
+ // Whole program analysis
11
+ Andersen_BASE, ///< Base Andersen PTA
12
+ Andersen_WPA, ///< Andersen PTA
13
+ AndersenSCD_WPA, ///< Selective cycle detection andersen-style WPA
14
+ AndersenSFR_WPA, ///< Stride-based field representation
15
+ AndersenWaveDiff_WPA, ///< Diff wave propagation andersen-style WPA
16
+ Steensgaard_WPA, ///< Steensgaard PTA
17
+ CSCallString_WPA, ///< Call string based context sensitive WPA
18
+ CSSummary_WPA, ///< Summary based context sensitive WPA
19
+ FSDATAFLOW_WPA, ///< Traditional Dataflow-based flow sensitive WPA
20
+ FSSPARSE_WPA, ///< Sparse flow sensitive WPA
21
+ VFS_WPA, ///< Versioned sparse flow-sensitive WPA
22
+ FSCS_WPA, ///< Flow-, context- sensitive WPA
23
+ CFLFICI_WPA, ///< Flow-, context-, insensitive CFL-reachability-based analysis
24
+ CFLFSCI_WPA, ///< Flow-insensitive, context-sensitive CFL-reachability-based analysis
25
+ CFLFSCS_WPA, ///< Flow-, context-, CFL-reachability-based analysis
26
+ TypeCPP_WPA, ///< Type-based analysis for C++
27
+
28
+ // Demand driven analysis
29
+ FieldS_DDA, ///< Field sensitive DDA
30
+ FlowS_DDA, ///< Flow sensitive DDA
31
+ PathS_DDA, ///< Guarded value-flow DDA
32
+ Cxt_DDA, ///< context sensitive DDA
33
+
34
+
35
+ Default_PTA ///< default pta without any analysis
36
+ };
37
+
38
+ /// Implementation type: BVDataPTAImpl or CondPTAImpl.
39
+ enum PTAImplTy
40
+ {
41
+ BaseImpl, ///< Represents PointerAnalaysis.
42
+ BVDataImpl, ///< Represents BVDataPTAImpl.
43
+ CondImpl, ///< Represents CondPTAImpl.
44
+ };
45
+
46
+ /// How the PTData used is implemented.
47
+ enum PTBackingType
48
+ {
49
+ Mutable,
50
+ Persistent,
51
+ };
52
+
53
+ } // namespace SVF
54
+
55
+ #endif // PTATY_H
@@ -41,6 +41,7 @@
41
41
  #include "MemoryModel/MutablePointsToDS.h"
42
42
  #include "MemoryModel/PersistentPointsToDS.h"
43
43
  #include "MemoryModel/PointsTo.h"
44
+ #include "MemoryModel/PTATY.h"
44
45
  #include "SVFIR/SVFIR.h"
45
46
 
46
47
  namespace SVF
@@ -57,45 +58,6 @@ class PointerAnalysis
57
58
  {
58
59
 
59
60
  public:
60
- /// Pointer analysis type list
61
- enum PTATY
62
- {
63
- // Whole program analysis
64
- Andersen_BASE, ///< Base Andersen PTA
65
- Andersen_WPA, ///< Andersen PTA
66
- AndersenSCD_WPA, ///< Selective cycle detection andersen-style WPA
67
- AndersenSFR_WPA, ///< Stride-based field representation
68
- AndersenWaveDiff_WPA, ///< Diff wave propagation andersen-style WPA
69
- Steensgaard_WPA, ///< Steensgaard PTA
70
- CSCallString_WPA, ///< Call string based context sensitive WPA
71
- CSSummary_WPA, ///< Summary based context sensitive WPA
72
- FSDATAFLOW_WPA, ///< Traditional Dataflow-based flow sensitive WPA
73
- FSSPARSE_WPA, ///< Sparse flow sensitive WPA
74
- VFS_WPA, ///< Versioned sparse flow-sensitive WPA
75
- FSCS_WPA, ///< Flow-, context- sensitive WPA
76
- CFLFICI_WPA, ///< Flow-, context-, insensitive CFL-reachability-based analysis
77
- CFLFSCI_WPA, ///< Flow-insensitive, context-sensitive CFL-reachability-based analysis
78
- CFLFSCS_WPA, ///< Flow-, context-, CFL-reachability-based analysis
79
- TypeCPP_WPA, ///< Type-based analysis for C++
80
-
81
- // Demand driven analysis
82
- FieldS_DDA, ///< Field sensitive DDA
83
- FlowS_DDA, ///< Flow sensitive DDA
84
- PathS_DDA, ///< Guarded value-flow DDA
85
- Cxt_DDA, ///< context sensitive DDA
86
-
87
-
88
- Default_PTA ///< default pta without any analysis
89
- };
90
-
91
- /// Implementation type: BVDataPTAImpl or CondPTAImpl.
92
- enum PTAImplTy
93
- {
94
- BaseImpl, ///< Represents PointerAnalaysis.
95
- BVDataImpl, ///< Represents BVDataPTAImpl.
96
- CondImpl, ///< Represents CondPTAImpl.
97
- };
98
-
99
61
  /// Indirect call edges type, map a callsite to a set of callees
100
62
  //@{
101
63
  typedef Set<const CallICFGNode*> CallSiteSet;
@@ -176,7 +138,7 @@ public:
176
138
  }
177
139
 
178
140
  /// Constructor
179
- PointerAnalysis(SVFIR* pag, PTATY ty = Default_PTA, bool alias_check = true);
141
+ PointerAnalysis(SVFIR* pag, PTATY ty = PTATY::Default_PTA, bool alias_check = true);
180
142
 
181
143
  /// Type of pointer analysis
182
144
  inline PTATY getAnalysisTy() const
@@ -31,6 +31,7 @@
31
31
  #define INCLUDE_MEMORYMODEL_POINTERANALYSISIMPL_H_
32
32
 
33
33
  #include <Graphs/ConsG.h>
34
+ #include "MemoryModel/PTATY.h"
34
35
  #include "MemoryModel/PointerAnalysis.h"
35
36
 
36
37
  namespace SVF
@@ -60,15 +61,8 @@ public:
60
61
  typedef PersistentIncDFPTData<NodeID, NodeSet, NodeID, PointsTo> PersIncDFPTDataTy;
61
62
  typedef PersistentVersionedPTData<NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set<VersionedVar>> PersVersionedPTDataTy;
62
63
 
63
- /// How the PTData used is implemented.
64
- enum PTBackingType
65
- {
66
- Mutable,
67
- Persistent,
68
- };
69
-
70
64
  /// Constructor
71
- BVDataPTAImpl(SVFIR* pag, PointerAnalysis::PTATY type, bool alias_check = true);
65
+ BVDataPTAImpl(SVFIR* pag, PTATY type, bool alias_check = true);
72
66
 
73
67
  /// Destructor
74
68
  ~BVDataPTAImpl() override = default;
@@ -80,7 +74,7 @@ public:
80
74
 
81
75
  static inline bool classof(const PointerAnalysis *pta)
82
76
  {
83
- return pta->getImplTy() == BVDataImpl;
77
+ return pta->getImplTy() == PTAImplTy::BVDataImpl;
84
78
  }
85
79
 
86
80
  /// Get points-to and reverse points-to
@@ -257,14 +251,14 @@ public:
257
251
  typedef Map<NodeID,CPtSet> PtrToCPtsMap; /// map a pointer to its conditional points-to set
258
252
 
259
253
  /// Constructor
260
- CondPTAImpl(SVFIR* pag, PointerAnalysis::PTATY type) : PointerAnalysis(pag, type), normalized(false)
254
+ CondPTAImpl(SVFIR* pag, PTATY type) : PointerAnalysis(pag, type), normalized(false)
261
255
  {
262
- if (type == PathS_DDA || type == Cxt_DDA)
256
+ if (type == PTATY::PathS_DDA || type == PTATY::Cxt_DDA)
263
257
  ptD = new MutPTDataTy();
264
258
  else
265
259
  assert(false && "no points-to data available");
266
260
 
267
- ptaImplTy = CondImpl;
261
+ ptaImplTy = PTAImplTy::CondImpl;
268
262
  }
269
263
 
270
264
  /// Destructor
@@ -275,7 +269,7 @@ public:
275
269
 
276
270
  static inline bool classof(const PointerAnalysis *pta)
277
271
  {
278
- return pta->getImplTy() == CondImpl;
272
+ return pta->getImplTy() == PTAImplTy::CondImpl;
279
273
  }
280
274
 
281
275
  /// Release memory
@@ -527,7 +521,7 @@ public:
527
521
  expandFIObjs(pts2,cpts2);
528
522
  if (containBlackHoleNode(cpts1) || containBlackHoleNode(cpts2))
529
523
  return AliasResult::MayAlias;
530
- else if(this->getAnalysisTy()==PathS_DDA && contains(cpts1,cpts2) && contains(cpts2,cpts1))
524
+ else if(this->getAnalysisTy() == PTATY::PathS_DDA && contains(cpts1,cpts2) && contains(cpts2,cpts1))
531
525
  {
532
526
  return AliasResult::MustAlias;
533
527
  }
@@ -5,8 +5,8 @@
5
5
 
6
6
  #include <sstream>
7
7
  #include "Util/CommandLine.h"
8
- #include "Util/PTAStat.h"
9
- #include "MemoryModel/PointerAnalysisImpl.h"
8
+ #include "Util/SVFStat.h"
9
+ #include "MemoryModel/PTATY.h"
10
10
  #include "Util/NodeIDAllocator.h"
11
11
 
12
12
  namespace SVF
@@ -18,7 +18,7 @@ class Options
18
18
  public:
19
19
  Options(void) = delete;
20
20
 
21
- static const OptionMap<enum PTAStat::ClockType> ClockType;
21
+ static const OptionMap<SVFStat::ClockType> ClockType;
22
22
 
23
23
  /// If set, only return the clock when getClk is called as getClk(true).
24
24
  /// Retrieving the clock is slow but it should be fine for a few calls.
@@ -63,7 +63,7 @@ public:
63
63
  static const Option<bool> PredictPtOcc;
64
64
 
65
65
  /// PTData type.
66
- static const OptionMap<BVDataPTAImpl::PTBackingType> ptDataBacking;
66
+ static const OptionMap<PTBackingType> ptDataBacking;
67
67
 
68
68
  /// Time limit for the main phase (i.e., the actual solving) of FS analyses.
69
69
  static const Option<u32_t> FsTimeLimit;
@@ -87,7 +87,7 @@ public:
87
87
  static const Option<bool> PrintCPts;
88
88
  static const Option<bool> PrintQueryPts;
89
89
  static const Option<bool> WPANum;
90
- static OptionMultiple<PointerAnalysis::PTATY> DDASelected;
90
+ static OptionMultiple<PTATY> DDASelected;
91
91
 
92
92
  // FlowDDA.cpp
93
93
  static const Option<u32_t> FlowBudget;
@@ -215,7 +215,7 @@ public:
215
215
  static const Option<bool> AnderSVFG;
216
216
  static const Option<bool> SABERFULLSVFG;
217
217
  static const Option<bool> PrintAliases;
218
- static OptionMultiple<PointerAnalysis::PTATY> PASelected;
218
+ static OptionMultiple<PTATY> PASelected;
219
219
  static OptionMultiple<u32_t> AliasRule;
220
220
 
221
221
  // DOTGraphTraits
@@ -266,6 +266,9 @@ public:
266
266
 
267
267
  // float precision for symbolic abstraction
268
268
  static const Option<u32_t> AEPrecision;
269
+
270
+ // GraphWriter.h
271
+ static const Option<u32_t> MaxNodeLabelLength;
269
272
  };
270
273
  } // namespace SVF
271
274
 
@@ -30,6 +30,8 @@
30
30
  #ifndef SVF_SVFSTAT_H
31
31
  #define SVF_SVFSTAT_H
32
32
 
33
+ #include "MemoryModel/PointsTo.h"
34
+
33
35
  namespace SVF
34
36
  {
35
37
 
@@ -45,7 +47,7 @@ public:
45
47
 
46
48
  typedef OrderedMap<std::string, double> TIMEStatMap;
47
49
 
48
- enum ClockType
50
+ enum class ClockType
49
51
  {
50
52
  Wall,
51
53
  CPU,
@@ -35,6 +35,7 @@
35
35
  #ifndef INCLUDE_WPA_ANDERSEN_H_
36
36
  #define INCLUDE_WPA_ANDERSEN_H_
37
37
 
38
+ #include "MemoryModel/PTATY.h"
38
39
  #include "MemoryModel/PointerAnalysisImpl.h"
39
40
  #include "WPA/WPAStat.h"
40
41
  #include "WPA/WPASolver.h"
@@ -61,7 +62,7 @@ public:
61
62
  public:
62
63
 
63
64
  /// Constructor
64
- AndersenBase(SVFIR* _pag, PTATY type = Andersen_BASE, bool alias_check = true)
65
+ AndersenBase(SVFIR* _pag, PTATY type = PTATY::Andersen_BASE, bool alias_check = true)
65
66
  : BVDataPTAImpl(_pag, type, alias_check), consCG(nullptr)
66
67
  {
67
68
  iterationForPrintStat = OnTheFlyIterBudgetForStat;
@@ -107,13 +108,13 @@ public:
107
108
  }
108
109
  static inline bool classof(const PointerAnalysis *pta)
109
110
  {
110
- return ( pta->getAnalysisTy() == Andersen_BASE
111
- || pta->getAnalysisTy() == Andersen_WPA
112
- || pta->getAnalysisTy() == AndersenWaveDiff_WPA
113
- || pta->getAnalysisTy() == AndersenSCD_WPA
114
- || pta->getAnalysisTy() == AndersenSFR_WPA
115
- || pta->getAnalysisTy() == TypeCPP_WPA
116
- || pta->getAnalysisTy() == Steensgaard_WPA);
111
+ return ( pta->getAnalysisTy() == PTATY::Andersen_BASE
112
+ || pta->getAnalysisTy() == PTATY::Andersen_WPA
113
+ || pta->getAnalysisTy() == PTATY::AndersenWaveDiff_WPA
114
+ || pta->getAnalysisTy() == PTATY::AndersenSCD_WPA
115
+ || pta->getAnalysisTy() == PTATY::AndersenSFR_WPA
116
+ || pta->getAnalysisTy() == PTATY::TypeCPP_WPA
117
+ || pta->getAnalysisTy() == PTATY::Steensgaard_WPA);
117
118
  }
118
119
  //@}
119
120
 
@@ -193,7 +194,7 @@ public:
193
194
  typedef SCCDetection<ConstraintGraph*> CGSCC;
194
195
 
195
196
  /// Constructor
196
- Andersen(SVFIR* _pag, PTATY type = Andersen_WPA, bool alias_check = true)
197
+ Andersen(SVFIR* _pag, PTATY type = PTATY::Andersen_WPA, bool alias_check = true)
197
198
  : AndersenBase(_pag, type, alias_check)
198
199
  {
199
200
  }
@@ -227,10 +228,10 @@ public:
227
228
  }
228
229
  static inline bool classof(const PointerAnalysis *pta)
229
230
  {
230
- return (pta->getAnalysisTy() == Andersen_WPA
231
- || pta->getAnalysisTy() == AndersenWaveDiff_WPA
232
- || pta->getAnalysisTy() == AndersenSCD_WPA
233
- || pta->getAnalysisTy() == AndersenSFR_WPA);
231
+ return (pta->getAnalysisTy() == PTATY::Andersen_WPA
232
+ || pta->getAnalysisTy() == PTATY::AndersenWaveDiff_WPA
233
+ || pta->getAnalysisTy() == PTATY::AndersenSCD_WPA
234
+ || pta->getAnalysisTy() == PTATY::AndersenSFR_WPA);
234
235
  }
235
236
  //@}
236
237
 
@@ -401,14 +402,14 @@ private:
401
402
  static AndersenWaveDiff* diffWave; // static instance
402
403
 
403
404
  public:
404
- AndersenWaveDiff(SVFIR* _pag, PTATY type = AndersenWaveDiff_WPA, bool alias_check = true): Andersen(_pag, type, alias_check) {}
405
+ AndersenWaveDiff(SVFIR* _pag, PTATY type = PTATY::AndersenWaveDiff_WPA, bool alias_check = true): Andersen(_pag, type, alias_check) {}
405
406
 
406
407
  /// Create an singleton instance directly instead of invoking llvm pass manager
407
408
  static AndersenWaveDiff* createAndersenWaveDiff(SVFIR* _pag)
408
409
  {
409
410
  if(diffWave==nullptr)
410
411
  {
411
- diffWave = new AndersenWaveDiff(_pag, AndersenWaveDiff_WPA, false);
412
+ diffWave = new AndersenWaveDiff(_pag, PTATY::AndersenWaveDiff_WPA, false);
412
413
  diffWave->analyze();
413
414
  return diffWave;
414
415
  }
@@ -33,6 +33,7 @@
33
33
 
34
34
  #include "WPA/Andersen.h"
35
35
  #include "WPA/CSC.h"
36
+ #include "MemoryModel/PTATY.h"
36
37
  #include "MemoryModel/PointsTo.h"
37
38
 
38
39
  namespace SVF
@@ -52,7 +53,7 @@ protected:
52
53
  NodeToNodeMap pwcReps;
53
54
 
54
55
  public:
55
- AndersenSCD(SVFIR* _pag, PTATY type = AndersenSCD_WPA) :
56
+ AndersenSCD(SVFIR* _pag, PTATY type = PTATY::AndersenSCD_WPA) :
56
57
  Andersen(_pag,type)
57
58
  {
58
59
  }
@@ -114,7 +115,7 @@ private:
114
115
  FieldReps fieldReps;
115
116
 
116
117
  public:
117
- AndersenSFR(SVFIR* _pag, PTATY type = AndersenSFR_WPA) :
118
+ AndersenSFR(SVFIR* _pag, PTATY type = PTATY::AndersenSFR_WPA) :
118
119
  AndersenSCD(_pag, type), csc(nullptr)
119
120
  {
120
121
  }
@@ -57,7 +57,7 @@ public:
57
57
  typedef BVDataPTAImpl::MutDFPTDataTy::PtsMap PtsMap;
58
58
 
59
59
  /// Constructor
60
- explicit FlowSensitive(SVFIR* _pag, PTATY type = FSSPARSE_WPA) : WPASVFGFSSolver(), BVDataPTAImpl(_pag, type)
60
+ explicit FlowSensitive(SVFIR* _pag, PTATY type = PTATY::FSSPARSE_WPA) : WPASVFGFSSolver(), BVDataPTAImpl(_pag, type)
61
61
  {
62
62
  svfg = nullptr;
63
63
  solveTime = sccTime = processTime = propagationTime = updateTime = 0;
@@ -126,7 +126,7 @@ public:
126
126
  }
127
127
  static inline bool classof(const PointerAnalysis *pta)
128
128
  {
129
- return pta->getAnalysisTy() == FSSPARSE_WPA;
129
+ return pta->getAnalysisTy() == PTATY::FSSPARSE_WPA;
130
130
  }
131
131
  //@}
132
132
 
@@ -18,6 +18,7 @@
18
18
  #include "MSSA/SVFGBuilder.h"
19
19
  #include "WPA/FlowSensitive.h"
20
20
  #include "WPA/WPAFSSolver.h"
21
+ #include "MemoryModel/PTATY.h"
21
22
  #include "MemoryModel/PointsTo.h"
22
23
 
23
24
  namespace SVF
@@ -50,7 +51,7 @@ public:
50
51
  static VersionedVar atKey(NodeID, Version);
51
52
 
52
53
  /// Constructor
53
- VersionedFlowSensitive(SVFIR *_pag, PTATY type = VFS_WPA);
54
+ VersionedFlowSensitive(SVFIR *_pag, PTATY type = PTATY::VFS_WPA);
54
55
 
55
56
  /// Initialize analysis
56
57
  virtual void initialize() override;
@@ -72,7 +73,7 @@ public:
72
73
  }
73
74
  static inline bool classof(const PointerAnalysis *pta)
74
75
  {
75
- return pta->getAnalysisTy() == VFS_WPA;
76
+ return pta->getAnalysisTy() == PTATY::VFS_WPA;
76
77
  }
77
78
  //@}
78
79
 
@@ -27,6 +27,7 @@
27
27
  *
28
28
  */
29
29
 
30
+ #include <iomanip>
30
31
  #include "AE/Core/AbstractState.h"
31
32
  #include "SVFIR/SVFIR.h"
32
33
  #include "Util/SVFUtil.h"
@@ -341,4 +342,4 @@ bool AbstractState::geqVarToValMap(const VarToAbsValMap&lhs, const VarToAbsValMa
341
342
  return false;
342
343
  }
343
344
  return true;
344
- }
345
+ }
@@ -40,7 +40,7 @@ using namespace SVFUtil;
40
40
  * Constructor
41
41
  */
42
42
  ContextDDA::ContextDDA(SVFIR* _pag, DDAClient* client)
43
- : CondPTAImpl<ContextCond>(_pag, PointerAnalysis::Cxt_DDA),DDAVFSolver<CxtVar,CxtPtSet,CxtLocDPItem>(),
43
+ : CondPTAImpl<ContextCond>(_pag, PTATY::Cxt_DDA),DDAVFSolver<CxtVar,CxtPtSet,CxtLocDPItem>(),
44
44
  _client(client)
45
45
  {
46
46
  flowDDA = new FlowDDA(_pag, client);
@@ -59,10 +59,9 @@ void DDAPass::runOnModule(SVFIR* pag)
59
59
 
60
60
  selectClient();
61
61
 
62
- for (u32_t i = PointerAnalysis::FlowS_DDA;
63
- i < PointerAnalysis::Default_PTA; i++)
62
+ for (u32_t i = PTATY::FlowS_DDA; i < PTATY::Default_PTA; i++)
64
63
  {
65
- PointerAnalysis::PTATY iPtTy = static_cast<PointerAnalysis::PTATY>(i);
64
+ PTATY iPtTy = static_cast<PTATY>(i);
66
65
  if (Options::DDASelected(iPtTy))
67
66
  runPointerAnalysis(pag, i);
68
67
  }
@@ -114,12 +113,12 @@ void DDAPass::runPointerAnalysis(SVFIR* pag, u32_t kind)
114
113
  /// Initialize pointer analysis.
115
114
  switch (kind)
116
115
  {
117
- case PointerAnalysis::Cxt_DDA:
116
+ case PTATY::Cxt_DDA:
118
117
  {
119
118
  _pta = std::make_unique<ContextDDA>(pag, _client);
120
119
  break;
121
120
  }
122
- case PointerAnalysis::FlowS_DDA:
121
+ case PTATY::FlowS_DDA:
123
122
  {
124
123
  _pta = std::make_unique<FlowDDA>(pag, _client);
125
124
  break;
@@ -28,6 +28,8 @@
28
28
  * Author: Yulei Sui
29
29
  */
30
30
 
31
+ #include <functional>
32
+
31
33
  #include "Graphs/CallGraph.h"
32
34
  #include "SVFIR/SVFIR.h"
33
35
  #include "Util/Options.h"
@@ -852,10 +852,11 @@ struct DOTGraphTraits<SVFG*> : public DOTGraphTraits<SVFIR*>
852
852
 
853
853
  std::string getNodeLabel(NodeType *node, SVFG *graph)
854
854
  {
855
+ std::string cool = std::string(240, '-');
855
856
  if (isSimple())
856
- return getSimpleNodeLabel(node, graph);
857
+ return cool + getSimpleNodeLabel(node, graph);
857
858
  else
858
- return getCompleteNodeLabel(node, graph);
859
+ return cool + getCompleteNodeLabel(node, graph);
859
860
  }
860
861
 
861
862
  /// Return label of a VFG node without MemSSA information
@@ -27,10 +27,11 @@
27
27
  * Author: Yulei Sui
28
28
  */
29
29
 
30
-
30
+ #include "MemoryModel/PointerAnalysis.h"
31
31
  #include <Graphs/SVFGNode.h>
32
- #include "Util/Options.h"
32
+ #include "Graphs/CallGraph.h"
33
33
  #include "Graphs/VFG.h"
34
+ #include "Util/Options.h"
34
35
  #include "Util/SVFUtil.h"
35
36
 
36
37
  using namespace SVF;
@@ -928,8 +929,8 @@ void VFG::view()
928
929
  void VFG::updateCallGraph(PointerAnalysis* pta)
929
930
  {
930
931
  VFGEdgeSetTy vfEdgesAtIndCallSite;
931
- PointerAnalysis::CallEdgeMap::const_iterator iter = pta->getIndCallMap().begin();
932
- PointerAnalysis::CallEdgeMap::const_iterator eiter = pta->getIndCallMap().end();
932
+ CallGraph::CallEdgeMap::const_iterator iter = pta->getIndCallMap().begin();
933
+ CallGraph::CallEdgeMap::const_iterator eiter = pta->getIndCallMap().end();
933
934
  for (; iter != eiter; iter++)
934
935
  {
935
936
  const CallICFGNode* newcs = iter->first;
@@ -28,6 +28,7 @@
28
28
  */
29
29
 
30
30
  #include "Util/Options.h"
31
+ #include "MemoryModel/PointerAnalysisImpl.h"
31
32
  #include "MSSA/MemRegion.h"
32
33
  #include "MSSA/MSSAMuChi.h"
33
34
  #include "Graphs/CallGraph.h"
@@ -28,6 +28,7 @@
28
28
  */
29
29
 
30
30
  #include "Util/Options.h"
31
+ #include "MemoryModel/PointerAnalysisImpl.h"
31
32
  #include "MSSA/MemPartition.h"
32
33
  #include "MSSA/MemSSA.h"
33
34
  #include "Graphs/SVFGStat.h"
@@ -48,7 +49,7 @@ double MemSSA::timeOfSSARenaming = 0; ///< Time for SSA rename
48
49
  MemSSA::MemSSA(BVDataPTAImpl* p, bool ptrOnlyMSSA)
49
50
  {
50
51
  pta = p;
51
- assert((pta->getAnalysisTy()!=PointerAnalysis::Default_PTA)
52
+ assert((pta->getAnalysisTy() != PTATY::Default_PTA)
52
53
  && "please specify a pointer analysis");
53
54
 
54
55
  if (Options::MemPar() == MemPartition::Distinct)
@@ -29,8 +29,10 @@
29
29
  *
30
30
  */
31
31
 
32
- #include "Util/Options.h"
33
32
  #include "MemoryModel/AccessPath.h"
33
+ #include "SVFIR/SVFIR.h"
34
+ #include "SVFIR/SVFVariables.h"
35
+ #include "Util/Options.h"
34
36
  #include "Util/SVFUtil.h"
35
37
 
36
38
  using namespace SVF;
@@ -30,6 +30,7 @@
30
30
  #include "Util/Options.h"
31
31
  #include "Util/SVFUtil.h"
32
32
 
33
+ #include "MemoryModel/PTATY.h"
33
34
  #include "MemoryModel/PointerAnalysisImpl.h"
34
35
  #include "SVFIR/PAGBuilderFromFile.h"
35
36
  #include "Util/PTAStat.h"
@@ -72,7 +73,7 @@ PointerAnalysis::PointerAnalysis(SVFIR *p, PTATY ty, bool alias_check) : ptaTy(t
72
73
  pag = p;
73
74
  OnTheFlyIterBudgetForStat = Options::StatBudget();
74
75
  print_stat = Options::PStat();
75
- ptaImplTy = BaseImpl;
76
+ ptaImplTy = PTAImplTy::BaseImpl;
76
77
  alias_validation = (alias_check && Options::EnableAliasCheck());
77
78
  }
78
79
 
@@ -29,6 +29,7 @@
29
29
  */
30
30
 
31
31
 
32
+ #include "MemoryModel/PTATY.h"
32
33
  #include "MemoryModel/PointerAnalysisImpl.h"
33
34
  #include "Util/Options.h"
34
35
  #include <fstream>
@@ -43,12 +44,12 @@ using namespace std;
43
44
  /*!
44
45
  * Constructor
45
46
  */
46
- BVDataPTAImpl::BVDataPTAImpl(SVFIR* p, PointerAnalysis::PTATY type, bool alias_check) :
47
+ BVDataPTAImpl::BVDataPTAImpl(SVFIR* p, PTATY type, bool alias_check) :
47
48
  PointerAnalysis(p, type, alias_check), ptCache()
48
49
  {
49
- if (type == Andersen_BASE || type == Andersen_WPA || type == AndersenWaveDiff_WPA
50
- || type == TypeCPP_WPA || type == FlowS_DDA
51
- || type == AndersenSCD_WPA || type == AndersenSFR_WPA || type == CFLFICI_WPA || type == CFLFSCS_WPA)
50
+ if (type == PTATY::Andersen_BASE || type == PTATY::Andersen_WPA || type == PTATY::AndersenWaveDiff_WPA
51
+ || type == PTATY::TypeCPP_WPA || type == PTATY::FlowS_DDA
52
+ || type == PTATY::AndersenSCD_WPA || type == PTATY::AndersenSFR_WPA || type == PTATY::CFLFICI_WPA || type == PTATY::CFLFSCS_WPA)
52
53
  {
53
54
  // Only maintain reverse points-to when the analysis is field-sensitive, as objects turning
54
55
  // field-insensitive is all it is used for.
@@ -57,14 +58,14 @@ BVDataPTAImpl::BVDataPTAImpl(SVFIR* p, PointerAnalysis::PTATY type, bool alias_c
57
58
  else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersDiffPTDataTy>(getPtCache(), maintainRevPts);
58
59
  else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
59
60
  }
60
- else if (type == Steensgaard_WPA)
61
+ else if (type == PTATY::Steensgaard_WPA)
61
62
  {
62
63
  // Steensgaard is only field-insensitive (for now?), so no reverse points-to.
63
64
  if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutDiffPTDataTy>(false);
64
65
  else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersDiffPTDataTy>(getPtCache(), false);
65
66
  else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
66
67
  }
67
- else if (type == FSSPARSE_WPA)
68
+ else if (type == PTATY::FSSPARSE_WPA)
68
69
  {
69
70
  if (Options::INCDFPTData())
70
71
  {
@@ -79,7 +80,7 @@ BVDataPTAImpl::BVDataPTAImpl(SVFIR* p, PointerAnalysis::PTATY type, bool alias_c
79
80
  else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
80
81
  }
81
82
  }
82
- else if (type == VFS_WPA)
83
+ else if (type == PTATY::VFS_WPA)
83
84
  {
84
85
  if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutVersionedPTDataTy>(false);
85
86
  else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersVersionedPTDataTy>(getPtCache(), false);
@@ -87,7 +88,7 @@ BVDataPTAImpl::BVDataPTAImpl(SVFIR* p, PointerAnalysis::PTATY type, bool alias_c
87
88
  }
88
89
  else assert(false && "no points-to data available");
89
90
 
90
- ptaImplTy = BVDataImpl;
91
+ ptaImplTy = PTAImplTy::BVDataImpl;
91
92
  }
92
93
 
93
94
  void BVDataPTAImpl::finalize()
@@ -104,15 +105,15 @@ void BVDataPTAImpl::finalize()
104
105
 
105
106
  std::string subtitle;
106
107
 
107
- if(ptaTy >= Andersen_BASE && ptaTy <= Steensgaard_WPA)
108
+ if(ptaTy >= PTATY::Andersen_BASE && ptaTy <= PTATY::Steensgaard_WPA)
108
109
  subtitle = "Andersen's analysis bitvector";
109
- else if(ptaTy >=FSDATAFLOW_WPA && ptaTy <=FSCS_WPA)
110
+ else if(ptaTy >= PTATY::FSDATAFLOW_WPA && ptaTy <= PTATY::FSCS_WPA)
110
111
  subtitle = "flow-sensitive analysis bitvector";
111
- else if(ptaTy >=CFLFICI_WPA && ptaTy <=CFLFSCS_WPA)
112
+ else if(ptaTy >= PTATY::CFLFICI_WPA && ptaTy <= PTATY::CFLFSCS_WPA)
112
113
  subtitle = "CFL analysis bitvector";
113
- else if(ptaTy == TypeCPP_WPA)
114
+ else if(ptaTy == PTATY::TypeCPP_WPA)
114
115
  subtitle = "Type analysis bitvector";
115
- else if(ptaTy >=FieldS_DDA && ptaTy <=Cxt_DDA)
116
+ else if(ptaTy >= PTATY::FieldS_DDA && ptaTy <= PTATY::Cxt_DDA)
116
117
  subtitle = "DDA bitvector";
117
118
  else
118
119
  subtitle = "bitvector";
@@ -29,6 +29,7 @@
29
29
 
30
30
  #include "Util/Options.h"
31
31
  #include "SVFIR/SVFIR.h"
32
+ #include "Graphs/CHG.h"
32
33
  #include "Graphs/CallGraph.h"
33
34
 
34
35
  using namespace SVF;
@@ -29,6 +29,7 @@
29
29
  * Author: Xiao Cheng, Yulei Sui
30
30
  */
31
31
 
32
+ #include "SVFIR/SVFIR.h"
32
33
  #include "SVFIR/SVFVariables.h"
33
34
  #include "Util/Options.h"
34
35
  #include "Util/SVFUtil.h"
@@ -4,19 +4,20 @@
4
4
  #include "Util/CommandLine.h"
5
5
  #include "FastCluster/fastcluster.h"
6
6
  #include "Util/ExtAPI.h"
7
+ #include "MemoryModel/PTATY.h"
7
8
  #include "MSSA/MemSSA.h"
8
9
  #include "WPA/WPAPass.h"
9
10
  #include "AE/Svfexe/AbstractInterpretation.h"
10
11
 
11
12
  namespace SVF
12
13
  {
13
- const OptionMap<enum PTAStat::ClockType> Options::ClockType(
14
+ const OptionMap<enum SVFStat::ClockType> Options::ClockType(
14
15
  "clock-type",
15
16
  "how time should be measured",
16
- PTAStat::ClockType::CPU,
17
+ SVFStat::ClockType::CPU,
17
18
  {
18
- {PTAStat::ClockType::Wall, "wall", "use wall time"},
19
- {PTAStat::ClockType::CPU, "cpu", "use CPU time"},
19
+ {SVFStat::ClockType::Wall, "wall", "use wall time"},
20
+ {SVFStat::ClockType::CPU, "cpu", "use CPU time"},
20
21
  }
21
22
  );
22
23
 
@@ -44,13 +45,13 @@ const Option<u32_t> Options::MaxFieldLimit(
44
45
  512
45
46
  );
46
47
 
47
- const OptionMap<BVDataPTAImpl::PTBackingType> Options::ptDataBacking(
48
+ const OptionMap<PTBackingType> Options::ptDataBacking(
48
49
  "ptd",
49
50
  "Overarching points-to data structure",
50
- BVDataPTAImpl::PTBackingType::Persistent,
51
+ PTBackingType::Persistent,
51
52
  {
52
- {BVDataPTAImpl::PTBackingType::Mutable, "mutable", "points-to set per pointer"},
53
- {BVDataPTAImpl::PTBackingType::Persistent, "persistent", "points-to set ID per pointer, operations hash-consed"},
53
+ {PTBackingType::Mutable, "mutable", "points-to set per pointer"},
54
+ {PTBackingType::Persistent, "persistent", "points-to set ID per pointer, operations hash-consed"},
54
55
  }
55
56
  );
56
57
 
@@ -136,11 +137,11 @@ const Option<bool> Options::WPANum(
136
137
 
137
138
  /// register this into alias analysis group
138
139
  //static RegisterAnalysisGroup<AliasAnalysis> AA_GROUP(DDAPA);
139
- OptionMultiple<PointerAnalysis::PTATY> Options::DDASelected(
140
+ OptionMultiple<PTATY> Options::DDASelected(
140
141
  "Select pointer analysis",
141
142
  {
142
- {PointerAnalysis::FlowS_DDA, "dfs", "Demand-driven flow sensitive analysis"},
143
- {PointerAnalysis::Cxt_DDA, "cxt", "Demand-driven context- flow- sensitive analysis"},
143
+ {PTATY::FlowS_DDA, "dfs", "Demand-driven flow sensitive analysis"},
144
+ {PTATY::Cxt_DDA, "cxt", "Demand-driven context- flow- sensitive analysis"},
144
145
  }
145
146
  );
146
147
 
@@ -677,18 +678,18 @@ const Option<bool> Options::PrintAliases(
677
678
  false
678
679
  );
679
680
 
680
- OptionMultiple<PointerAnalysis::PTATY> Options::PASelected(
681
+ OptionMultiple<PTATY> Options::PASelected(
681
682
  "Select pointer analysis",
682
683
  {
683
- {PointerAnalysis::Andersen_WPA, "nander", "Standard inclusion-based analysis"},
684
- {PointerAnalysis::AndersenSCD_WPA, "sander", "Selective cycle detection inclusion-based analysis"},
685
- {PointerAnalysis::AndersenSFR_WPA, "sfrander", "Stride-based field representation inclusion-based analysis"},
686
- {PointerAnalysis::AndersenWaveDiff_WPA, "ander", "Diff wave propagation inclusion-based analysis"},
687
- {PointerAnalysis::Steensgaard_WPA, "steens", "Steensgaard's pointer analysis"},
684
+ {PTATY::Andersen_WPA, "nander", "Standard inclusion-based analysis"},
685
+ {PTATY::AndersenSCD_WPA, "sander", "Selective cycle detection inclusion-based analysis"},
686
+ {PTATY::AndersenSFR_WPA, "sfrander", "Stride-based field representation inclusion-based analysis"},
687
+ {PTATY::AndersenWaveDiff_WPA, "ander", "Diff wave propagation inclusion-based analysis"},
688
+ {PTATY::Steensgaard_WPA, "steens", "Steensgaard's pointer analysis"},
688
689
  // Disabled till further work is done.
689
- {PointerAnalysis::FSSPARSE_WPA, "fspta", "Sparse flow sensitive pointer analysis"},
690
- {PointerAnalysis::VFS_WPA, "vfspta", "Versioned sparse flow-sensitive points-to analysis"},
691
- {PointerAnalysis::TypeCPP_WPA, "type", "Type-based fast analysis for Callgraph, SVFIR and CHA"},
690
+ {PTATY::FSSPARSE_WPA, "fspta", "Sparse flow sensitive pointer analysis"},
691
+ {PTATY::VFS_WPA, "vfspta", "Versioned sparse flow-sensitive points-to analysis"},
692
+ {PTATY::TypeCPP_WPA, "type", "Type-based fast analysis for Callgraph, SVFIR and CHA"},
692
693
  }
693
694
  );
694
695
 
@@ -856,4 +857,10 @@ const Option<u32_t> Options::AEPrecision(
856
857
  0
857
858
  );
858
859
 
860
+ const Option<u32_t> Options::MaxNodeLabelLength(
861
+ "max-node-label-length",
862
+ "maxmimum length of dumped graph node labels",
863
+ 250
864
+ );
865
+
859
866
  } // namespace SVF.
@@ -30,6 +30,7 @@
30
30
  #include <iomanip>
31
31
  #include "Graphs/CallGraph.h"
32
32
  #include "Util/PTAStat.h"
33
+ #include "MemoryModel/PTATY.h"
33
34
  #include "MemoryModel/PointerAnalysisImpl.h"
34
35
  #include "SVFIR/SVFIR.h"
35
36
 
@@ -129,13 +130,13 @@ void PTAStat::callgraphStat()
129
130
  PTNumStatMap["TotalEdge"] = totalEdge;
130
131
  PTNumStatMap["CalRetPairInCycle"] = edgeInCycle;
131
132
 
132
- if(pta->getAnalysisTy() >= PointerAnalysis::PTATY::Andersen_BASE && pta->getAnalysisTy() <= PointerAnalysis::PTATY::Steensgaard_WPA)
133
+ if(pta->getAnalysisTy() >= PTATY::Andersen_BASE && pta->getAnalysisTy() <= PTATY::Steensgaard_WPA)
133
134
  SVFStat::printStat("PTACallGraph Stats (Andersen analysis)");
134
- else if(pta->getAnalysisTy() >= PointerAnalysis::PTATY::FSDATAFLOW_WPA && pta->getAnalysisTy() <= PointerAnalysis::PTATY::FSCS_WPA)
135
+ else if(pta->getAnalysisTy() >= PTATY::FSDATAFLOW_WPA && pta->getAnalysisTy() <= PTATY::FSCS_WPA)
135
136
  SVFStat::printStat("PTACallGraph Stats (Flow-sensitive analysis)");
136
- else if(pta->getAnalysisTy() >= PointerAnalysis::PTATY::CFLFICI_WPA && pta->getAnalysisTy() <= PointerAnalysis::PTATY::CFLFSCS_WPA)
137
+ else if(pta->getAnalysisTy() >= PTATY::CFLFICI_WPA && pta->getAnalysisTy() <= PTATY::CFLFSCS_WPA)
137
138
  SVFStat::printStat("PTACallGraph Stats (CFL-R analysis)");
138
- else if(pta->getAnalysisTy() >= PointerAnalysis::PTATY::FieldS_DDA && pta->getAnalysisTy() <= PointerAnalysis::PTATY::Cxt_DDA)
139
+ else if(pta->getAnalysisTy() >= PTATY::FieldS_DDA && pta->getAnalysisTy() <= PTATY::Cxt_DDA)
139
140
  SVFStat::printStat("PTACallGraph Stats (DDA analysis)");
140
141
  else
141
142
  SVFStat::printStat("PTACallGraph Stats");
@@ -27,6 +27,9 @@
27
27
  * Author: Xiao Cheng
28
28
  */
29
29
 
30
+ #include <iomanip>
31
+
32
+ #include "SVFIR/SVFIR.h"
30
33
  #include "Util/Options.h"
31
34
  #include "Util/SVFStat.h"
32
35
  #include "Graphs/CallGraph.h"
@@ -27,10 +27,14 @@
27
27
  * Author: Yulei Sui
28
28
  */
29
29
 
30
+ #include <unistd.h>
31
+ #include <signal.h>
32
+
30
33
  #include "Util/Options.h"
31
34
  #include "Util/SVFUtil.h"
32
35
  #include "MemoryModel/PointsTo.h"
33
36
  #include "Graphs/CallGraph.h"
37
+ #include "SVFIR/SVFIR.h"
34
38
  #include "SVFIR/SVFVariables.h"
35
39
 
36
40
  #include <sys/resource.h> /// increase stack size
@@ -443,4 +447,4 @@ bool SVFUtil::isProgEntryFunction(const FunObjVar* funObjVar)
443
447
  {
444
448
  const char* main_name=Options::SVFMain() ? "svf.main" : "main";
445
449
  return funObjVar && funObjVar->getName() == main_name;
446
- }
450
+ }
@@ -10,6 +10,7 @@
10
10
  #include "WPA/Andersen.h"
11
11
  #include "WPA/VersionedFlowSensitive.h"
12
12
  #include "Util/Options.h"
13
+ #include "MemoryModel/PTATY.h"
13
14
  #include "MemoryModel/PointsTo.h"
14
15
  #include <iostream>
15
16
  #include <queue>
@@ -34,6 +34,7 @@
34
34
 
35
35
 
36
36
  #include "Util/Options.h"
37
+ #include "MemoryModel/PTATY.h"
37
38
  #include "MemoryModel/PointerAnalysisImpl.h"
38
39
  #include "WPA/WPAPass.h"
39
40
  #include "WPA/Andersen.h"
@@ -67,9 +68,9 @@ WPAPass::~WPAPass()
67
68
  */
68
69
  void WPAPass::runOnModule(SVFIR* pag)
69
70
  {
70
- for (u32_t i = 0; i<= PointerAnalysis::Default_PTA; i++)
71
+ for (u32_t i = 0; i<= PTATY::Default_PTA; i++)
71
72
  {
72
- PointerAnalysis::PTATY iPtaTy = static_cast<PointerAnalysis::PTATY>(i);
73
+ PTATY iPtaTy = static_cast<PTATY>(i);
73
74
  if (Options::PASelected(iPtaTy))
74
75
  runPointerAnalysis(pag, i);
75
76
  }
@@ -84,28 +85,28 @@ void WPAPass::runPointerAnalysis(SVFIR* pag, u32_t kind)
84
85
  /// Initialize pointer analysis.
85
86
  switch (kind)
86
87
  {
87
- case PointerAnalysis::Andersen_WPA:
88
+ case PTATY::Andersen_WPA:
88
89
  _pta = new Andersen(pag);
89
90
  break;
90
- case PointerAnalysis::AndersenSCD_WPA:
91
+ case PTATY::AndersenSCD_WPA:
91
92
  _pta = new AndersenSCD(pag);
92
93
  break;
93
- case PointerAnalysis::AndersenSFR_WPA:
94
+ case PTATY::AndersenSFR_WPA:
94
95
  _pta = new AndersenSFR(pag);
95
96
  break;
96
- case PointerAnalysis::AndersenWaveDiff_WPA:
97
+ case PTATY::AndersenWaveDiff_WPA:
97
98
  _pta = new AndersenWaveDiff(pag);
98
99
  break;
99
- case PointerAnalysis::Steensgaard_WPA:
100
+ case PTATY::Steensgaard_WPA:
100
101
  _pta = new Steensgaard(pag);
101
102
  break;
102
- case PointerAnalysis::FSSPARSE_WPA:
103
+ case PTATY::FSSPARSE_WPA:
103
104
  _pta = new FlowSensitive(pag);
104
105
  break;
105
- case PointerAnalysis::VFS_WPA:
106
+ case PTATY::VFS_WPA:
106
107
  _pta = new VersionedFlowSensitive(pag);
107
108
  break;
108
- case PointerAnalysis::TypeCPP_WPA:
109
+ case PTATY::TypeCPP_WPA:
109
110
  _pta = new TypeAnalysis(pag);
110
111
  break;
111
112
  default:
@@ -121,7 +122,7 @@ void WPAPass::runPointerAnalysis(SVFIR* pag, u32_t kind)
121
122
  assert(SVFUtil::isa<AndersenBase>(_pta) && "supports only andersen/steensgaard for pre-computed SVFG");
122
123
  SVFG *svfg = memSSA.buildFullSVFG((BVDataPTAImpl*)_pta);
123
124
  /// support mod-ref queries only for -ander
124
- if (Options::PASelected(PointerAnalysis::AndersenWaveDiff_WPA))
125
+ if (Options::PASelected(PTATY::AndersenWaveDiff_WPA))
125
126
  _svfg = svfg;
126
127
  }
127
128
 
@@ -165,7 +166,7 @@ const PointsTo& WPAPass::getPts(NodeID var)
165
166
  */
166
167
  ModRefInfo WPAPass::getModRefInfo(const CallICFGNode* callInst)
167
168
  {
168
- assert(Options::PASelected(PointerAnalysis::AndersenWaveDiff_WPA) && Options::AnderSVFG() && "mod-ref query is only support with -ander and -svfg turned on");
169
+ assert(Options::PASelected(PTATY::AndersenWaveDiff_WPA) && Options::AnderSVFG() && "mod-ref query is only support with -ander and -svfg turned on");
169
170
  return _svfg->getMSSA()->getMRGenerator()->getModRefInfo(callInst);
170
171
  }
171
172
 
@@ -175,6 +176,6 @@ ModRefInfo WPAPass::getModRefInfo(const CallICFGNode* callInst)
175
176
  */
176
177
  ModRefInfo WPAPass::getModRefInfo(const CallICFGNode* callInst1, const CallICFGNode* callInst2)
177
178
  {
178
- assert(Options::PASelected(PointerAnalysis::AndersenWaveDiff_WPA) && Options::AnderSVFG() && "mod-ref query is only support with -ander and -svfg turned on");
179
+ assert(Options::PASelected(PTATY::AndersenWaveDiff_WPA) && Options::AnderSVFG() && "mod-ref query is only support with -ander and -svfg turned on");
179
180
  return _svfg->getMSSA()->getMRGenerator()->getModRefInfo(callInst1, callInst2);
180
181
  }
@@ -35,6 +35,8 @@
35
35
  #include "SVF-LLVM/BasicTypes.h"
36
36
  #include "Util/Options.h"
37
37
  #include "Graphs/BasicBlockG.h"
38
+ #include "Graphs/ICFGNode.h"
39
+ #include "SVFIR/SVFIR.h"
38
40
 
39
41
  namespace SVF
40
42
  {