svf-tools 1.0.1288 → 1.0.1289

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 (157) 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 +54 -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
  39. package/SVF-doxygen/doxygen.config +0 -2548
  40. package/SVF-doxygen/wiki/PAG.png +0 -0
  41. package/SVF-doxygen/wiki/andersen.png +0 -0
  42. package/SVF-doxygen/wiki/callgraph.png +0 -0
  43. package/SVF-doxygen/wiki/consG.png +0 -0
  44. package/SVF-doxygen/wiki/cpu2000-flto +0 -432
  45. package/SVF-doxygen/wiki/cpu2006-flto +0 -417
  46. package/SVF-doxygen/wiki/cpu2017-wllvm.cfg +0 -999
  47. package/SVF-doxygen/wiki/database.png +0 -0
  48. package/SVF-doxygen/wiki/framework.png +0 -0
  49. package/SVF-doxygen/wiki/help.png +0 -0
  50. package/SVF-doxygen/wiki/icfg.png +0 -0
  51. package/SVF-doxygen/wiki/mssa-cha.png +0 -0
  52. package/SVF-doxygen/wiki/pagedge.png +0 -0
  53. package/SVF-doxygen/wiki/pagnode.png +0 -0
  54. package/SVF-doxygen/wiki/pt.png +0 -0
  55. package/SVF-doxygen/wiki/setupcmake.png +0 -0
  56. package/SVF-doxygen/wiki/setupconfiguration.png +0 -0
  57. package/SVF-doxygen/wiki/setupdashboard.png +0 -0
  58. package/SVF-doxygen/wiki/setupdebug.png +0 -0
  59. package/SVF-doxygen/wiki/setupenv.png +0 -0
  60. package/SVF-doxygen/wiki/startup.png +0 -0
  61. package/SVF-doxygen/wiki/svf-stat.pdf +0 -0
  62. package/SVF-doxygen/wiki/svfg-framework.png +0 -0
  63. package/SVF-doxygen/wiki/svfg.png +0 -0
  64. package/SVF-doxygen/wiki/svfg_opt.png +0 -0
  65. package/SVF-doxygen/wiki/svfgedge-cha.png +0 -0
  66. package/SVF-doxygen/wiki/svfgnode-cha.png +0 -0
  67. package/SVF-doxygen/wiki/svfpic/README.md +0 -6
  68. package/SVF-doxygen/wiki/svfpic/ass-1debug1.png +0 -0
  69. package/SVF-doxygen/wiki/svfpic/ass-1debug2.png +0 -0
  70. package/SVF-doxygen/wiki/svfpic/build.jpg +0 -0
  71. package/SVF-doxygen/wiki/svfpic/cmd.png +0 -0
  72. package/SVF-doxygen/wiki/svfpic/connect1.jpg +0 -0
  73. package/SVF-doxygen/wiki/svfpic/connect2.png +0 -0
  74. package/SVF-doxygen/wiki/svfpic/connect3.png +0 -0
  75. package/SVF-doxygen/wiki/svfpic/connect4.jpg +0 -0
  76. package/SVF-doxygen/wiki/svfpic/connect5.jpg +0 -0
  77. package/SVF-doxygen/wiki/svfpic/connect6.png +0 -0
  78. package/SVF-doxygen/wiki/svfpic/connect7.jpg +0 -0
  79. package/SVF-doxygen/wiki/svfpic/continue.png +0 -0
  80. package/SVF-doxygen/wiki/svfpic/debug-new.png +0 -0
  81. package/SVF-doxygen/wiki/svfpic/debug-new2.png +0 -0
  82. package/SVF-doxygen/wiki/svfpic/debug1.jpeg +0 -0
  83. package/SVF-doxygen/wiki/svfpic/debug2.jpeg +0 -0
  84. package/SVF-doxygen/wiki/svfpic/debug3.png +0 -0
  85. package/SVF-doxygen/wiki/svfpic/debug4.png +0 -0
  86. package/SVF-doxygen/wiki/svfpic/debug5.jpeg +0 -0
  87. package/SVF-doxygen/wiki/svfpic/debug6.jpeg +0 -0
  88. package/SVF-doxygen/wiki/svfpic/docker_sys_requirement.png +0 -0
  89. package/SVF-doxygen/wiki/svfpic/docker_sys_requirements.png +0 -0
  90. package/SVF-doxygen/wiki/svfpic/dockerbuild.png +0 -0
  91. package/SVF-doxygen/wiki/svfpic/dockerbuild2.jpg +0 -0
  92. package/SVF-doxygen/wiki/svfpic/dockerbuild3.jpg +0 -0
  93. package/SVF-doxygen/wiki/svfpic/dockerbuild4.png +0 -0
  94. package/SVF-doxygen/wiki/svfpic/dockerbuild5.jpg +0 -0
  95. package/SVF-doxygen/wiki/svfpic/dockerbuildimage.png +0 -0
  96. package/SVF-doxygen/wiki/svfpic/dockercmd.png +0 -0
  97. package/SVF-doxygen/wiki/svfpic/dockercmd2.png +0 -0
  98. package/SVF-doxygen/wiki/svfpic/dockercontainer.png +0 -0
  99. package/SVF-doxygen/wiki/svfpic/dockerdb1.jpg +0 -0
  100. package/SVF-doxygen/wiki/svfpic/dockerdb10.jpeg +0 -0
  101. package/SVF-doxygen/wiki/svfpic/dockerdb2.jpg +0 -0
  102. package/SVF-doxygen/wiki/svfpic/dockerdb3.jpg +0 -0
  103. package/SVF-doxygen/wiki/svfpic/dockerdb4.jpg +0 -0
  104. package/SVF-doxygen/wiki/svfpic/dockerdb5.png +0 -0
  105. package/SVF-doxygen/wiki/svfpic/dockerdb6.jpeg +0 -0
  106. package/SVF-doxygen/wiki/svfpic/dockerdb7.png +0 -0
  107. package/SVF-doxygen/wiki/svfpic/dockerdb8.png +0 -0
  108. package/SVF-doxygen/wiki/svfpic/dockerdb9.jpeg +0 -0
  109. package/SVF-doxygen/wiki/svfpic/dockerfinshbuilt.png +0 -0
  110. package/SVF-doxygen/wiki/svfpic/dockerimage.png +0 -0
  111. package/SVF-doxygen/wiki/svfpic/dockernameImage.png +0 -0
  112. package/SVF-doxygen/wiki/svfpic/dockerpull.png +0 -0
  113. package/SVF-doxygen/wiki/svfpic/dockerpull2.png +0 -0
  114. package/SVF-doxygen/wiki/svfpic/download.jpg +0 -0
  115. package/SVF-doxygen/wiki/svfpic/extension1.jpeg +0 -0
  116. package/SVF-doxygen/wiki/svfpic/extension2.jpeg +0 -0
  117. package/SVF-doxygen/wiki/svfpic/graphviz.png +0 -0
  118. package/SVF-doxygen/wiki/svfpic/hellodb.png +0 -0
  119. package/SVF-doxygen/wiki/svfpic/hellodb2.png +0 -0
  120. package/SVF-doxygen/wiki/svfpic/hviz_0.png +0 -0
  121. package/SVF-doxygen/wiki/svfpic/hviz_1.png +0 -0
  122. package/SVF-doxygen/wiki/svfpic/hviz_2.png +0 -0
  123. package/SVF-doxygen/wiki/svfpic/installC:C++Ext.png +0 -0
  124. package/SVF-doxygen/wiki/svfpic/installCMakeExt.png +0 -0
  125. package/SVF-doxygen/wiki/svfpic/installRCext.png +0 -0
  126. package/SVF-doxygen/wiki/svfpic/installdockerext.png +0 -0
  127. package/SVF-doxygen/wiki/svfpic/launch1.png +0 -0
  128. package/SVF-doxygen/wiki/svfpic/openfile.png +0 -0
  129. package/SVF-doxygen/wiki/svfpic/pathfolder.png +0 -0
  130. package/SVF-doxygen/wiki/svfpic/restart.png +0 -0
  131. package/SVF-doxygen/wiki/svfpic/rundocker.png +0 -0
  132. package/SVF-doxygen/wiki/svfpic/runinCLI.png +0 -0
  133. package/SVF-doxygen/wiki/svfpic/screen.png +0 -0
  134. package/SVF-doxygen/wiki/svfpic/settings1.jpg +0 -0
  135. package/SVF-doxygen/wiki/svfpic/settings2.jpg +0 -0
  136. package/SVF-doxygen/wiki/svfpic/settings3.jpg +0 -0
  137. package/SVF-doxygen/wiki/svfpic/shortlists.png +0 -0
  138. package/SVF-doxygen/wiki/svfpic/start.png +0 -0
  139. package/SVF-doxygen/wiki/svfpic/start1.png +0 -0
  140. package/SVF-doxygen/wiki/svfpic/update0.png +0 -0
  141. package/SVF-doxygen/wiki/svfpic/verify_docker.png +0 -0
  142. package/SVF-doxygen/wiki/svfpic/vs_entry_window.png +0 -0
  143. package/SVF-doxygen/wiki/svfpic/wsl.png +0 -0
  144. package/SVF-doxygen/wiki/svfpic/wsl_1.png +0 -0
  145. package/SVF-doxygen/wiki/svfpic/wsl_2.png +0 -0
  146. package/SVF-doxygen/wiki/svfpic/wsl_3.png +0 -0
  147. package/SVF-doxygen/wiki/tools.png +0 -0
  148. package/SVF-doxygen/wiki/users.png +0 -0
  149. package/SVF-doxygen/wiki/vm1.png +0 -0
  150. package/SVF-doxygen/wiki/vm2.png +0 -0
  151. package/SVF-doxygen/wiki/vm3.png +0 -0
  152. package/SVF-doxygen/wiki/vm4.png +0 -0
  153. package/SVF-doxygen/wiki/vm5.png +0 -0
  154. package/SVF-doxygen/wiki/vscode_build_tasks.png +0 -0
  155. package/SVF-doxygen/wiki/vscode_cpp_extension.png +0 -0
  156. package/SVF-doxygen/wiki/vscode_debug_list.png +0 -0
  157. package/SVF-doxygen/wiki/vscode_dir_structure.png +0 -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.1289",
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,54 @@
1
+ #ifndef PTATY_H
2
+ #define PTATY_H
3
+
4
+ namespace SVF {
5
+
6
+ /// Pointer analysis type list
7
+ enum PTATY
8
+ {
9
+ // Whole program analysis
10
+ Andersen_BASE, ///< Base Andersen PTA
11
+ Andersen_WPA, ///< Andersen PTA
12
+ AndersenSCD_WPA, ///< Selective cycle detection andersen-style WPA
13
+ AndersenSFR_WPA, ///< Stride-based field representation
14
+ AndersenWaveDiff_WPA, ///< Diff wave propagation andersen-style WPA
15
+ Steensgaard_WPA, ///< Steensgaard PTA
16
+ CSCallString_WPA, ///< Call string based context sensitive WPA
17
+ CSSummary_WPA, ///< Summary based context sensitive WPA
18
+ FSDATAFLOW_WPA, ///< Traditional Dataflow-based flow sensitive WPA
19
+ FSSPARSE_WPA, ///< Sparse flow sensitive WPA
20
+ VFS_WPA, ///< Versioned sparse flow-sensitive WPA
21
+ FSCS_WPA, ///< Flow-, context- sensitive WPA
22
+ CFLFICI_WPA, ///< Flow-, context-, insensitive CFL-reachability-based analysis
23
+ CFLFSCI_WPA, ///< Flow-insensitive, context-sensitive CFL-reachability-based analysis
24
+ CFLFSCS_WPA, ///< Flow-, context-, CFL-reachability-based analysis
25
+ TypeCPP_WPA, ///< Type-based analysis for C++
26
+
27
+ // Demand driven analysis
28
+ FieldS_DDA, ///< Field sensitive DDA
29
+ FlowS_DDA, ///< Flow sensitive DDA
30
+ PathS_DDA, ///< Guarded value-flow DDA
31
+ Cxt_DDA, ///< context sensitive DDA
32
+
33
+
34
+ Default_PTA ///< default pta without any analysis
35
+ };
36
+
37
+ /// Implementation type: BVDataPTAImpl or CondPTAImpl.
38
+ enum PTAImplTy
39
+ {
40
+ BaseImpl, ///< Represents PointerAnalaysis.
41
+ BVDataImpl, ///< Represents BVDataPTAImpl.
42
+ CondImpl, ///< Represents CondPTAImpl.
43
+ };
44
+
45
+ /// How the PTData used is implemented.
46
+ enum PTBackingType
47
+ {
48
+ Mutable,
49
+ Persistent,
50
+ };
51
+
52
+ } // namespace SVF
53
+
54
+ #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;