svf-lib 1.0.1225 → 1.0.1228
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/SVF-linux/Release-build/lib/libSvf.a +0 -0
- package/SVF-linux/include/CFL/CFGNormalizer.h +3 -1
- package/SVF-linux/include/CFL/PEGGrammar.txt +5 -18
- package/SVF-linux/include/Util/PTAStat.h +0 -79
- package/SVF-linux/include/Util/SVFStat.h +3 -2
- package/SVF-osx/Release-build/lib/libSvf.a +0 -0
- package/SVF-osx/include/Util/PTAStat.h +0 -79
- package/SVF-osx/include/Util/SVFStat.h +3 -2
- package/package.json +1 -1
|
Binary file
|
|
@@ -36,7 +36,7 @@ namespace SVF
|
|
|
36
36
|
{
|
|
37
37
|
|
|
38
38
|
/*!
|
|
39
|
-
* Generate Normalized Grammar from a grammarbase
|
|
39
|
+
* Generate Normalized Grammar (backus naur form) from a grammarbase (Extended extended Backus–Naur form )
|
|
40
40
|
*
|
|
41
41
|
* To Do:
|
|
42
42
|
* Error Notice for ill formed production,
|
|
@@ -64,6 +64,8 @@ private:
|
|
|
64
64
|
|
|
65
65
|
void ebnfSignReplace(char sign, CFLGrammar *grammar);
|
|
66
66
|
|
|
67
|
+
void barReplace(CFLGrammar *grammar);
|
|
68
|
+
|
|
67
69
|
void insertToCFLGrammar(CFLGrammar *grammar, GrammarBase::Production &prod);
|
|
68
70
|
|
|
69
71
|
int ebnfBracketMatch(GrammarBase::Production& prod, int i, CFLGrammar *grammar) ;
|
|
@@ -3,22 +3,9 @@ Start:
|
|
|
3
3
|
Terminal:
|
|
4
4
|
Addr Copy Store Load Gep
|
|
5
5
|
Productions:
|
|
6
|
-
F ->
|
|
6
|
+
F -> ( Copy M ? ) *;
|
|
7
|
+
Fbar -> ( M ? Copybar ) *;
|
|
7
8
|
M -> Addr V Addrbar;
|
|
8
|
-
V -> Fbar V F;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
V -> epsilon;
|
|
12
|
-
F -> F Copy;
|
|
13
|
-
F -> F Copy M;
|
|
14
|
-
Fbar -> epsilon;
|
|
15
|
-
Fbar -> Copybar Fbar;
|
|
16
|
-
Fbar -> M Copybar Fbar;
|
|
17
|
-
ArrayPath -> Gepbar_0 Gepbar_0;
|
|
18
|
-
ArrayPath -> ArrayPath Gepbar_0;
|
|
19
|
-
Memcpy -> Addrbar V Addr;
|
|
20
|
-
Memcpy -> Gep_i Memcpy Gepbar_i;
|
|
21
|
-
Memcpy -> F Memcpy Fbar;
|
|
22
|
-
V -> Gepbar_i Memcpy Gep_i;
|
|
23
|
-
V -> Gep_i Memcpy Gepbar_i;
|
|
24
|
-
V -> ArrayPath V Gep_0;
|
|
9
|
+
V -> Fbar V F | Gepbar_i V Gep_i | M | epsilon | Gepbar_i Memcpy Gep_i | Gep_i Memcpy Gepbar_i | ArrayPath V Gep_0;
|
|
10
|
+
ArrayPath -> Gepbar_0 Gepbar_0 | ArrayPath Gepbar_0;
|
|
11
|
+
Memcpy -> Addrbar V Addr | Gep_i Memcpy Gepbar_i | F Memcpy Fbar;
|
|
@@ -48,95 +48,16 @@ class PointerAnalysis;
|
|
|
48
48
|
class PTAStat: public SVFStat
|
|
49
49
|
{
|
|
50
50
|
public:
|
|
51
|
-
static const char* TotalAnalysisTime; ///< Total analysis time
|
|
52
|
-
static const char* SCCDetectionTime; ///< Total SCC detection time
|
|
53
|
-
static const char* SCCMergeTime; ///< Total SCC merge time
|
|
54
|
-
|
|
55
|
-
static const char* ProcessLoadStoreTime;///< time of processing loads and stores
|
|
56
|
-
static const char* ProcessCopyGepTime; ///< time of processing copys and geps
|
|
57
|
-
static const char* UpdateCallGraphTime; ///< time of updating call graph
|
|
58
|
-
|
|
59
|
-
static const char* TotalNumOfPointers; ///< Total SVFIR value node
|
|
60
|
-
static const char* TotalNumOfObjects; ///< Total SVFIR object node
|
|
61
|
-
static const char* TotalNumOfFieldObjects; ///< Total SVFIR field object node
|
|
62
|
-
static const char* MaxStructSize; ///< Max struct size
|
|
63
|
-
static const char* TotalNumOfEdges; ///< Total SVFIR edge number
|
|
64
|
-
|
|
65
|
-
static const char* NumOfAddrs; ///< SVFIR addr edge
|
|
66
|
-
static const char* NumOfLoads; ///< SVFIR load edge
|
|
67
|
-
static const char* NumOfStores; ///< SVFIR store edge
|
|
68
|
-
static const char* NumOfCopys; ///< SVFIR copy edge
|
|
69
|
-
static const char* NumOfGeps; ///< SVFIR gep edge
|
|
70
|
-
static const char* NumOfCalls; ///< SVFIR call edge
|
|
71
|
-
static const char* NumOfReturns; ///< SVFIR return edge
|
|
72
|
-
|
|
73
|
-
static const char* NumOfProcessedAddrs; ///< SVFIR processed addr edge
|
|
74
|
-
static const char* NumOfProcessedLoads; ///< SVFIR processed load edge
|
|
75
|
-
static const char* NumOfProcessedStores; ///< SVFIR processed store edge
|
|
76
|
-
static const char* NumOfProcessedCopys; ///< SVFIR processed copy edge
|
|
77
|
-
static const char* NumOfProcessedGeps; ///< SVFIR processed gep edge
|
|
78
|
-
|
|
79
|
-
static const char* NumOfSfr; ///< num of field representatives
|
|
80
|
-
static const char* NumOfFieldExpand;
|
|
81
|
-
|
|
82
|
-
static const char* NumOfFunctionObjs; ///< Function numbers
|
|
83
|
-
static const char* NumOfGlobalObjs; ///< SVFIR global object node
|
|
84
|
-
static const char* NumOfHeapObjs; ///< SVFIR heap object node
|
|
85
|
-
static const char* NumOfStackObjs; ///< SVFIR stack object node
|
|
86
|
-
|
|
87
|
-
static const char* NumOfObjsHasVarStruct; ///< SVFIR object node has var struct (maybe nested with array)
|
|
88
|
-
static const char* NumOfObjsHasVarArray; ///< SVFIR object node has var array (maybe nested with struct)
|
|
89
|
-
static const char* NumOfObjsHasConstStruct; ///< SVFIR object node has const struct (maybe nested with array)
|
|
90
|
-
static const char* NumOfObjsHasConstArray; ///< SVFIR object node has const array (maybe nested with struct)
|
|
91
|
-
static const char* NumOfNonPtrObjs; ///< SVFIR object node which is non pointer type object (do not have pts)
|
|
92
|
-
static const char* NumOfConstantObjs; ///< SVFIR object node which is purely constant
|
|
93
|
-
|
|
94
|
-
static const char* NumberOfFieldInsensitiveObj;
|
|
95
|
-
static const char* NumberOfFieldSensitiveObj;
|
|
96
|
-
|
|
97
|
-
static const char* NumOfPointers; ///< SVFIR value node, each of them maps to a llvm value
|
|
98
|
-
static const char* NumOfGepFieldPointers; ///< SVFIR gep value node (field value, dynamically created dummy node)
|
|
99
|
-
|
|
100
|
-
static const char* NumOfMemObjects; ///< SVFIR object node, each of them maps to a llvm value
|
|
101
|
-
static const char* NumOfGepFieldObjects; ///< SVFIR gep object node (field obj, dynamically created dummy node)
|
|
102
|
-
|
|
103
|
-
static const char* AveragePointsToSetSize; ///< Average points-to size of all variables
|
|
104
|
-
static const char* AverageTopLevPointsToSetSize; ///< Average points-to size of top-level variables
|
|
105
|
-
static const char* MaxPointsToSetSize; ///< Max points-to size
|
|
106
|
-
|
|
107
|
-
static const char* NumOfIterations; ///< Number of iterations during resolution
|
|
108
|
-
|
|
109
|
-
static const char* NumOfIndirectCallSites; ///< Number of indirect callsites
|
|
110
|
-
static const char* NumOfIndirectEdgeSolved; ///< Number of indirect calledge resolved
|
|
111
|
-
|
|
112
|
-
static const char* NumOfSCCDetection; ///< Number of scc detection performed
|
|
113
|
-
static const char* NumOfCycles; ///< Number of scc cycles detected
|
|
114
|
-
static const char* NumOfPWCCycles; ///< Number of scc cycles detected
|
|
115
|
-
static const char* NumOfNodesInCycles; ///< Number of nodes in cycles detected
|
|
116
|
-
static const char* MaxNumOfNodesInSCC; ///< max Number of nodes in one scc
|
|
117
|
-
|
|
118
|
-
static const char* NumOfNullPointer; ///< Number of pointers points-to null
|
|
119
|
-
|
|
120
51
|
PTAStat(PointerAnalysis* p);
|
|
121
52
|
virtual ~PTAStat() {}
|
|
122
53
|
|
|
123
|
-
NUMStatMap PTNumStatMap;
|
|
124
54
|
NodeBS localVarInRecursion;
|
|
125
55
|
|
|
126
|
-
double startTime;
|
|
127
|
-
double endTime;
|
|
128
|
-
|
|
129
56
|
void performStat() override;
|
|
130
57
|
|
|
131
|
-
virtual void printStat(std::string str = "") override;
|
|
132
|
-
|
|
133
58
|
void callgraphStat() override;
|
|
134
59
|
private:
|
|
135
|
-
void bitcastInstStat();
|
|
136
|
-
void branchStat();
|
|
137
|
-
|
|
138
60
|
PointerAnalysis* pta;
|
|
139
|
-
std::string moduleName;
|
|
140
61
|
};
|
|
141
62
|
|
|
142
63
|
} // End namespace SVF
|
|
@@ -71,6 +71,7 @@ public:
|
|
|
71
71
|
static double getClk(bool mark = false);
|
|
72
72
|
|
|
73
73
|
NUMStatMap generalNumMap;
|
|
74
|
+
NUMStatMap PTNumStatMap;
|
|
74
75
|
TIMEStatMap timeStatMap;
|
|
75
76
|
|
|
76
77
|
double startTime;
|
|
@@ -78,7 +79,7 @@ public:
|
|
|
78
79
|
|
|
79
80
|
virtual void performStat() = 0;
|
|
80
81
|
|
|
81
|
-
virtual void printStat(std::string str = "")
|
|
82
|
+
virtual void printStat(std::string str = "");
|
|
82
83
|
|
|
83
84
|
virtual void performStatPerQuery(NodeID) {}
|
|
84
85
|
|
|
@@ -91,7 +92,7 @@ public:
|
|
|
91
92
|
static double timeOfBuildingSVFIR;
|
|
92
93
|
|
|
93
94
|
private:
|
|
94
|
-
|
|
95
|
+
void branchStat();
|
|
95
96
|
std::string moduleName;
|
|
96
97
|
}; // End class SVFStat
|
|
97
98
|
|
|
Binary file
|
|
@@ -48,95 +48,16 @@ class PointerAnalysis;
|
|
|
48
48
|
class PTAStat: public SVFStat
|
|
49
49
|
{
|
|
50
50
|
public:
|
|
51
|
-
static const char* TotalAnalysisTime; ///< Total analysis time
|
|
52
|
-
static const char* SCCDetectionTime; ///< Total SCC detection time
|
|
53
|
-
static const char* SCCMergeTime; ///< Total SCC merge time
|
|
54
|
-
|
|
55
|
-
static const char* ProcessLoadStoreTime;///< time of processing loads and stores
|
|
56
|
-
static const char* ProcessCopyGepTime; ///< time of processing copys and geps
|
|
57
|
-
static const char* UpdateCallGraphTime; ///< time of updating call graph
|
|
58
|
-
|
|
59
|
-
static const char* TotalNumOfPointers; ///< Total SVFIR value node
|
|
60
|
-
static const char* TotalNumOfObjects; ///< Total SVFIR object node
|
|
61
|
-
static const char* TotalNumOfFieldObjects; ///< Total SVFIR field object node
|
|
62
|
-
static const char* MaxStructSize; ///< Max struct size
|
|
63
|
-
static const char* TotalNumOfEdges; ///< Total SVFIR edge number
|
|
64
|
-
|
|
65
|
-
static const char* NumOfAddrs; ///< SVFIR addr edge
|
|
66
|
-
static const char* NumOfLoads; ///< SVFIR load edge
|
|
67
|
-
static const char* NumOfStores; ///< SVFIR store edge
|
|
68
|
-
static const char* NumOfCopys; ///< SVFIR copy edge
|
|
69
|
-
static const char* NumOfGeps; ///< SVFIR gep edge
|
|
70
|
-
static const char* NumOfCalls; ///< SVFIR call edge
|
|
71
|
-
static const char* NumOfReturns; ///< SVFIR return edge
|
|
72
|
-
|
|
73
|
-
static const char* NumOfProcessedAddrs; ///< SVFIR processed addr edge
|
|
74
|
-
static const char* NumOfProcessedLoads; ///< SVFIR processed load edge
|
|
75
|
-
static const char* NumOfProcessedStores; ///< SVFIR processed store edge
|
|
76
|
-
static const char* NumOfProcessedCopys; ///< SVFIR processed copy edge
|
|
77
|
-
static const char* NumOfProcessedGeps; ///< SVFIR processed gep edge
|
|
78
|
-
|
|
79
|
-
static const char* NumOfSfr; ///< num of field representatives
|
|
80
|
-
static const char* NumOfFieldExpand;
|
|
81
|
-
|
|
82
|
-
static const char* NumOfFunctionObjs; ///< Function numbers
|
|
83
|
-
static const char* NumOfGlobalObjs; ///< SVFIR global object node
|
|
84
|
-
static const char* NumOfHeapObjs; ///< SVFIR heap object node
|
|
85
|
-
static const char* NumOfStackObjs; ///< SVFIR stack object node
|
|
86
|
-
|
|
87
|
-
static const char* NumOfObjsHasVarStruct; ///< SVFIR object node has var struct (maybe nested with array)
|
|
88
|
-
static const char* NumOfObjsHasVarArray; ///< SVFIR object node has var array (maybe nested with struct)
|
|
89
|
-
static const char* NumOfObjsHasConstStruct; ///< SVFIR object node has const struct (maybe nested with array)
|
|
90
|
-
static const char* NumOfObjsHasConstArray; ///< SVFIR object node has const array (maybe nested with struct)
|
|
91
|
-
static const char* NumOfNonPtrObjs; ///< SVFIR object node which is non pointer type object (do not have pts)
|
|
92
|
-
static const char* NumOfConstantObjs; ///< SVFIR object node which is purely constant
|
|
93
|
-
|
|
94
|
-
static const char* NumberOfFieldInsensitiveObj;
|
|
95
|
-
static const char* NumberOfFieldSensitiveObj;
|
|
96
|
-
|
|
97
|
-
static const char* NumOfPointers; ///< SVFIR value node, each of them maps to a llvm value
|
|
98
|
-
static const char* NumOfGepFieldPointers; ///< SVFIR gep value node (field value, dynamically created dummy node)
|
|
99
|
-
|
|
100
|
-
static const char* NumOfMemObjects; ///< SVFIR object node, each of them maps to a llvm value
|
|
101
|
-
static const char* NumOfGepFieldObjects; ///< SVFIR gep object node (field obj, dynamically created dummy node)
|
|
102
|
-
|
|
103
|
-
static const char* AveragePointsToSetSize; ///< Average points-to size of all variables
|
|
104
|
-
static const char* AverageTopLevPointsToSetSize; ///< Average points-to size of top-level variables
|
|
105
|
-
static const char* MaxPointsToSetSize; ///< Max points-to size
|
|
106
|
-
|
|
107
|
-
static const char* NumOfIterations; ///< Number of iterations during resolution
|
|
108
|
-
|
|
109
|
-
static const char* NumOfIndirectCallSites; ///< Number of indirect callsites
|
|
110
|
-
static const char* NumOfIndirectEdgeSolved; ///< Number of indirect calledge resolved
|
|
111
|
-
|
|
112
|
-
static const char* NumOfSCCDetection; ///< Number of scc detection performed
|
|
113
|
-
static const char* NumOfCycles; ///< Number of scc cycles detected
|
|
114
|
-
static const char* NumOfPWCCycles; ///< Number of scc cycles detected
|
|
115
|
-
static const char* NumOfNodesInCycles; ///< Number of nodes in cycles detected
|
|
116
|
-
static const char* MaxNumOfNodesInSCC; ///< max Number of nodes in one scc
|
|
117
|
-
|
|
118
|
-
static const char* NumOfNullPointer; ///< Number of pointers points-to null
|
|
119
|
-
|
|
120
51
|
PTAStat(PointerAnalysis* p);
|
|
121
52
|
virtual ~PTAStat() {}
|
|
122
53
|
|
|
123
|
-
NUMStatMap PTNumStatMap;
|
|
124
54
|
NodeBS localVarInRecursion;
|
|
125
55
|
|
|
126
|
-
double startTime;
|
|
127
|
-
double endTime;
|
|
128
|
-
|
|
129
56
|
void performStat() override;
|
|
130
57
|
|
|
131
|
-
virtual void printStat(std::string str = "") override;
|
|
132
|
-
|
|
133
58
|
void callgraphStat() override;
|
|
134
59
|
private:
|
|
135
|
-
void bitcastInstStat();
|
|
136
|
-
void branchStat();
|
|
137
|
-
|
|
138
60
|
PointerAnalysis* pta;
|
|
139
|
-
std::string moduleName;
|
|
140
61
|
};
|
|
141
62
|
|
|
142
63
|
} // End namespace SVF
|
|
@@ -71,6 +71,7 @@ public:
|
|
|
71
71
|
static double getClk(bool mark = false);
|
|
72
72
|
|
|
73
73
|
NUMStatMap generalNumMap;
|
|
74
|
+
NUMStatMap PTNumStatMap;
|
|
74
75
|
TIMEStatMap timeStatMap;
|
|
75
76
|
|
|
76
77
|
double startTime;
|
|
@@ -78,7 +79,7 @@ public:
|
|
|
78
79
|
|
|
79
80
|
virtual void performStat() = 0;
|
|
80
81
|
|
|
81
|
-
virtual void printStat(std::string str = "")
|
|
82
|
+
virtual void printStat(std::string str = "");
|
|
82
83
|
|
|
83
84
|
virtual void performStatPerQuery(NodeID) {}
|
|
84
85
|
|
|
@@ -91,7 +92,7 @@ public:
|
|
|
91
92
|
static double timeOfBuildingSVFIR;
|
|
92
93
|
|
|
93
94
|
private:
|
|
94
|
-
|
|
95
|
+
void branchStat();
|
|
95
96
|
std::string moduleName;
|
|
96
97
|
}; // End class SVFStat
|
|
97
98
|
|