svf-tools 1.0.1032 → 1.0.1034
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/package.json +1 -1
- package/svf/include/Graphs/BasicBlockG.h +310 -0
- package/svf/include/Graphs/GenericGraph.h +106 -91
- package/svf/include/SVFIR/SVFIR.h +71 -73
- package/svf/include/SVFIR/SVFValue.h +25 -124
- package/svf/include/SVFIR/SVFVariables.h +270 -283
- package/svf/lib/AE/Core/AbstractState.cpp +5 -5
- package/svf/lib/CFL/CFLGraphBuilder.cpp +0 -1
- package/svf/lib/Graphs/BasicBlockG.cpp +10 -0
- package/svf/lib/Graphs/ConsG.cpp +2 -2
- package/svf/lib/Graphs/IRGraph.cpp +2 -2
- package/svf/lib/MSSA/MemRegion.cpp +1 -1
- package/svf/lib/MSSA/MemSSA.cpp +1 -1
- package/svf/lib/MTA/LockAnalysis.cpp +2 -1
- package/svf/lib/MTA/MHP.cpp +2 -1
- package/svf/lib/MTA/MTA.cpp +2 -1
- package/svf/lib/MTA/MTAStat.cpp +1 -1
- package/svf/lib/MemoryModel/AccessPath.cpp +5 -5
- package/svf/lib/SABER/SaberCondAllocator.cpp +3 -3
- package/svf/lib/SVFIR/PAGBuilderFromFile.cpp +2 -2
- package/svf/lib/SVFIR/SVFIR.cpp +5 -5
- package/svf/lib/SVFIR/SVFStatements.cpp +1 -1
- package/svf/lib/SVFIR/SVFValue.cpp +1 -68
- package/svf/lib/SVFIR/SVFVariables.cpp +76 -107
- package/svf/lib/Util/CDGBuilder.cpp +2 -1
- package/svf/lib/Util/CallGraphBuilder.cpp +6 -3
- package/svf/lib/Util/SVFStat.cpp +1 -1
- package/svf/lib/Util/ThreadAPI.cpp +1 -1
- package/svf-llvm/include/SVF-LLVM/LLVMModule.h +8 -4
- package/svf-llvm/include/SVF-LLVM/SVFIRBuilder.h +1 -1
- package/svf-llvm/lib/LLVMModule.cpp +5 -8
- package/svf-llvm/lib/LLVMUtil.cpp +13 -5
- package/svf-llvm/lib/ObjTypeInference.cpp +4 -4
- package/svf-llvm/lib/SVFIRBuilder.cpp +47 -35
- package/svf-llvm/lib/SVFIRExtAPI.cpp +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1034",
|
|
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": {
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
//===- BasicBlockG.h -- BasicBlock node------------------------------------------------//
|
|
2
|
+
//
|
|
3
|
+
// SVF: Static Value-Flow Analysis
|
|
4
|
+
//
|
|
5
|
+
// Copyright (C) <2013-2025> <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 Affero 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 Affero General Public License for more details.
|
|
17
|
+
|
|
18
|
+
// You should have received a copy of the GNU Affero General Public License
|
|
19
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
//
|
|
21
|
+
//===----------------------------------------------------------------------===//
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* ICFGNode.h
|
|
25
|
+
*
|
|
26
|
+
* Created on: 23 Jan, 2025
|
|
27
|
+
* Author: Jiawei, Xiao
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
#ifndef BASICBLOCKGRAPH_H_
|
|
31
|
+
#define BASICBLOCKGRAPH_H_
|
|
32
|
+
#include "GenericGraph.h"
|
|
33
|
+
#include <sstream>
|
|
34
|
+
#include <algorithm>
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
namespace SVF
|
|
38
|
+
{
|
|
39
|
+
class SVFBasicBlock;
|
|
40
|
+
class BasicBlockEdge;
|
|
41
|
+
class ICFGNode;
|
|
42
|
+
class SVFFunction;
|
|
43
|
+
typedef GenericEdge<SVFBasicBlock> GenericBasicBlockEdgeTy;
|
|
44
|
+
class BasicBlockEdge: public GenericBasicBlockEdgeTy
|
|
45
|
+
{
|
|
46
|
+
friend class SVFIRWriter;
|
|
47
|
+
friend class SVFIRReader;
|
|
48
|
+
|
|
49
|
+
public:
|
|
50
|
+
public:
|
|
51
|
+
/// Constructor
|
|
52
|
+
BasicBlockEdge(SVFBasicBlock* s, SVFBasicBlock* d) : GenericBasicBlockEdgeTy(s, d, 0)
|
|
53
|
+
{
|
|
54
|
+
}
|
|
55
|
+
/// Destructor
|
|
56
|
+
~BasicBlockEdge() {}
|
|
57
|
+
|
|
58
|
+
/// Overloading operator << for dumping ICFG node ID
|
|
59
|
+
//@{
|
|
60
|
+
friend OutStream& operator<<(OutStream& o, const BasicBlockEdge& edge)
|
|
61
|
+
{
|
|
62
|
+
o << edge.toString();
|
|
63
|
+
return o;
|
|
64
|
+
}
|
|
65
|
+
//@}
|
|
66
|
+
|
|
67
|
+
virtual const std::string toString() const;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
typedef GenericNode<SVFBasicBlock, BasicBlockEdge> GenericBasicBlockNodeTy;
|
|
72
|
+
class SVFBasicBlock : public GenericBasicBlockNodeTy
|
|
73
|
+
{
|
|
74
|
+
friend class LLVMModuleSet;
|
|
75
|
+
friend class SVFIRWriter;
|
|
76
|
+
friend class SVFIRReader;
|
|
77
|
+
friend class SVFIRBuilder;
|
|
78
|
+
friend class SVFFunction;
|
|
79
|
+
friend class ICFGBuilder;
|
|
80
|
+
friend class ICFG;
|
|
81
|
+
|
|
82
|
+
public:
|
|
83
|
+
typedef std::vector<const ICFGNode*>::const_iterator const_iterator;
|
|
84
|
+
std::vector<const SVFBasicBlock*> succBBs;
|
|
85
|
+
std::vector<const SVFBasicBlock*> predBBs;
|
|
86
|
+
|
|
87
|
+
private:
|
|
88
|
+
std::vector<const ICFGNode*> allICFGNodes; ///< all ICFGNodes in this BasicBlock
|
|
89
|
+
const SVFFunction* fun; /// Function where this BasicBlock is
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
protected:
|
|
94
|
+
///@{ attributes to be set only through Module builders e.g., LLVMModule
|
|
95
|
+
|
|
96
|
+
inline void addICFGNode(const ICFGNode* icfgNode)
|
|
97
|
+
{
|
|
98
|
+
assert(std::find(getICFGNodeList().begin(), getICFGNodeList().end(),
|
|
99
|
+
icfgNode) == getICFGNodeList().end() && "duplicated icfgnode");
|
|
100
|
+
allICFGNodes.push_back(icfgNode);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// @}
|
|
104
|
+
|
|
105
|
+
public:
|
|
106
|
+
/// Constructor without name
|
|
107
|
+
SVFBasicBlock(NodeID id, const SVFFunction* f): GenericBasicBlockNodeTy(id, BasicBlockKd), fun(f)
|
|
108
|
+
{
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
SVFBasicBlock() = delete;
|
|
112
|
+
~SVFBasicBlock()
|
|
113
|
+
{
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
static inline bool classof(const SVFBaseNode* node)
|
|
118
|
+
{
|
|
119
|
+
return node->getNodeKind() == SVFBaseNode::BasicBlockKd;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
static inline bool classof(const SVFBasicBlock* node)
|
|
123
|
+
{
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
//@{
|
|
128
|
+
friend OutStream &operator<<(OutStream &o, const SVFBasicBlock&node)
|
|
129
|
+
{
|
|
130
|
+
o << node.toString();
|
|
131
|
+
return o;
|
|
132
|
+
}
|
|
133
|
+
//@}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
inline const std::vector<const ICFGNode*>& getICFGNodeList() const
|
|
137
|
+
{
|
|
138
|
+
return allICFGNodes;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
inline const_iterator begin() const
|
|
142
|
+
{
|
|
143
|
+
return allICFGNodes.begin();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
inline const_iterator end() const
|
|
147
|
+
{
|
|
148
|
+
return allICFGNodes.end();
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
inline void addSuccBasicBlock(const SVFBasicBlock* succ2)
|
|
152
|
+
{
|
|
153
|
+
// check if the edge already exists
|
|
154
|
+
for (auto edge: this->getOutEdges())
|
|
155
|
+
{
|
|
156
|
+
if (edge->getDstNode() == succ2)
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
SVFBasicBlock* succ = const_cast<SVFBasicBlock*>(succ2);
|
|
161
|
+
BasicBlockEdge* edge = new BasicBlockEdge(this, succ);
|
|
162
|
+
this->addOutgoingEdge(edge);
|
|
163
|
+
succ->addIncomingEdge(edge);
|
|
164
|
+
this->succBBs.push_back(succ);
|
|
165
|
+
succ->predBBs.push_back(this);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
inline void addPredBasicBlock(const SVFBasicBlock* pred2)
|
|
169
|
+
{
|
|
170
|
+
// check if the edge already exists
|
|
171
|
+
for (auto edge: this->getInEdges())
|
|
172
|
+
{
|
|
173
|
+
if (edge->getSrcNode() == pred2)
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
SVFBasicBlock* pred = const_cast<SVFBasicBlock*>(pred2);
|
|
177
|
+
BasicBlockEdge* edge = new BasicBlockEdge(pred, this);
|
|
178
|
+
this->addIncomingEdge(edge);
|
|
179
|
+
pred->addOutgoingEdge(edge);
|
|
180
|
+
this->predBBs.push_back(pred);
|
|
181
|
+
pred->succBBs.push_back(this);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
inline const SVFFunction* getParent() const
|
|
185
|
+
{
|
|
186
|
+
return fun;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
inline const SVFFunction* getFunction() const
|
|
190
|
+
{
|
|
191
|
+
return fun;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
inline const ICFGNode* front() const
|
|
195
|
+
{
|
|
196
|
+
assert(!allICFGNodes.empty() && "bb empty?");
|
|
197
|
+
return allICFGNodes.front();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
inline const ICFGNode* back() const
|
|
201
|
+
{
|
|
202
|
+
assert(!allICFGNodes.empty() && "bb empty?");
|
|
203
|
+
return allICFGNodes.back();
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
inline std::vector<const SVFBasicBlock*> getSuccessors() const
|
|
207
|
+
{
|
|
208
|
+
std::vector<const SVFBasicBlock*> res;
|
|
209
|
+
for (auto edge : this->getOutEdges())
|
|
210
|
+
{
|
|
211
|
+
res.push_back(edge->getDstNode());
|
|
212
|
+
}
|
|
213
|
+
return res;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
inline std::vector<const SVFBasicBlock*> getPredecessors() const
|
|
217
|
+
{
|
|
218
|
+
std::vector<const SVFBasicBlock*> res;
|
|
219
|
+
for (auto edge : this->getInEdges())
|
|
220
|
+
{
|
|
221
|
+
res.push_back(edge->getSrcNode());
|
|
222
|
+
}
|
|
223
|
+
return res;
|
|
224
|
+
}
|
|
225
|
+
u32_t getNumSuccessors() const
|
|
226
|
+
{
|
|
227
|
+
return this->getOutEdges().size();
|
|
228
|
+
}
|
|
229
|
+
u32_t getBBSuccessorPos(const SVFBasicBlock* Succ)
|
|
230
|
+
{
|
|
231
|
+
u32_t i = 0;
|
|
232
|
+
for (const SVFBasicBlock* SuccBB: succBBs)
|
|
233
|
+
{
|
|
234
|
+
if (SuccBB == Succ)
|
|
235
|
+
return i;
|
|
236
|
+
i++;
|
|
237
|
+
}
|
|
238
|
+
assert(false && "Didn't find successor edge?");
|
|
239
|
+
return 0;
|
|
240
|
+
}
|
|
241
|
+
u32_t getBBSuccessorPos(const SVFBasicBlock* Succ) const
|
|
242
|
+
{
|
|
243
|
+
u32_t i = 0;
|
|
244
|
+
for (const SVFBasicBlock* SuccBB: succBBs)
|
|
245
|
+
{
|
|
246
|
+
if (SuccBB == Succ)
|
|
247
|
+
return i;
|
|
248
|
+
i++;
|
|
249
|
+
}
|
|
250
|
+
assert(false && "Didn't find successor edge?");
|
|
251
|
+
return 0;
|
|
252
|
+
|
|
253
|
+
}
|
|
254
|
+
u32_t getBBPredecessorPos(const SVFBasicBlock* succbb)
|
|
255
|
+
{
|
|
256
|
+
u32_t pos = 0;
|
|
257
|
+
for (const SVFBasicBlock* PredBB : succbb->getPredecessors())
|
|
258
|
+
{
|
|
259
|
+
if(PredBB == this)
|
|
260
|
+
return pos;
|
|
261
|
+
++pos;
|
|
262
|
+
}
|
|
263
|
+
assert(false && "Didn't find predecessor edge?");
|
|
264
|
+
return pos;
|
|
265
|
+
}
|
|
266
|
+
u32_t getBBPredecessorPos(const SVFBasicBlock* succbb) const
|
|
267
|
+
{
|
|
268
|
+
u32_t pos = 0;
|
|
269
|
+
for (const SVFBasicBlock* PredBB : succbb->getPredecessors())
|
|
270
|
+
{
|
|
271
|
+
if(PredBB == this)
|
|
272
|
+
return pos;
|
|
273
|
+
++pos;
|
|
274
|
+
}
|
|
275
|
+
assert(false && "Didn't find predecessor edge?");
|
|
276
|
+
return pos;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const std::string toString() const;
|
|
280
|
+
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
typedef GenericGraph<SVFBasicBlock, BasicBlockEdge> GenericBasicBlockGraphTy;
|
|
286
|
+
class BasicBlockGraph: public GenericBasicBlockGraphTy
|
|
287
|
+
{
|
|
288
|
+
private:
|
|
289
|
+
NodeID id{0};
|
|
290
|
+
const SVFFunction* fun;
|
|
291
|
+
public:
|
|
292
|
+
/// Constructor
|
|
293
|
+
BasicBlockGraph(const SVFFunction* f): fun(f)
|
|
294
|
+
{
|
|
295
|
+
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
SVFBasicBlock* addBasicBlock(const std::string& bbname)
|
|
299
|
+
{
|
|
300
|
+
id++;
|
|
301
|
+
SVFBasicBlock* bb = new SVFBasicBlock(id, fun);
|
|
302
|
+
addGNode(id, bb);
|
|
303
|
+
bb->setName(bbname);
|
|
304
|
+
return bb;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
#endif
|
|
@@ -141,96 +141,111 @@ public:
|
|
|
141
141
|
|
|
142
142
|
enum GNodeK
|
|
143
143
|
{
|
|
144
|
-
//
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
//
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
//
|
|
153
|
-
|
|
154
|
-
//
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
// │
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
// │
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
//
|
|
186
|
-
|
|
187
|
-
//
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
// │
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
// │
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
//
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
// │
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
// │
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
//
|
|
219
|
-
|
|
220
|
-
//
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
144
|
+
// ┌─────────────────────────────────────────────────────────────────────────┐
|
|
145
|
+
// │ ICFGNode: Classes of inter-procedural and intra-procedural control flow │
|
|
146
|
+
// │ graph nodes (Parent class: ICFGNode) │
|
|
147
|
+
// └─────────────────────────────────────────────────────────────────────────┘
|
|
148
|
+
IntraBlock, // ├── Represents a node within a single procedure
|
|
149
|
+
GlobalBlock, // ├── Represents a global-level block
|
|
150
|
+
// │ └─ Subclass: InterICFGNode
|
|
151
|
+
FunEntryBlock, // │ ├── Entry point of a function
|
|
152
|
+
FunExitBlock, // │ ├── Exit point of a function
|
|
153
|
+
FunCallBlock, // │ ├── Call site in the function
|
|
154
|
+
FunRetBlock, // │ └── Return site in the function
|
|
155
|
+
|
|
156
|
+
// ┌─────────────────────────────────────────────────────────────────────────┐
|
|
157
|
+
// │ SVFVar: Classes of variable nodes (Parent class: SVFVar) │
|
|
158
|
+
// │ Includes two main subclasses: ValVar and ObjVar │
|
|
159
|
+
// └─────────────────────────────────────────────────────────────────────────┘
|
|
160
|
+
// └─ Subclass: ValVar (Top-level variable nodes)
|
|
161
|
+
ValNode, // ├── Represents a standard value variable
|
|
162
|
+
ArgValNode, // ├── Represents an argument value variable
|
|
163
|
+
FunValNode, // ├── Represents a function value variable
|
|
164
|
+
GepValNode, // ├── Represents a GEP value variable
|
|
165
|
+
RetValNode, // ├── Represents a return value node
|
|
166
|
+
VarargValNode, // ├── Represents a variadic argument node
|
|
167
|
+
GlobalValNode, // ├── Represents a global variable node
|
|
168
|
+
ConstAggValNode, // ├── Represents a constant aggregate value node
|
|
169
|
+
// │ └─ Subclass: ConstDataValVar
|
|
170
|
+
ConstDataValNode, // │ ├── Represents a constant data variable
|
|
171
|
+
BlackHoleValNode, // │ ├── Represents a black hole node
|
|
172
|
+
ConstFPValNode, // │ ├── Represents a constant floating-point value node
|
|
173
|
+
ConstIntValNode, // │ ├── Represents a constant integer value node
|
|
174
|
+
ConstNullptrValNode, // │ └── Represents a constant nullptr value node
|
|
175
|
+
// │ └─ Subclass: DummyValVar
|
|
176
|
+
DummyValNode, // │ └── Dummy node for uninitialized values
|
|
177
|
+
|
|
178
|
+
// └─ Subclass: ObjVar (Object variable nodes)
|
|
179
|
+
ObjNode, // ├── Represents an object variable
|
|
180
|
+
// │ └─ Subclass: GepObjVar
|
|
181
|
+
GepObjNode, // │ ├── Represents a GEP object variable
|
|
182
|
+
// │ └─ Subclass: BaseObjVar
|
|
183
|
+
BaseObjNode, // │ ├── Represents a base object node
|
|
184
|
+
FunObjNode, // │ ├── Represents a function object
|
|
185
|
+
HeapObjNode, // │ ├── Represents a heap object
|
|
186
|
+
StackObjNode, // │ ├── Represents a stack object
|
|
187
|
+
GlobalObjNode, // │ ├── Represents a global object
|
|
188
|
+
ConstAggObjNode, // │ ├── Represents a constant aggregate object
|
|
189
|
+
// │ └─ Subclass: ConstDataObjVar
|
|
190
|
+
ConstDataObjNode, // │ ├── Represents a constant data object
|
|
191
|
+
ConstFPObjNode, // │ ├── Represents a constant floating-point object
|
|
192
|
+
ConstIntObjNode, // │ ├── Represents a constant integer object
|
|
193
|
+
ConstNullptrObjNode, // │ └── Represents a constant nullptr object
|
|
194
|
+
// │ └─ Subclass: DummyObjVar
|
|
195
|
+
DummyObjNode, // │ └── Dummy node for uninitialized objects
|
|
196
|
+
|
|
197
|
+
// ┌─────────────────────────────────────────────────────────────────────────┐
|
|
198
|
+
// │ VFGNode: Classes of Value Flow Graph (VFG) node kinds (Parent class: │
|
|
199
|
+
// │ VFGNode) │
|
|
200
|
+
// │ Includes operation nodes and specialized subclasses │
|
|
201
|
+
// └─────────────────────────────────────────────────────────────────────────┘
|
|
202
|
+
Cmp, // ├── Represents a comparison operation
|
|
203
|
+
BinaryOp, // ├── Represents a binary operation
|
|
204
|
+
UnaryOp, // ├── Represents a unary operation
|
|
205
|
+
Branch, // ├── Represents a branch operation
|
|
206
|
+
DummyVProp, // ├── Dummy node for value propagation
|
|
207
|
+
NPtr, // ├── Represents a null pointer operation
|
|
208
|
+
// │ └─ Subclass: ArgumentVFGNode
|
|
209
|
+
FRet, // │ ├── Represents a function return value
|
|
210
|
+
ARet, // │ ├── Represents an argument return value
|
|
211
|
+
AParm, // │ ├── Represents an argument parameter
|
|
212
|
+
FParm, // │ └── Represents a function parameter
|
|
213
|
+
// │ └─ Subclass: StmtVFGNode
|
|
214
|
+
Addr, // │ ├── Represents an address operation
|
|
215
|
+
Copy, // │ ├── Represents a copy operation
|
|
216
|
+
Gep, // │ ├── Represents a GEP operation
|
|
217
|
+
Store, // │ ├── Represents a store operation
|
|
218
|
+
Load, // │ └── Represents a load operation
|
|
219
|
+
// │ └─ Subclass: PHIVFGNode
|
|
220
|
+
TPhi, // │ ├── Represents a type-based PHI node
|
|
221
|
+
TIntraPhi, // │ ├── Represents an intra-procedural PHI node
|
|
222
|
+
TInterPhi, // │ └── Represents an inter-procedural PHI node
|
|
223
|
+
// │ └─ Subclass: MRSVFGNode
|
|
224
|
+
FPIN, // │ ├── Function parameter input
|
|
225
|
+
FPOUT, // │ ├── Function parameter output
|
|
226
|
+
APIN, // │ ├── Argument parameter input
|
|
227
|
+
APOUT, // │ └── Argument parameter output
|
|
228
|
+
// │ └─ Subclass: MSSAPHISVFGNode
|
|
229
|
+
MPhi, // │ ├── Memory PHI node
|
|
230
|
+
MIntraPhi, // │ ├── Intra-procedural memory PHI node
|
|
231
|
+
MInterPhi, // │ └── Inter-procedural memory PHI node
|
|
232
|
+
|
|
233
|
+
// ┌─────────────────────────────────────────────────────────────────────────┐
|
|
234
|
+
// │ Additional specific graph node types │
|
|
235
|
+
// └─────────────────────────────────────────────────────────────────────────┘
|
|
236
|
+
CallNodeKd, // Callgraph node
|
|
237
|
+
CDNodeKd, // Control dependence graph node
|
|
238
|
+
CFLNodeKd, // CFL graph node
|
|
239
|
+
CHNodeKd, // Class hierarchy graph node
|
|
225
240
|
ConstraintNodeKd, // Constraint graph node
|
|
226
|
-
TCTNodeKd,
|
|
227
|
-
DCHNodeKd,
|
|
228
|
-
|
|
241
|
+
TCTNodeKd, // Thread creation tree node
|
|
242
|
+
DCHNodeKd, // DCHG node
|
|
243
|
+
BasicBlockKd, // Basic block node
|
|
244
|
+
OtherKd // Other node kind
|
|
229
245
|
};
|
|
230
246
|
|
|
231
247
|
|
|
232
|
-
|
|
233
|
-
SVFBaseNode(NodeID i, GNodeK k, SVFType* ty = nullptr): id(i),nodeKind(k), type(ty)
|
|
248
|
+
SVFBaseNode(NodeID i, GNodeK k, const SVFType* ty = nullptr): id(i),nodeKind(k), type(ty)
|
|
234
249
|
{
|
|
235
250
|
|
|
236
251
|
}
|
|
@@ -326,10 +341,10 @@ protected:
|
|
|
326
341
|
|
|
327
342
|
static inline bool isConstantDataValVar(GNodeK n)
|
|
328
343
|
{
|
|
329
|
-
static_assert(
|
|
344
|
+
static_assert(ConstNullptrValNode - ConstDataValNode == 4,
|
|
330
345
|
"The number of ConstantDataValVarKinds has changed, make "
|
|
331
346
|
"sure the range is correct");
|
|
332
|
-
return n <=
|
|
347
|
+
return n <= ConstNullptrValNode && n >= ConstDataValNode;
|
|
333
348
|
}
|
|
334
349
|
|
|
335
350
|
static inline bool isObjVarKinds(GNodeK n)
|
|
@@ -350,10 +365,10 @@ protected:
|
|
|
350
365
|
|
|
351
366
|
static inline bool isConstantDataObjVarKinds(GNodeK n)
|
|
352
367
|
{
|
|
353
|
-
static_assert(
|
|
368
|
+
static_assert(ConstNullptrObjNode - ConstDataObjNode == 3,
|
|
354
369
|
"The number of ConstantDataObjVarKinds has changed, make "
|
|
355
370
|
"sure the range is correct");
|
|
356
|
-
return n <=
|
|
371
|
+
return n <= ConstNullptrObjNode && n >= ConstDataObjNode;
|
|
357
372
|
}
|
|
358
373
|
|
|
359
374
|
static inline bool isVFGNodeKinds(GNodeK n)
|
|
@@ -433,7 +448,7 @@ private:
|
|
|
433
448
|
|
|
434
449
|
public:
|
|
435
450
|
/// Constructor
|
|
436
|
-
GenericNode(NodeID i, GNodeK k): SVFBaseNode(i, k)
|
|
451
|
+
GenericNode(NodeID i, GNodeK k, const SVFType* svfType = nullptr): SVFBaseNode(i, k, svfType)
|
|
437
452
|
{
|
|
438
453
|
|
|
439
454
|
}
|