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.
- package/README.md +2 -2
- package/SVF-doxygen/html/html/AndersenPWC_8h_source.html +15 -15
- package/SVF-doxygen/html/html/AndersenSCD_8cpp_source.html +12 -11
- package/SVF-doxygen/html/html/AndersenSFR_8cpp_source.html +11 -10
- package/SVF-doxygen/html/html/AndersenStat_8cpp_source.html +47 -46
- package/SVF-doxygen/html/html/AndersenWaveDiff_8cpp_source.html +9 -8
- package/SVF-doxygen/html/html/Andersen_8cpp_source.html +35 -34
- package/SVF-doxygen/html/html/Andersen_8h_source.html +6 -6
- package/SVF-doxygen/html/html/CHGBuilder_8cpp.html +2 -2
- package/SVF-doxygen/html/html/CHGBuilder_8cpp_source.html +19 -18
- package/SVF-doxygen/html/html/CHGBuilder_8h_source.html +15 -15
- package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/DDAPass_8cpp_source.html +13 -12
- package/SVF-doxygen/html/html/DDAPass_8h_source.html +11 -11
- package/SVF-doxygen/html/html/DDAStat_8cpp_source.html +20 -19
- package/SVF-doxygen/html/html/DDAStat_8h_source.html +13 -13
- package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +2 -2
- package/SVF-doxygen/html/html/ExtAPI_8cpp_source.html +5 -2
- package/SVF-doxygen/html/html/ExtAPI_8h_source.html +3 -2
- package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/ICFGStat_8h_source.html +5 -4
- package/SVF-doxygen/html/html/LockAnalysis_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/MHP_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/MTAStat_8cpp_source.html +5 -5
- package/SVF-doxygen/html/html/MTAStat_8h_source.html +1 -1
- package/SVF-doxygen/html/html/MTA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/MemSSA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/NodeIDAllocator_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +67 -69
- package/SVF-doxygen/html/html/PTAStat_8h.html +1 -0
- package/SVF-doxygen/html/html/PTAStat_8h_source.html +70 -76
- package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +1 -1
- package/SVF-doxygen/html/html/PointsTo_8cpp_source.html +2 -1
- package/SVF-doxygen/html/html/SVFGReadWrite_8cpp_source.html +5 -4
- package/SVF-doxygen/html/html/SVFGStat_8cpp_source.html +22 -21
- package/SVF-doxygen/html/html/SVFGStat_8h_source.html +5 -5
- package/SVF-doxygen/html/html/SVFG_8cpp_source.html +5 -5
- package/SVF-doxygen/html/html/SVFG_8h_source.html +3 -3
- package/SVF-doxygen/html/html/SVFStat_8cpp.html +81 -0
- package/SVF-doxygen/html/html/SVFStat_8cpp_source.html +85 -0
- package/SVF-doxygen/html/html/SVFStat_8h.html +94 -0
- package/SVF-doxygen/html/html/SVFStat_8h_source.html +103 -0
- package/SVF-doxygen/html/html/SVFUtil_8h_source.html +1 -1
- package/SVF-doxygen/html/html/Steensgaard_8h_source.html +1 -1
- package/SVF-doxygen/html/html/TypeAnalysis_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/VersionedFlowSensitive_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/WPAStat_8h_source.html +8 -8
- package/SVF-doxygen/html/html/annotated.html +39 -38
- package/SVF-doxygen/html/html/classSVF_1_1Andersen.html +79 -79
- package/SVF-doxygen/html/html/classSVF_1_1AndersenBase.html +15 -15
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSCD.html +37 -37
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +22 -22
- package/SVF-doxygen/html/html/classSVF_1_1AndersenStat-members.html +24 -22
- package/SVF-doxygen/html/html/classSVF_1_1AndersenStat.html +97 -86
- package/SVF-doxygen/html/html/classSVF_1_1AndersenStat.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1AndersenWaveDiff.html +24 -24
- package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +47 -47
- package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1DDAPass.html +30 -30
- package/SVF-doxygen/html/html/classSVF_1_1DDAStat-members.html +24 -23
- package/SVF-doxygen/html/html/classSVF_1_1DDAStat.html +80 -67
- package/SVF-doxygen/html/html/classSVF_1_1DDAStat.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1ExtAPI-members.html +5 -4
- package/SVF-doxygen/html/html/classSVF_1_1ExtAPI.html +40 -5
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +26 -26
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat-members.html +24 -22
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +67 -56
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1ICFGStat-members.html +23 -21
- package/SVF-doxygen/html/html/classSVF_1_1ICFGStat.html +55 -42
- package/SVF-doxygen/html/html/classSVF_1_1ICFGStat.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1LockAnalysis.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1MHP.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1MTA.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1MTAStat-members.html +25 -23
- package/SVF-doxygen/html/html/classSVF_1_1MTAStat.html +59 -48
- package/SVF-doxygen/html/html/classSVF_1_1MTAStat.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1MemSSA.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1MemSSAStat-members.html +22 -21
- package/SVF-doxygen/html/html/classSVF_1_1MemSSAStat.html +57 -44
- package/SVF-doxygen/html/html/classSVF_1_1MemSSAStat.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1NodeIDAllocator_1_1Clusterer.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1Options.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1PTAStat-members.html +24 -22
- package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +186 -420
- package/SVF-doxygen/html/html/classSVF_1_1PTAStat.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1SVFG.html +12 -12
- package/SVF-doxygen/html/html/classSVF_1_1SVFGStat-members.html +33 -32
- package/SVF-doxygen/html/html/classSVF_1_1SVFGStat.html +100 -87
- package/SVF-doxygen/html/html/classSVF_1_1SVFGStat.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1SVFStat-members.html +100 -0
- package/SVF-doxygen/html/html/classSVF_1_1SVFStat.html +605 -0
- package/SVF-doxygen/html/html/classSVF_1_1SVFStat.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1Steensgaard.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive.html +12 -12
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat-members.html +26 -24
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +65 -54
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.png +0 -0
- package/SVF-doxygen/html/html/classes.html +50 -50
- package/SVF-doxygen/html/html/dda_8cpp.html +1 -1
- package/SVF-doxygen/html/html/dda_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/dir_862d3276083eaac55caed79b9120bf29.html +2 -0
- package/SVF-doxygen/html/html/dir_95e22971b5dbae2382075a3453e365b4.html +2 -0
- package/SVF-doxygen/html/html/files.html +10 -8
- package/SVF-doxygen/html/html/functions_0x7e.html +3 -0
- package/SVF-doxygen/html/html/functions_c.html +28 -29
- package/SVF-doxygen/html/html/functions_e.html +3 -2
- package/SVF-doxygen/html/html/functions_enum.html +1 -1
- package/SVF-doxygen/html/html/functions_eval_c.html +1 -1
- package/SVF-doxygen/html/html/functions_eval_w.html +1 -1
- package/SVF-doxygen/html/html/functions_func_0x7e.html +3 -0
- package/SVF-doxygen/html/html/functions_func_c.html +28 -27
- package/SVF-doxygen/html/html/functions_func_e.html +1 -1
- package/SVF-doxygen/html/html/functions_func_g.html +1 -1
- package/SVF-doxygen/html/html/functions_func_i.html +11 -8
- package/SVF-doxygen/html/html/functions_func_p.html +9 -7
- package/SVF-doxygen/html/html/functions_func_s.html +15 -12
- package/SVF-doxygen/html/html/functions_g.html +2 -2
- package/SVF-doxygen/html/html/functions_i.html +8 -5
- package/SVF-doxygen/html/html/functions_l.html +3 -3
- package/SVF-doxygen/html/html/functions_m.html +2 -1
- package/SVF-doxygen/html/html/functions_n.html +1 -1
- package/SVF-doxygen/html/html/functions_p.html +17 -13
- package/SVF-doxygen/html/html/functions_r.html +7 -3
- package/SVF-doxygen/html/html/functions_s.html +23 -21
- package/SVF-doxygen/html/html/functions_t.html +6 -6
- package/SVF-doxygen/html/html/functions_type_n.html +1 -1
- package/SVF-doxygen/html/html/functions_type_s.html +1 -1
- package/SVF-doxygen/html/html/functions_type_t.html +1 -1
- package/SVF-doxygen/html/html/functions_v.html +3 -3
- package/SVF-doxygen/html/html/functions_vars_e.html +1 -0
- package/SVF-doxygen/html/html/functions_vars_g.html +1 -1
- package/SVF-doxygen/html/html/functions_vars_m.html +1 -0
- package/SVF-doxygen/html/html/functions_vars_s.html +1 -0
- package/SVF-doxygen/html/html/functions_vars_t.html +1 -1
- package/SVF-doxygen/html/html/functions_w.html +1 -1
- package/SVF-doxygen/html/html/hierarchy.html +47 -46
- package/SVF-doxygen/html/html/namespaceSVF.html +2 -0
- package/SVF-doxygen/html/html/search/all_10.js +8 -8
- package/SVF-doxygen/html/html/search/all_11.js +2 -2
- package/SVF-doxygen/html/html/search/all_12.js +13 -10
- package/SVF-doxygen/html/html/search/all_13.js +4 -4
- package/SVF-doxygen/html/html/search/all_14.js +1 -1
- package/SVF-doxygen/html/html/search/all_15.js +2 -2
- package/SVF-doxygen/html/html/search/all_16.js +1 -1
- package/SVF-doxygen/html/html/search/all_19.js +1 -0
- package/SVF-doxygen/html/html/search/all_3.js +3 -3
- package/SVF-doxygen/html/html/search/all_5.js +2 -2
- package/SVF-doxygen/html/html/search/all_7.js +2 -2
- package/SVF-doxygen/html/html/search/all_9.js +1 -0
- package/SVF-doxygen/html/html/search/all_c.js +1 -1
- package/SVF-doxygen/html/html/search/all_d.js +1 -1
- package/SVF-doxygen/html/html/search/all_e.js +2 -2
- package/SVF-doxygen/html/html/search/all_f.js +1 -1
- package/SVF-doxygen/html/html/search/classes_f.js +1 -0
- package/SVF-doxygen/html/html/search/enums_1.js +1 -1
- package/SVF-doxygen/html/html/search/enumvalues_13.js +1 -1
- package/SVF-doxygen/html/html/search/enumvalues_2.js +1 -1
- package/SVF-doxygen/html/html/search/files_d.js +2 -0
- package/SVF-doxygen/html/html/search/functions_11.js +3 -2
- package/SVF-doxygen/html/html/search/functions_17.js +1 -0
- package/SVF-doxygen/html/html/search/functions_2.js +1 -1
- package/SVF-doxygen/html/html/search/functions_4.js +1 -1
- package/SVF-doxygen/html/html/search/functions_6.js +1 -1
- package/SVF-doxygen/html/html/search/functions_8.js +1 -0
- package/SVF-doxygen/html/html/search/functions_f.js +4 -4
- package/SVF-doxygen/html/html/search/typedefs_10.js +1 -1
- package/SVF-doxygen/html/html/search/typedefs_11.js +1 -1
- package/SVF-doxygen/html/html/search/typedefs_c.js +1 -1
- package/SVF-doxygen/html/html/search/variables_12.js +1 -1
- package/SVF-doxygen/html/html/search/variables_13.js +2 -2
- package/SVF-doxygen/html/html/search/variables_14.js +1 -1
- package/SVF-doxygen/html/html/search/variables_5.js +1 -1
- package/SVF-doxygen/html/html/search/variables_7.js +1 -1
- package/SVF-doxygen/html/html/search/variables_d.js +1 -1
- package/include/Graphs/ICFGStat.h +1 -1
- package/include/Util/ExtAPI.h +3 -0
- package/include/Util/ExtAPI.json +1456 -44
- package/include/Util/PTAStat.h +6 -36
- package/include/Util/SVFStat.h +95 -0
- package/include/WPA/AndersenPWC.h +1 -1
- package/lib/DDA/DDAPass.cpp +1 -0
- package/lib/DDA/DDAStat.cpp +1 -0
- package/lib/Graphs/SVFGReadWrite.cpp +1 -0
- package/lib/Graphs/SVFGStat.cpp +1 -0
- package/lib/SVF-FE/CHGBuilder.cpp +1 -0
- package/lib/Util/ExtAPI.cpp +42 -4
- package/lib/Util/PTAStat.cpp +2 -21
- package/lib/Util/SVFStat.cpp +58 -0
- package/lib/WPA/Andersen.cpp +1 -0
- package/lib/WPA/AndersenSCD.cpp +1 -0
- package/lib/WPA/AndersenSFR.cpp +1 -0
- package/lib/WPA/AndersenStat.cpp +1 -0
- package/lib/WPA/AndersenWaveDiff.cpp +1 -0
- package/package.json +1 -1
package/include/Util/PTAStat.h
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
//===----------------------------------------------------------------------===//
|
|
22
22
|
|
|
23
23
|
/*
|
|
24
|
-
*
|
|
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
|
-
|
|
156
|
-
|
|
157
|
-
virtual void printStat(string str = "");
|
|
158
|
-
|
|
159
|
-
virtual void performStatPerQuery(NodeID) {}
|
|
129
|
+
void performStat() override;
|
|
160
130
|
|
|
161
|
-
virtual void
|
|
131
|
+
virtual void printStat(std::string str = "") override;
|
|
162
132
|
|
|
163
|
-
|
|
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;
|
package/lib/DDA/DDAPass.cpp
CHANGED
package/lib/DDA/DDAStat.cpp
CHANGED
package/lib/Graphs/SVFGStat.cpp
CHANGED
|
@@ -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
|
package/lib/Util/ExtAPI.cpp
CHANGED
|
@@ -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
|
package/lib/Util/PTAStat.cpp
CHANGED
|
@@ -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
|
+
}
|
package/lib/WPA/Andersen.cpp
CHANGED
package/lib/WPA/AndersenSCD.cpp
CHANGED
package/lib/WPA/AndersenSFR.cpp
CHANGED
package/lib/WPA/AndersenStat.cpp
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
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": {
|