svf-tools 1.0.694 → 1.0.696
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/CMakeLists.txt +3 -0
- package/package.json +1 -1
- package/svf/include/Graphs/CHG.h +4 -1
- package/svf/include/Graphs/GenericGraph.h +5 -0
- package/svf/include/Graphs/ICFG.h +1 -0
- package/svf/include/Graphs/ICFGEdge.h +4 -0
- package/svf/include/Graphs/ICFGNode.h +28 -2
- package/svf/include/Graphs/IRGraph.h +1 -0
- package/svf/include/MemoryModel/LocationSet.h +1 -0
- package/svf/include/MemoryModel/SVFLoop.h +1 -0
- package/svf/include/SVFIR/SVFIR.h +1 -0
- package/svf/include/SVFIR/SVFIRRW.h +864 -186
- package/svf/include/SVFIR/SVFModule.h +1 -0
- package/svf/include/SVFIR/SVFModuleRW.h +2 -2
- package/svf/include/SVFIR/SVFStatements.h +65 -15
- package/svf/include/SVFIR/SVFType.h +4 -0
- package/svf/include/SVFIR/SVFValue.h +22 -0
- package/svf/include/SVFIR/SVFVariables.h +42 -0
- package/svf/include/SVFIR/SymbolTableInfo.h +17 -1
- package/svf/include/Util/Options.h +1 -0
- package/svf/include/Util/SVFUtil.h +49 -0
- package/svf/include/Util/SparseBitVector.h +2 -0
- package/svf/lib/SVFIR/SVFIRRW.cpp +1509 -127
- package/svf/lib/SVFIR/SVFModuleRW.cpp +6 -6
- package/svf/lib/SVFIR/SymbolTableInfo.cpp +1 -1
- package/svf/lib/Util/Options.cpp +7 -1
- package/svf-llvm/lib/LLVMModule.cpp +1 -1
- package/svf-llvm/lib/SVFIRBuilder.cpp +1 -1
- package/svf-llvm/tools/CMakeLists.txt +1 -0
- package/svf-llvm/tools/LLVM2SVF/CMakeLists.txt +10 -0
- package/svf-llvm/tools/LLVM2SVF/llvm2svf.cpp +72 -0
- package/svf-llvm/tools/WPA/wpa.cpp +17 -14
package/CMakeLists.txt
CHANGED
|
@@ -24,6 +24,9 @@ if(SVF_ENABLE_ASSERTIONS)
|
|
|
24
24
|
add_compile_options("-UNDEBUG")
|
|
25
25
|
endif()
|
|
26
26
|
|
|
27
|
+
# Turn this on if you need symbols (e.g., use them for backtrace debugging)
|
|
28
|
+
# add_link_options("-rdynamic")
|
|
29
|
+
|
|
27
30
|
option(SVF_COVERAGE "Create coverage build")
|
|
28
31
|
if(SVF_COVERAGE OR DEFINED ENV{SVF_COVERAGE})
|
|
29
32
|
add_compile_options("-fprofile-arcs" "-ftest-coverage")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.696",
|
|
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": {
|
package/svf/include/Graphs/CHG.h
CHANGED
|
@@ -78,6 +78,7 @@ typedef GenericEdge<CHNode> GenericCHEdgeTy;
|
|
|
78
78
|
class CHEdge: public GenericCHEdgeTy
|
|
79
79
|
{
|
|
80
80
|
friend class SVFIRWriter;
|
|
81
|
+
friend class SVFIRReader;
|
|
81
82
|
|
|
82
83
|
public:
|
|
83
84
|
typedef enum
|
|
@@ -107,6 +108,7 @@ typedef GenericNode<CHNode, CHEdge> GenericCHNodeTy;
|
|
|
107
108
|
class CHNode: public GenericCHNodeTy
|
|
108
109
|
{
|
|
109
110
|
friend class SVFIRWriter;
|
|
111
|
+
friend class SVFIRReader;
|
|
110
112
|
|
|
111
113
|
public:
|
|
112
114
|
typedef enum
|
|
@@ -118,7 +120,7 @@ public:
|
|
|
118
120
|
|
|
119
121
|
typedef std::vector<const SVFFunction*> FuncVector;
|
|
120
122
|
|
|
121
|
-
CHNode (const std::string name, NodeID i = 0, GNodeK k = 0):
|
|
123
|
+
CHNode (const std::string& name, NodeID i = 0, GNodeK k = 0):
|
|
122
124
|
GenericCHNodeTy(i, k), vtable(nullptr), className(name), flags(0)
|
|
123
125
|
{
|
|
124
126
|
}
|
|
@@ -213,6 +215,7 @@ typedef GenericGraph<CHNode, CHEdge> GenericCHGraphTy;
|
|
|
213
215
|
class CHGraph: public CommonCHGraph, public GenericCHGraphTy
|
|
214
216
|
{
|
|
215
217
|
friend class SVFIRWriter;
|
|
218
|
+
friend class SVFIRReader;
|
|
216
219
|
friend class CHGBuilder;
|
|
217
220
|
|
|
218
221
|
public:
|
|
@@ -39,6 +39,7 @@ namespace SVF
|
|
|
39
39
|
/// Forward declaration of some friend classes
|
|
40
40
|
///@{
|
|
41
41
|
template <typename, typename> class GenericGraphWriter;
|
|
42
|
+
template <typename, typename> class GenericGraphReader;
|
|
42
43
|
///@}
|
|
43
44
|
|
|
44
45
|
/*!
|
|
@@ -48,6 +49,7 @@ template<class NodeTy>
|
|
|
48
49
|
class GenericEdge
|
|
49
50
|
{
|
|
50
51
|
friend class SVFIRWriter;
|
|
52
|
+
friend class SVFIRReader;
|
|
51
53
|
|
|
52
54
|
public:
|
|
53
55
|
/// Node type
|
|
@@ -139,6 +141,7 @@ template<class NodeTy,class EdgeTy>
|
|
|
139
141
|
class GenericNode
|
|
140
142
|
{
|
|
141
143
|
friend class SVFIRWriter;
|
|
144
|
+
friend class SVFIRReader;
|
|
142
145
|
|
|
143
146
|
public:
|
|
144
147
|
typedef NodeTy NodeType;
|
|
@@ -341,7 +344,9 @@ template<class NodeTy, class EdgeTy>
|
|
|
341
344
|
class GenericGraph
|
|
342
345
|
{
|
|
343
346
|
friend class SVFIRWriter;
|
|
347
|
+
friend class SVFIRReader;
|
|
344
348
|
friend class GenericGraphWriter<NodeTy, EdgeTy>;
|
|
349
|
+
friend class GenericGraphReader<NodeTy, EdgeTy>;
|
|
345
350
|
|
|
346
351
|
public:
|
|
347
352
|
typedef NodeTy NodeType;
|
|
@@ -44,6 +44,7 @@ typedef GenericEdge<ICFGNode> GenericICFGEdgeTy;
|
|
|
44
44
|
class ICFGEdge : public GenericICFGEdgeTy
|
|
45
45
|
{
|
|
46
46
|
friend class SVFIRWriter;
|
|
47
|
+
friend class SVFIRReader;
|
|
47
48
|
|
|
48
49
|
public:
|
|
49
50
|
/// ten types of ICFG edge
|
|
@@ -112,6 +113,7 @@ public:
|
|
|
112
113
|
class IntraCFGEdge : public ICFGEdge
|
|
113
114
|
{
|
|
114
115
|
friend class SVFIRWriter;
|
|
116
|
+
friend class SVFIRReader;
|
|
115
117
|
|
|
116
118
|
public:
|
|
117
119
|
/// Constructor
|
|
@@ -174,6 +176,7 @@ private:
|
|
|
174
176
|
class CallCFGEdge : public ICFGEdge
|
|
175
177
|
{
|
|
176
178
|
friend class SVFIRWriter;
|
|
179
|
+
friend class SVFIRReader;
|
|
177
180
|
|
|
178
181
|
private:
|
|
179
182
|
const SVFInstruction* cs;
|
|
@@ -224,6 +227,7 @@ public:
|
|
|
224
227
|
class RetCFGEdge : public ICFGEdge
|
|
225
228
|
{
|
|
226
229
|
friend class SVFIRWriter;
|
|
230
|
+
friend class SVFIRReader;
|
|
227
231
|
|
|
228
232
|
private:
|
|
229
233
|
const SVFInstruction* cs;
|
|
@@ -54,6 +54,7 @@ typedef GenericNode<ICFGNode, ICFGEdge> GenericICFGNodeTy;
|
|
|
54
54
|
class ICFGNode : public GenericICFGNodeTy
|
|
55
55
|
{
|
|
56
56
|
friend class SVFIRWriter;
|
|
57
|
+
friend class SVFIRReader;
|
|
57
58
|
|
|
58
59
|
public:
|
|
59
60
|
/// 22 kinds of ICFG node
|
|
@@ -79,7 +80,6 @@ public:
|
|
|
79
80
|
/// Constructor
|
|
80
81
|
ICFGNode(NodeID i, ICFGNodeK k) : GenericICFGNodeTy(i, k), fun(nullptr), bb(nullptr)
|
|
81
82
|
{
|
|
82
|
-
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/// Return the function of this ICFGNode
|
|
@@ -151,7 +151,6 @@ class GlobalICFGNode : public ICFGNode
|
|
|
151
151
|
public:
|
|
152
152
|
GlobalICFGNode(NodeID id) : ICFGNode(id, GlobalBlock)
|
|
153
153
|
{
|
|
154
|
-
bb = nullptr;
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
@@ -181,9 +180,13 @@ public:
|
|
|
181
180
|
class IntraICFGNode : public ICFGNode
|
|
182
181
|
{
|
|
183
182
|
friend class SVFIRWriter;
|
|
183
|
+
friend class SVFIRReader;
|
|
184
184
|
private:
|
|
185
185
|
const SVFInstruction *inst;
|
|
186
186
|
|
|
187
|
+
/// Constructor to create empty IntraICFGNode (for SVFIRReader/deserialization)
|
|
188
|
+
IntraICFGNode(NodeID id) : ICFGNode(id, IntraBlock), inst(nullptr) {}
|
|
189
|
+
|
|
187
190
|
public:
|
|
188
191
|
IntraICFGNode(NodeID id, const SVFInstruction *i) : ICFGNode(id, IntraBlock), inst(i)
|
|
189
192
|
{
|
|
@@ -258,11 +261,16 @@ public:
|
|
|
258
261
|
class FunEntryICFGNode : public InterICFGNode
|
|
259
262
|
{
|
|
260
263
|
friend class SVFIRWriter;
|
|
264
|
+
friend class SVFIRReader;
|
|
261
265
|
|
|
262
266
|
public:
|
|
263
267
|
typedef std::vector<const SVFVar *> FormalParmNodeVec;
|
|
264
268
|
private:
|
|
265
269
|
FormalParmNodeVec FPNodes;
|
|
270
|
+
|
|
271
|
+
/// Constructor to create empty FunEntryICFGNode (for SVFIRReader/deserialization)
|
|
272
|
+
FunEntryICFGNode(NodeID id) : InterICFGNode(id, FunEntryBlock) {}
|
|
273
|
+
|
|
266
274
|
public:
|
|
267
275
|
FunEntryICFGNode(NodeID id, const SVFFunction* f);
|
|
268
276
|
|
|
@@ -316,9 +324,14 @@ public:
|
|
|
316
324
|
class FunExitICFGNode : public InterICFGNode
|
|
317
325
|
{
|
|
318
326
|
friend class SVFIRWriter;
|
|
327
|
+
friend class SVFIRReader;
|
|
319
328
|
|
|
320
329
|
private:
|
|
321
330
|
const SVFVar *formalRet;
|
|
331
|
+
|
|
332
|
+
/// Constructor to create empty FunExitICFGNode (for SVFIRReader/deserialization)
|
|
333
|
+
FunExitICFGNode(NodeID id) : InterICFGNode(id, FunExitBlock), formalRet{} {}
|
|
334
|
+
|
|
322
335
|
public:
|
|
323
336
|
FunExitICFGNode(NodeID id, const SVFFunction* f);
|
|
324
337
|
|
|
@@ -372,6 +385,7 @@ public:
|
|
|
372
385
|
class CallICFGNode : public InterICFGNode
|
|
373
386
|
{
|
|
374
387
|
friend class SVFIRWriter;
|
|
388
|
+
friend class SVFIRReader;
|
|
375
389
|
|
|
376
390
|
public:
|
|
377
391
|
typedef std::vector<const SVFVar *> ActualParmNodeVec;
|
|
@@ -379,6 +393,10 @@ private:
|
|
|
379
393
|
const SVFInstruction* cs;
|
|
380
394
|
const RetICFGNode* ret;
|
|
381
395
|
ActualParmNodeVec APNodes;
|
|
396
|
+
|
|
397
|
+
/// Constructor to create empty CallICFGNode (for SVFIRReader/deserialization)
|
|
398
|
+
CallICFGNode(NodeID id) : InterICFGNode(id, FunCallBlock), cs{}, ret{} {}
|
|
399
|
+
|
|
382
400
|
public:
|
|
383
401
|
CallICFGNode(NodeID id, const SVFInstruction* c)
|
|
384
402
|
: InterICFGNode(id, FunCallBlock), cs(c), ret(nullptr)
|
|
@@ -469,11 +487,19 @@ public:
|
|
|
469
487
|
class RetICFGNode : public InterICFGNode
|
|
470
488
|
{
|
|
471
489
|
friend class SVFIRWriter;
|
|
490
|
+
friend class SVFIRReader;
|
|
472
491
|
|
|
473
492
|
private:
|
|
474
493
|
const SVFInstruction* cs;
|
|
475
494
|
const SVFVar *actualRet;
|
|
476
495
|
const CallICFGNode* callBlockNode;
|
|
496
|
+
|
|
497
|
+
/// Constructor to create empty RetICFGNode (for SVFIRReader/deserialization)
|
|
498
|
+
RetICFGNode(NodeID id)
|
|
499
|
+
: InterICFGNode(id, FunRetBlock), cs{}, actualRet{}, callBlockNode{}
|
|
500
|
+
{
|
|
501
|
+
}
|
|
502
|
+
|
|
477
503
|
public:
|
|
478
504
|
RetICFGNode(NodeID id, const SVFInstruction* c, CallICFGNode* cb) :
|
|
479
505
|
InterICFGNode(id, FunRetBlock), cs(c), actualRet(nullptr), callBlockNode(cb)
|