svf-tools 1.0.556 → 1.0.559

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 (202) hide show
  1. package/README.md +2 -2
  2. package/SVF-doxygen/html/html/AndersenPWC_8h_source.html +15 -15
  3. package/SVF-doxygen/html/html/AndersenSCD_8cpp_source.html +12 -11
  4. package/SVF-doxygen/html/html/AndersenSFR_8cpp_source.html +11 -10
  5. package/SVF-doxygen/html/html/AndersenStat_8cpp_source.html +47 -46
  6. package/SVF-doxygen/html/html/AndersenWaveDiff_8cpp_source.html +9 -8
  7. package/SVF-doxygen/html/html/Andersen_8cpp_source.html +35 -34
  8. package/SVF-doxygen/html/html/Andersen_8h_source.html +6 -6
  9. package/SVF-doxygen/html/html/CHGBuilder_8cpp.html +2 -2
  10. package/SVF-doxygen/html/html/CHGBuilder_8cpp_source.html +19 -18
  11. package/SVF-doxygen/html/html/CHGBuilder_8h_source.html +15 -15
  12. package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +4 -4
  13. package/SVF-doxygen/html/html/DDAPass_8cpp_source.html +13 -12
  14. package/SVF-doxygen/html/html/DDAPass_8h_source.html +11 -11
  15. package/SVF-doxygen/html/html/DDAStat_8cpp_source.html +20 -19
  16. package/SVF-doxygen/html/html/DDAStat_8h_source.html +13 -13
  17. package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +2 -2
  18. package/SVF-doxygen/html/html/ExtAPI_8cpp_source.html +5 -2
  19. package/SVF-doxygen/html/html/ExtAPI_8h_source.html +3 -2
  20. package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +3 -3
  21. package/SVF-doxygen/html/html/ICFGStat_8h_source.html +5 -4
  22. package/SVF-doxygen/html/html/LockAnalysis_8cpp_source.html +2 -2
  23. package/SVF-doxygen/html/html/MHP_8cpp_source.html +2 -2
  24. package/SVF-doxygen/html/html/MTAStat_8cpp_source.html +5 -5
  25. package/SVF-doxygen/html/html/MTAStat_8h_source.html +1 -1
  26. package/SVF-doxygen/html/html/MTA_8cpp_source.html +2 -2
  27. package/SVF-doxygen/html/html/MemSSA_8cpp_source.html +2 -2
  28. package/SVF-doxygen/html/html/NodeIDAllocator_8cpp_source.html +2 -2
  29. package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +67 -69
  30. package/SVF-doxygen/html/html/PTAStat_8h.html +1 -0
  31. package/SVF-doxygen/html/html/PTAStat_8h_source.html +70 -76
  32. package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +2 -2
  33. package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +1 -1
  34. package/SVF-doxygen/html/html/PointsTo_8cpp_source.html +2 -1
  35. package/SVF-doxygen/html/html/SVFGReadWrite_8cpp_source.html +5 -4
  36. package/SVF-doxygen/html/html/SVFGStat_8cpp_source.html +22 -21
  37. package/SVF-doxygen/html/html/SVFGStat_8h_source.html +5 -5
  38. package/SVF-doxygen/html/html/SVFG_8cpp_source.html +5 -5
  39. package/SVF-doxygen/html/html/SVFG_8h_source.html +3 -3
  40. package/SVF-doxygen/html/html/SVFStat_8cpp.html +81 -0
  41. package/SVF-doxygen/html/html/SVFStat_8cpp_source.html +85 -0
  42. package/SVF-doxygen/html/html/SVFStat_8h.html +94 -0
  43. package/SVF-doxygen/html/html/SVFStat_8h_source.html +103 -0
  44. package/SVF-doxygen/html/html/SVFUtil_8h_source.html +1 -1
  45. package/SVF-doxygen/html/html/Steensgaard_8h_source.html +1 -1
  46. package/SVF-doxygen/html/html/TypeAnalysis_8cpp_source.html +2 -2
  47. package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +3 -3
  48. package/SVF-doxygen/html/html/VersionedFlowSensitive_8cpp_source.html +2 -2
  49. package/SVF-doxygen/html/html/WPAStat_8h_source.html +8 -8
  50. package/SVF-doxygen/html/html/annotated.html +39 -38
  51. package/SVF-doxygen/html/html/classSVF_1_1Andersen.html +79 -79
  52. package/SVF-doxygen/html/html/classSVF_1_1AndersenBase.html +15 -15
  53. package/SVF-doxygen/html/html/classSVF_1_1AndersenSCD.html +37 -37
  54. package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR-members.html +1 -1
  55. package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +22 -22
  56. package/SVF-doxygen/html/html/classSVF_1_1AndersenStat-members.html +24 -22
  57. package/SVF-doxygen/html/html/classSVF_1_1AndersenStat.html +97 -86
  58. package/SVF-doxygen/html/html/classSVF_1_1AndersenStat.png +0 -0
  59. package/SVF-doxygen/html/html/classSVF_1_1AndersenWaveDiff.html +24 -24
  60. package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +47 -47
  61. package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +4 -4
  62. package/SVF-doxygen/html/html/classSVF_1_1DDAPass.html +30 -30
  63. package/SVF-doxygen/html/html/classSVF_1_1DDAStat-members.html +24 -23
  64. package/SVF-doxygen/html/html/classSVF_1_1DDAStat.html +80 -67
  65. package/SVF-doxygen/html/html/classSVF_1_1DDAStat.png +0 -0
  66. package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +4 -4
  67. package/SVF-doxygen/html/html/classSVF_1_1ExtAPI-members.html +5 -4
  68. package/SVF-doxygen/html/html/classSVF_1_1ExtAPI.html +40 -5
  69. package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +4 -4
  70. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +26 -26
  71. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat-members.html +24 -22
  72. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +67 -56
  73. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.png +0 -0
  74. package/SVF-doxygen/html/html/classSVF_1_1ICFGStat-members.html +23 -21
  75. package/SVF-doxygen/html/html/classSVF_1_1ICFGStat.html +55 -42
  76. package/SVF-doxygen/html/html/classSVF_1_1ICFGStat.png +0 -0
  77. package/SVF-doxygen/html/html/classSVF_1_1LockAnalysis.html +6 -6
  78. package/SVF-doxygen/html/html/classSVF_1_1MHP.html +4 -4
  79. package/SVF-doxygen/html/html/classSVF_1_1MTA.html +2 -2
  80. package/SVF-doxygen/html/html/classSVF_1_1MTAStat-members.html +25 -23
  81. package/SVF-doxygen/html/html/classSVF_1_1MTAStat.html +59 -48
  82. package/SVF-doxygen/html/html/classSVF_1_1MTAStat.png +0 -0
  83. package/SVF-doxygen/html/html/classSVF_1_1MemSSA.html +5 -5
  84. package/SVF-doxygen/html/html/classSVF_1_1MemSSAStat-members.html +22 -21
  85. package/SVF-doxygen/html/html/classSVF_1_1MemSSAStat.html +57 -44
  86. package/SVF-doxygen/html/html/classSVF_1_1MemSSAStat.png +0 -0
  87. package/SVF-doxygen/html/html/classSVF_1_1NodeIDAllocator_1_1Clusterer.html +6 -6
  88. package/SVF-doxygen/html/html/classSVF_1_1Options.html +2 -2
  89. package/SVF-doxygen/html/html/classSVF_1_1PTAStat-members.html +24 -22
  90. package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +186 -420
  91. package/SVF-doxygen/html/html/classSVF_1_1PTAStat.png +0 -0
  92. package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +2 -2
  93. package/SVF-doxygen/html/html/classSVF_1_1SVFG.html +12 -12
  94. package/SVF-doxygen/html/html/classSVF_1_1SVFGStat-members.html +33 -32
  95. package/SVF-doxygen/html/html/classSVF_1_1SVFGStat.html +100 -87
  96. package/SVF-doxygen/html/html/classSVF_1_1SVFGStat.png +0 -0
  97. package/SVF-doxygen/html/html/classSVF_1_1SVFStat-members.html +100 -0
  98. package/SVF-doxygen/html/html/classSVF_1_1SVFStat.html +605 -0
  99. package/SVF-doxygen/html/html/classSVF_1_1SVFStat.png +0 -0
  100. package/SVF-doxygen/html/html/classSVF_1_1Steensgaard.html +1 -1
  101. package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis.html +4 -4
  102. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive.html +12 -12
  103. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat-members.html +26 -24
  104. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +65 -54
  105. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.png +0 -0
  106. package/SVF-doxygen/html/html/classes.html +50 -50
  107. package/SVF-doxygen/html/html/dda_8cpp.html +1 -1
  108. package/SVF-doxygen/html/html/dda_8cpp_source.html +1 -1
  109. package/SVF-doxygen/html/html/dir_862d3276083eaac55caed79b9120bf29.html +2 -0
  110. package/SVF-doxygen/html/html/dir_95e22971b5dbae2382075a3453e365b4.html +2 -0
  111. package/SVF-doxygen/html/html/files.html +10 -8
  112. package/SVF-doxygen/html/html/functions_0x7e.html +3 -0
  113. package/SVF-doxygen/html/html/functions_c.html +28 -29
  114. package/SVF-doxygen/html/html/functions_e.html +3 -2
  115. package/SVF-doxygen/html/html/functions_enum.html +1 -1
  116. package/SVF-doxygen/html/html/functions_eval_c.html +1 -1
  117. package/SVF-doxygen/html/html/functions_eval_w.html +1 -1
  118. package/SVF-doxygen/html/html/functions_func_0x7e.html +3 -0
  119. package/SVF-doxygen/html/html/functions_func_c.html +28 -27
  120. package/SVF-doxygen/html/html/functions_func_e.html +1 -1
  121. package/SVF-doxygen/html/html/functions_func_g.html +1 -1
  122. package/SVF-doxygen/html/html/functions_func_i.html +11 -8
  123. package/SVF-doxygen/html/html/functions_func_p.html +9 -7
  124. package/SVF-doxygen/html/html/functions_func_s.html +15 -12
  125. package/SVF-doxygen/html/html/functions_g.html +2 -2
  126. package/SVF-doxygen/html/html/functions_i.html +8 -5
  127. package/SVF-doxygen/html/html/functions_l.html +3 -3
  128. package/SVF-doxygen/html/html/functions_m.html +2 -1
  129. package/SVF-doxygen/html/html/functions_n.html +1 -1
  130. package/SVF-doxygen/html/html/functions_p.html +17 -13
  131. package/SVF-doxygen/html/html/functions_r.html +7 -3
  132. package/SVF-doxygen/html/html/functions_s.html +23 -21
  133. package/SVF-doxygen/html/html/functions_t.html +6 -6
  134. package/SVF-doxygen/html/html/functions_type_n.html +1 -1
  135. package/SVF-doxygen/html/html/functions_type_s.html +1 -1
  136. package/SVF-doxygen/html/html/functions_type_t.html +1 -1
  137. package/SVF-doxygen/html/html/functions_v.html +3 -3
  138. package/SVF-doxygen/html/html/functions_vars_e.html +1 -0
  139. package/SVF-doxygen/html/html/functions_vars_g.html +1 -1
  140. package/SVF-doxygen/html/html/functions_vars_m.html +1 -0
  141. package/SVF-doxygen/html/html/functions_vars_s.html +1 -0
  142. package/SVF-doxygen/html/html/functions_vars_t.html +1 -1
  143. package/SVF-doxygen/html/html/functions_w.html +1 -1
  144. package/SVF-doxygen/html/html/hierarchy.html +47 -46
  145. package/SVF-doxygen/html/html/namespaceSVF.html +2 -0
  146. package/SVF-doxygen/html/html/search/all_10.js +8 -8
  147. package/SVF-doxygen/html/html/search/all_11.js +2 -2
  148. package/SVF-doxygen/html/html/search/all_12.js +13 -10
  149. package/SVF-doxygen/html/html/search/all_13.js +4 -4
  150. package/SVF-doxygen/html/html/search/all_14.js +1 -1
  151. package/SVF-doxygen/html/html/search/all_15.js +2 -2
  152. package/SVF-doxygen/html/html/search/all_16.js +1 -1
  153. package/SVF-doxygen/html/html/search/all_19.js +1 -0
  154. package/SVF-doxygen/html/html/search/all_3.js +3 -3
  155. package/SVF-doxygen/html/html/search/all_5.js +2 -2
  156. package/SVF-doxygen/html/html/search/all_7.js +2 -2
  157. package/SVF-doxygen/html/html/search/all_9.js +1 -0
  158. package/SVF-doxygen/html/html/search/all_c.js +1 -1
  159. package/SVF-doxygen/html/html/search/all_d.js +1 -1
  160. package/SVF-doxygen/html/html/search/all_e.js +2 -2
  161. package/SVF-doxygen/html/html/search/all_f.js +1 -1
  162. package/SVF-doxygen/html/html/search/classes_f.js +1 -0
  163. package/SVF-doxygen/html/html/search/enums_1.js +1 -1
  164. package/SVF-doxygen/html/html/search/enumvalues_13.js +1 -1
  165. package/SVF-doxygen/html/html/search/enumvalues_2.js +1 -1
  166. package/SVF-doxygen/html/html/search/files_d.js +2 -0
  167. package/SVF-doxygen/html/html/search/functions_11.js +3 -2
  168. package/SVF-doxygen/html/html/search/functions_17.js +1 -0
  169. package/SVF-doxygen/html/html/search/functions_2.js +1 -1
  170. package/SVF-doxygen/html/html/search/functions_4.js +1 -1
  171. package/SVF-doxygen/html/html/search/functions_6.js +1 -1
  172. package/SVF-doxygen/html/html/search/functions_8.js +1 -0
  173. package/SVF-doxygen/html/html/search/functions_f.js +4 -4
  174. package/SVF-doxygen/html/html/search/typedefs_10.js +1 -1
  175. package/SVF-doxygen/html/html/search/typedefs_11.js +1 -1
  176. package/SVF-doxygen/html/html/search/typedefs_c.js +1 -1
  177. package/SVF-doxygen/html/html/search/variables_12.js +1 -1
  178. package/SVF-doxygen/html/html/search/variables_13.js +2 -2
  179. package/SVF-doxygen/html/html/search/variables_14.js +1 -1
  180. package/SVF-doxygen/html/html/search/variables_5.js +1 -1
  181. package/SVF-doxygen/html/html/search/variables_7.js +1 -1
  182. package/SVF-doxygen/html/html/search/variables_d.js +1 -1
  183. package/include/Graphs/ICFGStat.h +1 -1
  184. package/include/Util/ExtAPI.h +3 -0
  185. package/include/Util/ExtAPI.json +1456 -44
  186. package/include/Util/PTAStat.h +6 -36
  187. package/include/Util/SVFStat.h +95 -0
  188. package/include/WPA/AndersenPWC.h +1 -1
  189. package/lib/DDA/DDAPass.cpp +1 -0
  190. package/lib/DDA/DDAStat.cpp +1 -0
  191. package/lib/Graphs/SVFGReadWrite.cpp +1 -0
  192. package/lib/Graphs/SVFGStat.cpp +1 -0
  193. package/lib/SVF-FE/CHGBuilder.cpp +1 -0
  194. package/lib/Util/ExtAPI.cpp +42 -4
  195. package/lib/Util/PTAStat.cpp +2 -21
  196. package/lib/Util/SVFStat.cpp +58 -0
  197. package/lib/WPA/Andersen.cpp +1 -0
  198. package/lib/WPA/AndersenSCD.cpp +1 -0
  199. package/lib/WPA/AndersenSFR.cpp +1 -0
  200. package/lib/WPA/AndersenStat.cpp +1 -0
  201. package/lib/WPA/AndersenWaveDiff.cpp +1 -0
  202. package/package.json +1 -1
@@ -21,7 +21,7 @@
21
21
  //===----------------------------------------------------------------------===//
22
22
 
23
23
  /*
24
- * AndersenStat.h
24
+ * PTAStat.h
25
25
  *
26
26
  * Created on: Oct 12, 2013
27
27
  * Author: Yulei Sui
@@ -32,12 +32,11 @@
32
32
 
33
33
  #include "Util/BasicTypes.h"
34
34
  #include "MemoryModel/PointsTo.h"
35
+ #include "Util/SVFStat.h"
35
36
  #include <iostream>
36
37
  #include <map>
37
38
  #include <string>
38
39
 
39
- using namespace std;
40
-
41
40
  namespace SVF
42
41
  {
43
42
 
@@ -46,7 +45,7 @@ class PointerAnalysis;
46
45
  /*!
47
46
  * Pointer Analysis Statistics
48
47
  */
49
- class PTAStat
48
+ class PTAStat: public SVFStat
50
49
  {
51
50
  public:
52
51
  static const char* TotalAnalysisTime; ///< Total analysis time
@@ -118,49 +117,20 @@ public:
118
117
 
119
118
  static const char* NumOfNullPointer; ///< Number of pointers points-to null
120
119
 
121
- typedef Map<const char*,u32_t> NUMStatMap;
122
-
123
- typedef Map<const char*,double> TIMEStatMap;
124
-
125
- enum ClockType
126
- {
127
- Wall,
128
- CPU,
129
- };
130
-
131
120
  PTAStat(PointerAnalysis* p);
132
121
  virtual ~PTAStat() {}
133
122
 
134
- virtual inline void startClk()
135
- {
136
- startTime = getClk(true);
137
- }
138
- virtual inline void endClk()
139
- {
140
- endTime = getClk(true);
141
- }
142
- /// When mark is true, real clock is always returned. When mark is false, it is
143
- /// only returned when Options::MarkedClocksOnly is not set.
144
- /// Default call for getClk is unmarked, while MarkedClocksOnly is false by default.
145
- static double getClk(bool mark=false);
146
-
147
- NUMStatMap generalNumMap;
148
123
  NUMStatMap PTNumStatMap;
149
- TIMEStatMap timeStatMap;
150
124
  NodeBS localVarInRecursion;
151
125
 
152
126
  double startTime;
153
127
  double endTime;
154
128
 
155
- virtual void performStat();
156
-
157
- virtual void printStat(string str = "");
158
-
159
- virtual void performStatPerQuery(NodeID) {}
129
+ void performStat() override;
160
130
 
161
- virtual void printStatPerQuery(NodeID, const PointsTo&) {}
131
+ virtual void printStat(std::string str = "") override;
162
132
 
163
- virtual void callgraphStat();
133
+ void callgraphStat() override;
164
134
  private:
165
135
  void bitcastInstStat();
166
136
  void branchStat();
@@ -0,0 +1,95 @@
1
+ //===- SVFStat.h -- Base class for statistics---------------------------------//
2
+ //
3
+ // SVF: Static Value-Flow Analysis
4
+ //
5
+ // Copyright (C) <2013-2017> <Yulei Sui>
6
+ //
7
+
8
+ // This program is free software: you can redistribute it and/or modify
9
+ // it under the terms of the GNU General Public License as published by
10
+ // the Free Software Foundation, either version 3 of the License, or
11
+ // (at your option) any later version.
12
+
13
+ // This program is distributed in the hope that it will be useful,
14
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ // GNU General Public License for more details.
17
+
18
+ // You should have received a copy of the GNU General Public License
19
+ // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ //
21
+ //===----------------------------------------------------------------------===//
22
+
23
+ /*
24
+ * SVFStat.h
25
+ *
26
+ * Created on: Sep 1, 2022
27
+ * Author: Xiao Cheng
28
+ */
29
+
30
+ #ifndef SVF_SVFSTAT_H
31
+ #define SVF_SVFSTAT_H
32
+
33
+ namespace SVF
34
+ {
35
+
36
+
37
+ /*!
38
+ * Pointer Analysis Statistics
39
+ */
40
+ class SVFStat
41
+ {
42
+ public:
43
+
44
+ typedef OrderedMap<const char *, u32_t> NUMStatMap;
45
+
46
+ typedef OrderedMap<const char *, double> TIMEStatMap;
47
+
48
+ enum ClockType
49
+ {
50
+ Wall,
51
+ CPU,
52
+ };
53
+
54
+ SVFStat();
55
+
56
+ virtual ~SVFStat() {}
57
+
58
+ virtual inline void startClk()
59
+ {
60
+ startTime = getClk(true);
61
+ }
62
+
63
+ virtual inline void endClk()
64
+ {
65
+ endTime = getClk(true);
66
+ }
67
+
68
+ /// When mark is true, real clock is always returned. When mark is false, it is
69
+ /// only returned when Options::MarkedClocksOnly is not set.
70
+ /// Default call for getClk is unmarked, while MarkedClocksOnly is false by default.
71
+ static double getClk(bool mark = false);
72
+
73
+ NUMStatMap generalNumMap;
74
+ TIMEStatMap timeStatMap;
75
+
76
+ double startTime;
77
+ double endTime;
78
+
79
+ virtual void performStat() = 0;
80
+
81
+ virtual void printStat(std::string str = "") = 0;
82
+
83
+ virtual void performStatPerQuery(NodeID) {}
84
+
85
+ virtual void printStatPerQuery(NodeID, const PointsTo &) {}
86
+
87
+ virtual void callgraphStat() {}
88
+
89
+ private:
90
+
91
+ std::string moduleName;
92
+ }; // End class SVFStat
93
+
94
+ } // End namespace SVF
95
+ #endif //SVF_SVFSTAT_H
@@ -104,7 +104,7 @@ class AndersenSFR : public AndersenSCD
104
104
  public:
105
105
  typedef Map<NodeID, NodeBS> NodeStrides;
106
106
  typedef Map<NodeID, NodeSet> FieldReps;
107
- typedef Map<NodeID, pair<NodeID, NodeSet>> SFRTrait;
107
+ typedef Map<NodeID, std::pair<NodeID, NodeSet>> SFRTrait;
108
108
 
109
109
  private:
110
110
  static AndersenSFR* sfrAndersen;
@@ -18,6 +18,7 @@
18
18
 
19
19
  using namespace SVF;
20
20
  using namespace SVFUtil;
21
+ using namespace std;
21
22
 
22
23
  char DDAPass::ID = 0;
23
24
 
@@ -15,6 +15,7 @@
15
15
 
16
16
  using namespace SVF;
17
17
  using namespace SVFUtil;
18
+ using namespace std;
18
19
 
19
20
  DDAStat::DDAStat(FlowDDA* pta) : PTAStat(pta), flowDDA(pta), contextDDA(nullptr)
20
21
  {
@@ -37,6 +37,7 @@
37
37
 
38
38
  using namespace SVF;
39
39
  using namespace SVFUtil;
40
+ using namespace std;
40
41
 
41
42
  // Format of file
42
43
  // __Nodes__
@@ -32,6 +32,7 @@
32
32
  #include "Graphs/PTACallGraph.h"
33
33
 
34
34
  using namespace SVF;
35
+ using namespace std;
35
36
 
36
37
  const char* MemSSAStat::TotalTimeOfConstructMemSSA = "TotalMSSATime"; ///< Total time for constructing memory SSA
37
38
  const char* MemSSAStat::TimeOfGeneratingMemRegions = "GenRegionTime"; ///< Time for allocating regions
@@ -49,6 +49,7 @@ using namespace SVF;
49
49
  using namespace SVFUtil;
50
50
  using namespace cppUtil;
51
51
  using namespace LLVMUtil;
52
+ using namespace std;
52
53
 
53
54
  const string pureVirtualFunName = "__cxa_pure_virtual";
54
55
 
@@ -307,7 +307,7 @@ std::vector<ExtAPI::Operation> ExtAPI::getAllOperations(std::string funName)
307
307
  {
308
308
  cJSON *obj = item->child;
309
309
  // Get the first operation of the function
310
- obj = obj -> next -> next;
310
+ obj = obj -> next -> next -> next -> next;
311
311
  std::vector<ExtAPI::Operation *> operations;
312
312
  while (obj)
313
313
  {
@@ -358,7 +358,7 @@ ExtAPI::extType ExtAPI::get_type(const std::string& funName)
358
358
  if (item != nullptr)
359
359
  {
360
360
  // Get the first operation of the function
361
- cJSON *obj = item->child;
361
+ cJSON *obj = item->child->next->next;
362
362
  if (strcmp(obj->string, JSON_OPT_FUNCTIONTYPE) == 0)
363
363
  type = obj->valuestring;
364
364
  else
@@ -387,7 +387,7 @@ u32_t ExtAPI::isOverwrittenAppFunction(const SVF::SVFFunction *callee)
387
387
  if (item != nullptr)
388
388
  {
389
389
  cJSON *obj = item->child;
390
- obj = obj->next;
390
+ obj = obj->next->next->next;
391
391
  if (strcmp(obj->string, JSON_OPT_OVERWRITE) == 0)
392
392
  return obj->valueint;
393
393
  else
@@ -473,6 +473,42 @@ bool ExtAPI::is_realloc(const SVFFunction *F)
473
473
  return t == EFT_REALLOC;
474
474
  }
475
475
 
476
+ // Does (F) have the same return type(pointer or nonpointer) and same number of arguments
477
+ bool ExtAPI::is_sameSignature(const SVFFunction *F)
478
+ {
479
+ cJSON *item = get_FunJson(F->getName());
480
+ // If return type is pointer
481
+ bool isPointer = false;
482
+ // The number of arguments
483
+ u32_t argNum = 0;
484
+ if (item != nullptr)
485
+ {
486
+ // Get the "return" attribute
487
+ cJSON *obj = item->child;
488
+ if (strlen(obj->valuestring) == 0) // e.g. "return": ""
489
+ assert(false && "'return' should not be empty!");
490
+ // If "return": "..." includes "*", the return type of extern function is a pointer
491
+ if (strstr(obj->valuestring, "*") != NULL)
492
+ isPointer = true;
493
+ // Get the "arguments" attribute
494
+ obj = obj -> next;
495
+ if (strlen(obj->valuestring) == 0) // e.g. "arguments": "",
496
+ assert(false && "'arguments' should not be empty!");
497
+ // If "arguments": "()", the number of arguments is 0, otherwise, number >= 1;
498
+ if (strcmp(obj->valuestring, "()") != 0)
499
+ {
500
+ argNum++;
501
+ for (u32_t i = 0; i < strlen(obj->valuestring); i++)
502
+ if (obj->valuestring[i] == ',') // Calculate the number of arguments based on the number of ","
503
+ argNum++;
504
+ }
505
+ }
506
+ if (F->arg_size() != argNum) // The number of arguments is different
507
+ return false;
508
+ // Is the return type the same?
509
+ return F->getLLVMFun()->getReturnType()->isPointerTy() == isPointer;
510
+ }
511
+
476
512
  // Should (F) be considered "external" (either not defined in the program
477
513
  // or a user-defined version of a known alloc or no-op)?
478
514
  bool ExtAPI::is_ext(const SVFFunction *F)
@@ -489,9 +525,11 @@ bool ExtAPI::is_ext(const SVFFunction *F)
489
525
  if (t != EFT_NULL)
490
526
  {
491
527
  u32_t overwrittenAppFunction = isOverwrittenAppFunction(F);
528
+ if (!is_sameSignature(F))
529
+ res = 0;
492
530
  // overwrittenAppFunction = 1: Execute function specification in ExtAPI.json
493
531
  // F is considered as external function
494
- if (overwrittenAppFunction == 1)
532
+ else if (overwrittenAppFunction == 1)
495
533
  res = 1;
496
534
  // overwrittenAppFunction = 0: Execute user-defined functions
497
535
  // F is not considered as external function
@@ -35,6 +35,7 @@
35
35
  #include "Util/Options.h"
36
36
 
37
37
  using namespace SVF;
38
+ using namespace std;
38
39
 
39
40
  const char* PTAStat:: TotalAnalysisTime = "TotalTime"; ///< SVFIR value nodes ??
40
41
  const char* PTAStat:: SCCDetectionTime = "SCCDetectTime"; ///< Total SCC detection time
@@ -105,29 +106,9 @@ const char* PTAStat:: MaxNumOfNodesInSCC = "MaxNodesInSCC"; ///< max Number of n
105
106
 
106
107
  const char* PTAStat:: NumOfNullPointer = "NullPointer"; ///< Number of pointers points-to null
107
108
 
108
- PTAStat::PTAStat(PointerAnalysis* p) : startTime(0), endTime(0), pta(p)
109
+ PTAStat::PTAStat(PointerAnalysis* p) : SVFStat(), startTime(0), endTime(0), pta(p)
109
110
  {
110
- assert((Options::ClockType == ClockType::Wall || Options::ClockType == ClockType::CPU)
111
- && "PTAStat: unknown clock type!");
112
- }
113
-
114
- double PTAStat::getClk(bool mark)
115
- {
116
- if (Options::MarkedClocksOnly && !mark) return 0.0;
117
-
118
- if (Options::ClockType == ClockType::Wall)
119
- {
120
- struct timespec time;
121
- clock_gettime(CLOCK_MONOTONIC, &time);
122
- return (double)(time.tv_nsec + time.tv_sec * 1000000000) / 1000000.0;
123
- }
124
- else if (Options::ClockType == ClockType::CPU)
125
- {
126
- return CLOCK_IN_MS();
127
- }
128
111
 
129
- assert(false && "PTAStat::getClk: unknown clock type");
130
- abort();
131
112
  }
132
113
 
133
114
  void PTAStat::performStat()
@@ -0,0 +1,58 @@
1
+ //===- SVFStat.cpp -- Base class for statistics---------------------------------//
2
+ //
3
+ // SVF: Static Value-Flow Analysis
4
+ //
5
+ // Copyright (C) <2013-2017> <Yulei Sui>
6
+ //
7
+
8
+ // This program is free software: you can redistribute it and/or modify
9
+ // it under the terms of the GNU General Public License as published by
10
+ // the Free Software Foundation, either version 3 of the License, or
11
+ // (at your option) any later version.
12
+
13
+ // This program is distributed in the hope that it will be useful,
14
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ // GNU General Public License for more details.
17
+
18
+ // You should have received a copy of the GNU General Public License
19
+ // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ //
21
+ //===----------------------------------------------------------------------===//
22
+
23
+ /*
24
+ * SVFStat.cpp
25
+ *
26
+ * Created on: Sep 1, 2022
27
+ * Author: Xiao Cheng
28
+ */
29
+
30
+ #include "Util/Options.h"
31
+ #include "Util/SVFStat.h"
32
+
33
+ using namespace SVF;
34
+
35
+ SVFStat::SVFStat() : startTime(0), endTime(0)
36
+ {
37
+ assert((Options::ClockType == ClockType::Wall || Options::ClockType == ClockType::CPU)
38
+ && "PTAStat: unknown clock type!");
39
+ }
40
+
41
+ double SVFStat::getClk(bool mark)
42
+ {
43
+ if (Options::MarkedClocksOnly && !mark) return 0.0;
44
+
45
+ if (Options::ClockType == ClockType::Wall)
46
+ {
47
+ struct timespec time;
48
+ clock_gettime(CLOCK_MONOTONIC, &time);
49
+ return (double)(time.tv_nsec + time.tv_sec * 1000000000) / 1000000.0;
50
+ }
51
+ else if (Options::ClockType == ClockType::CPU)
52
+ {
53
+ return CLOCK_IN_MS();
54
+ }
55
+
56
+ assert(false && "PTAStat::getClk: unknown clock type");
57
+ abort();
58
+ }
@@ -36,6 +36,7 @@
36
36
 
37
37
  using namespace SVF;
38
38
  using namespace SVFUtil;
39
+ using namespace std;
39
40
 
40
41
 
41
42
  u32_t AndersenBase::numOfProcessedAddr = 0;
@@ -33,6 +33,7 @@
33
33
 
34
34
  using namespace SVF;
35
35
  using namespace SVFUtil;
36
+ using namespace std;
36
37
 
37
38
  AndersenSCD* AndersenSCD::scdAndersen = nullptr;
38
39
 
@@ -32,6 +32,7 @@
32
32
 
33
33
  using namespace SVF;
34
34
  using namespace SVFUtil;
35
+ using namespace std;
35
36
 
36
37
  AndersenSFR *AndersenSFR::sfrAndersen = nullptr;
37
38
 
@@ -33,6 +33,7 @@
33
33
 
34
34
  using namespace SVF;
35
35
  using namespace SVFUtil;
36
+ using namespace std;
36
37
 
37
38
  u32_t AndersenStat::_MaxPtsSize = 0;
38
39
  u32_t AndersenStat::_NumOfCycles = 0;
@@ -32,6 +32,7 @@
32
32
 
33
33
  using namespace SVF;
34
34
  using namespace SVFUtil;
35
+ using namespace std;
35
36
 
36
37
  AndersenWaveDiff* AndersenWaveDiff::diffWave = nullptr;
37
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.556",
3
+ "version": "1.0.559",
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": {