svf-tools 1.0.1287 → 1.0.1289
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/CFL/CFLAlias.h +1 -1
- package/svf/include/CFL/CFLBase.h +3 -1
- package/svf/include/CFL/CFLVF.h +1 -1
- package/svf/include/DDA/FlowDDA.h +1 -1
- package/svf/include/Graphs/GraphWriter.h +1 -0
- package/svf/include/Graphs/SCC.h +1 -0
- package/svf/include/MTA/MTA.h +1 -0
- package/svf/include/MTA/TCT.h +1 -0
- package/svf/include/MemoryModel/PTATY.h +54 -0
- package/svf/include/MemoryModel/PointerAnalysis.h +2 -40
- package/svf/include/MemoryModel/PointerAnalysisImpl.h +8 -14
- package/svf/include/Util/Options.h +9 -6
- package/svf/include/Util/SVFStat.h +3 -1
- package/svf/include/WPA/Andersen.h +16 -15
- package/svf/include/WPA/AndersenPWC.h +3 -2
- package/svf/include/WPA/FlowSensitive.h +2 -2
- package/svf/include/WPA/VersionedFlowSensitive.h +3 -2
- package/svf/lib/AE/Core/AbstractState.cpp +2 -1
- package/svf/lib/DDA/ContextDDA.cpp +1 -1
- package/svf/lib/DDA/DDAPass.cpp +4 -5
- package/svf/lib/Graphs/CallGraph.cpp +2 -0
- package/svf/lib/Graphs/SVFG.cpp +3 -2
- package/svf/lib/Graphs/VFG.cpp +5 -4
- package/svf/lib/MSSA/MemRegion.cpp +1 -0
- package/svf/lib/MSSA/MemSSA.cpp +2 -1
- package/svf/lib/MemoryModel/AccessPath.cpp +3 -1
- package/svf/lib/MemoryModel/PointerAnalysis.cpp +2 -1
- package/svf/lib/MemoryModel/PointerAnalysisImpl.cpp +14 -13
- package/svf/lib/SVFIR/SVFIR.cpp +1 -0
- package/svf/lib/SVFIR/SVFVariables.cpp +1 -0
- package/svf/lib/Util/Options.cpp +27 -20
- package/svf/lib/Util/PTAStat.cpp +5 -4
- package/svf/lib/Util/SVFStat.cpp +3 -0
- package/svf/lib/Util/SVFUtil.cpp +5 -1
- package/svf/lib/WPA/VersionedFlowSensitive.cpp +1 -0
- package/svf/lib/WPA/WPAPass.cpp +14 -13
- package/svf-llvm/include/SVF-LLVM/LLVMModule.h +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1289",
|
|
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": {
|
|
@@ -36,8 +36,10 @@
|
|
|
36
36
|
#include "CFL/CFLGraphBuilder.h"
|
|
37
37
|
#include "CFL/CFLGramGraphChecker.h"
|
|
38
38
|
#include "MemoryModel/PointerAnalysis.h"
|
|
39
|
+
#include "MemoryModel/PointerAnalysisImpl.h"
|
|
39
40
|
#include "Graphs/ConsG.h"
|
|
40
41
|
#include "Util/Options.h"
|
|
42
|
+
#include "Util/PTAStat.h"
|
|
41
43
|
#include "SVFIR/SVFType.h"
|
|
42
44
|
|
|
43
45
|
namespace SVF
|
|
@@ -50,7 +52,7 @@ class CFLBase : public BVDataPTAImpl
|
|
|
50
52
|
{
|
|
51
53
|
|
|
52
54
|
public:
|
|
53
|
-
CFLBase(SVFIR* ir,
|
|
55
|
+
CFLBase(SVFIR* ir, PTATY pty) : BVDataPTAImpl(ir, pty), svfir(ir), graph(nullptr), grammar(nullptr), solver(nullptr)
|
|
54
56
|
{
|
|
55
57
|
}
|
|
56
58
|
|
package/svf/include/CFL/CFLVF.h
CHANGED
|
@@ -58,7 +58,7 @@ public:
|
|
|
58
58
|
typedef BVDataPTAImpl::CallEdgeMap CallEdgeMap;
|
|
59
59
|
typedef BVDataPTAImpl::FunctionSet FunctionSet;
|
|
60
60
|
/// Constructor
|
|
61
|
-
FlowDDA(SVFIR* _pag, DDAClient* client): BVDataPTAImpl(_pag,
|
|
61
|
+
FlowDDA(SVFIR* _pag, DDAClient* client): BVDataPTAImpl(_pag, PTATY::FlowS_DDA),
|
|
62
62
|
DDAVFSolver<NodeID,PointsTo,LocDPItem>(),
|
|
63
63
|
_client(client)
|
|
64
64
|
{
|
package/svf/include/Graphs/SCC.h
CHANGED
package/svf/include/MTA/MTA.h
CHANGED
package/svf/include/MTA/TCT.h
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
#ifndef PTATY_H
|
|
2
|
+
#define PTATY_H
|
|
3
|
+
|
|
4
|
+
namespace SVF {
|
|
5
|
+
|
|
6
|
+
/// Pointer analysis type list
|
|
7
|
+
enum PTATY
|
|
8
|
+
{
|
|
9
|
+
// Whole program analysis
|
|
10
|
+
Andersen_BASE, ///< Base Andersen PTA
|
|
11
|
+
Andersen_WPA, ///< Andersen PTA
|
|
12
|
+
AndersenSCD_WPA, ///< Selective cycle detection andersen-style WPA
|
|
13
|
+
AndersenSFR_WPA, ///< Stride-based field representation
|
|
14
|
+
AndersenWaveDiff_WPA, ///< Diff wave propagation andersen-style WPA
|
|
15
|
+
Steensgaard_WPA, ///< Steensgaard PTA
|
|
16
|
+
CSCallString_WPA, ///< Call string based context sensitive WPA
|
|
17
|
+
CSSummary_WPA, ///< Summary based context sensitive WPA
|
|
18
|
+
FSDATAFLOW_WPA, ///< Traditional Dataflow-based flow sensitive WPA
|
|
19
|
+
FSSPARSE_WPA, ///< Sparse flow sensitive WPA
|
|
20
|
+
VFS_WPA, ///< Versioned sparse flow-sensitive WPA
|
|
21
|
+
FSCS_WPA, ///< Flow-, context- sensitive WPA
|
|
22
|
+
CFLFICI_WPA, ///< Flow-, context-, insensitive CFL-reachability-based analysis
|
|
23
|
+
CFLFSCI_WPA, ///< Flow-insensitive, context-sensitive CFL-reachability-based analysis
|
|
24
|
+
CFLFSCS_WPA, ///< Flow-, context-, CFL-reachability-based analysis
|
|
25
|
+
TypeCPP_WPA, ///< Type-based analysis for C++
|
|
26
|
+
|
|
27
|
+
// Demand driven analysis
|
|
28
|
+
FieldS_DDA, ///< Field sensitive DDA
|
|
29
|
+
FlowS_DDA, ///< Flow sensitive DDA
|
|
30
|
+
PathS_DDA, ///< Guarded value-flow DDA
|
|
31
|
+
Cxt_DDA, ///< context sensitive DDA
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
Default_PTA ///< default pta without any analysis
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/// Implementation type: BVDataPTAImpl or CondPTAImpl.
|
|
38
|
+
enum PTAImplTy
|
|
39
|
+
{
|
|
40
|
+
BaseImpl, ///< Represents PointerAnalaysis.
|
|
41
|
+
BVDataImpl, ///< Represents BVDataPTAImpl.
|
|
42
|
+
CondImpl, ///< Represents CondPTAImpl.
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/// How the PTData used is implemented.
|
|
46
|
+
enum PTBackingType
|
|
47
|
+
{
|
|
48
|
+
Mutable,
|
|
49
|
+
Persistent,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
} // namespace SVF
|
|
53
|
+
|
|
54
|
+
#endif // PTATY_H
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
#include "MemoryModel/MutablePointsToDS.h"
|
|
42
42
|
#include "MemoryModel/PersistentPointsToDS.h"
|
|
43
43
|
#include "MemoryModel/PointsTo.h"
|
|
44
|
+
#include "MemoryModel/PTATY.h"
|
|
44
45
|
#include "SVFIR/SVFIR.h"
|
|
45
46
|
|
|
46
47
|
namespace SVF
|
|
@@ -57,45 +58,6 @@ class PointerAnalysis
|
|
|
57
58
|
{
|
|
58
59
|
|
|
59
60
|
public:
|
|
60
|
-
/// Pointer analysis type list
|
|
61
|
-
enum PTATY
|
|
62
|
-
{
|
|
63
|
-
// Whole program analysis
|
|
64
|
-
Andersen_BASE, ///< Base Andersen PTA
|
|
65
|
-
Andersen_WPA, ///< Andersen PTA
|
|
66
|
-
AndersenSCD_WPA, ///< Selective cycle detection andersen-style WPA
|
|
67
|
-
AndersenSFR_WPA, ///< Stride-based field representation
|
|
68
|
-
AndersenWaveDiff_WPA, ///< Diff wave propagation andersen-style WPA
|
|
69
|
-
Steensgaard_WPA, ///< Steensgaard PTA
|
|
70
|
-
CSCallString_WPA, ///< Call string based context sensitive WPA
|
|
71
|
-
CSSummary_WPA, ///< Summary based context sensitive WPA
|
|
72
|
-
FSDATAFLOW_WPA, ///< Traditional Dataflow-based flow sensitive WPA
|
|
73
|
-
FSSPARSE_WPA, ///< Sparse flow sensitive WPA
|
|
74
|
-
VFS_WPA, ///< Versioned sparse flow-sensitive WPA
|
|
75
|
-
FSCS_WPA, ///< Flow-, context- sensitive WPA
|
|
76
|
-
CFLFICI_WPA, ///< Flow-, context-, insensitive CFL-reachability-based analysis
|
|
77
|
-
CFLFSCI_WPA, ///< Flow-insensitive, context-sensitive CFL-reachability-based analysis
|
|
78
|
-
CFLFSCS_WPA, ///< Flow-, context-, CFL-reachability-based analysis
|
|
79
|
-
TypeCPP_WPA, ///< Type-based analysis for C++
|
|
80
|
-
|
|
81
|
-
// Demand driven analysis
|
|
82
|
-
FieldS_DDA, ///< Field sensitive DDA
|
|
83
|
-
FlowS_DDA, ///< Flow sensitive DDA
|
|
84
|
-
PathS_DDA, ///< Guarded value-flow DDA
|
|
85
|
-
Cxt_DDA, ///< context sensitive DDA
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
Default_PTA ///< default pta without any analysis
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
/// Implementation type: BVDataPTAImpl or CondPTAImpl.
|
|
92
|
-
enum PTAImplTy
|
|
93
|
-
{
|
|
94
|
-
BaseImpl, ///< Represents PointerAnalaysis.
|
|
95
|
-
BVDataImpl, ///< Represents BVDataPTAImpl.
|
|
96
|
-
CondImpl, ///< Represents CondPTAImpl.
|
|
97
|
-
};
|
|
98
|
-
|
|
99
61
|
/// Indirect call edges type, map a callsite to a set of callees
|
|
100
62
|
//@{
|
|
101
63
|
typedef Set<const CallICFGNode*> CallSiteSet;
|
|
@@ -176,7 +138,7 @@ public:
|
|
|
176
138
|
}
|
|
177
139
|
|
|
178
140
|
/// Constructor
|
|
179
|
-
PointerAnalysis(SVFIR* pag, PTATY ty = Default_PTA, bool alias_check = true);
|
|
141
|
+
PointerAnalysis(SVFIR* pag, PTATY ty = PTATY::Default_PTA, bool alias_check = true);
|
|
180
142
|
|
|
181
143
|
/// Type of pointer analysis
|
|
182
144
|
inline PTATY getAnalysisTy() const
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
#define INCLUDE_MEMORYMODEL_POINTERANALYSISIMPL_H_
|
|
32
32
|
|
|
33
33
|
#include <Graphs/ConsG.h>
|
|
34
|
+
#include "MemoryModel/PTATY.h"
|
|
34
35
|
#include "MemoryModel/PointerAnalysis.h"
|
|
35
36
|
|
|
36
37
|
namespace SVF
|
|
@@ -60,15 +61,8 @@ public:
|
|
|
60
61
|
typedef PersistentIncDFPTData<NodeID, NodeSet, NodeID, PointsTo> PersIncDFPTDataTy;
|
|
61
62
|
typedef PersistentVersionedPTData<NodeID, NodeSet, NodeID, PointsTo, VersionedVar, Set<VersionedVar>> PersVersionedPTDataTy;
|
|
62
63
|
|
|
63
|
-
/// How the PTData used is implemented.
|
|
64
|
-
enum PTBackingType
|
|
65
|
-
{
|
|
66
|
-
Mutable,
|
|
67
|
-
Persistent,
|
|
68
|
-
};
|
|
69
|
-
|
|
70
64
|
/// Constructor
|
|
71
|
-
BVDataPTAImpl(SVFIR* pag,
|
|
65
|
+
BVDataPTAImpl(SVFIR* pag, PTATY type, bool alias_check = true);
|
|
72
66
|
|
|
73
67
|
/// Destructor
|
|
74
68
|
~BVDataPTAImpl() override = default;
|
|
@@ -80,7 +74,7 @@ public:
|
|
|
80
74
|
|
|
81
75
|
static inline bool classof(const PointerAnalysis *pta)
|
|
82
76
|
{
|
|
83
|
-
return pta->getImplTy() == BVDataImpl;
|
|
77
|
+
return pta->getImplTy() == PTAImplTy::BVDataImpl;
|
|
84
78
|
}
|
|
85
79
|
|
|
86
80
|
/// Get points-to and reverse points-to
|
|
@@ -257,14 +251,14 @@ public:
|
|
|
257
251
|
typedef Map<NodeID,CPtSet> PtrToCPtsMap; /// map a pointer to its conditional points-to set
|
|
258
252
|
|
|
259
253
|
/// Constructor
|
|
260
|
-
CondPTAImpl(SVFIR* pag,
|
|
254
|
+
CondPTAImpl(SVFIR* pag, PTATY type) : PointerAnalysis(pag, type), normalized(false)
|
|
261
255
|
{
|
|
262
|
-
if (type == PathS_DDA || type == Cxt_DDA)
|
|
256
|
+
if (type == PTATY::PathS_DDA || type == PTATY::Cxt_DDA)
|
|
263
257
|
ptD = new MutPTDataTy();
|
|
264
258
|
else
|
|
265
259
|
assert(false && "no points-to data available");
|
|
266
260
|
|
|
267
|
-
ptaImplTy = CondImpl;
|
|
261
|
+
ptaImplTy = PTAImplTy::CondImpl;
|
|
268
262
|
}
|
|
269
263
|
|
|
270
264
|
/// Destructor
|
|
@@ -275,7 +269,7 @@ public:
|
|
|
275
269
|
|
|
276
270
|
static inline bool classof(const PointerAnalysis *pta)
|
|
277
271
|
{
|
|
278
|
-
return pta->getImplTy() == CondImpl;
|
|
272
|
+
return pta->getImplTy() == PTAImplTy::CondImpl;
|
|
279
273
|
}
|
|
280
274
|
|
|
281
275
|
/// Release memory
|
|
@@ -527,7 +521,7 @@ public:
|
|
|
527
521
|
expandFIObjs(pts2,cpts2);
|
|
528
522
|
if (containBlackHoleNode(cpts1) || containBlackHoleNode(cpts2))
|
|
529
523
|
return AliasResult::MayAlias;
|
|
530
|
-
else if(this->getAnalysisTy()==PathS_DDA && contains(cpts1,cpts2) && contains(cpts2,cpts1))
|
|
524
|
+
else if(this->getAnalysisTy() == PTATY::PathS_DDA && contains(cpts1,cpts2) && contains(cpts2,cpts1))
|
|
531
525
|
{
|
|
532
526
|
return AliasResult::MustAlias;
|
|
533
527
|
}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
#include <sstream>
|
|
7
7
|
#include "Util/CommandLine.h"
|
|
8
|
-
#include "Util/
|
|
9
|
-
#include "MemoryModel/
|
|
8
|
+
#include "Util/SVFStat.h"
|
|
9
|
+
#include "MemoryModel/PTATY.h"
|
|
10
10
|
#include "Util/NodeIDAllocator.h"
|
|
11
11
|
|
|
12
12
|
namespace SVF
|
|
@@ -18,7 +18,7 @@ class Options
|
|
|
18
18
|
public:
|
|
19
19
|
Options(void) = delete;
|
|
20
20
|
|
|
21
|
-
static const OptionMap<
|
|
21
|
+
static const OptionMap<SVFStat::ClockType> ClockType;
|
|
22
22
|
|
|
23
23
|
/// If set, only return the clock when getClk is called as getClk(true).
|
|
24
24
|
/// Retrieving the clock is slow but it should be fine for a few calls.
|
|
@@ -63,7 +63,7 @@ public:
|
|
|
63
63
|
static const Option<bool> PredictPtOcc;
|
|
64
64
|
|
|
65
65
|
/// PTData type.
|
|
66
|
-
static const OptionMap<
|
|
66
|
+
static const OptionMap<PTBackingType> ptDataBacking;
|
|
67
67
|
|
|
68
68
|
/// Time limit for the main phase (i.e., the actual solving) of FS analyses.
|
|
69
69
|
static const Option<u32_t> FsTimeLimit;
|
|
@@ -87,7 +87,7 @@ public:
|
|
|
87
87
|
static const Option<bool> PrintCPts;
|
|
88
88
|
static const Option<bool> PrintQueryPts;
|
|
89
89
|
static const Option<bool> WPANum;
|
|
90
|
-
static OptionMultiple<
|
|
90
|
+
static OptionMultiple<PTATY> DDASelected;
|
|
91
91
|
|
|
92
92
|
// FlowDDA.cpp
|
|
93
93
|
static const Option<u32_t> FlowBudget;
|
|
@@ -215,7 +215,7 @@ public:
|
|
|
215
215
|
static const Option<bool> AnderSVFG;
|
|
216
216
|
static const Option<bool> SABERFULLSVFG;
|
|
217
217
|
static const Option<bool> PrintAliases;
|
|
218
|
-
static OptionMultiple<
|
|
218
|
+
static OptionMultiple<PTATY> PASelected;
|
|
219
219
|
static OptionMultiple<u32_t> AliasRule;
|
|
220
220
|
|
|
221
221
|
// DOTGraphTraits
|
|
@@ -266,6 +266,9 @@ public:
|
|
|
266
266
|
|
|
267
267
|
// float precision for symbolic abstraction
|
|
268
268
|
static const Option<u32_t> AEPrecision;
|
|
269
|
+
|
|
270
|
+
// GraphWriter.h
|
|
271
|
+
static const Option<u32_t> MaxNodeLabelLength;
|
|
269
272
|
};
|
|
270
273
|
} // namespace SVF
|
|
271
274
|
|
|
@@ -30,6 +30,8 @@
|
|
|
30
30
|
#ifndef SVF_SVFSTAT_H
|
|
31
31
|
#define SVF_SVFSTAT_H
|
|
32
32
|
|
|
33
|
+
#include "MemoryModel/PointsTo.h"
|
|
34
|
+
|
|
33
35
|
namespace SVF
|
|
34
36
|
{
|
|
35
37
|
|
|
@@ -45,7 +47,7 @@ public:
|
|
|
45
47
|
|
|
46
48
|
typedef OrderedMap<std::string, double> TIMEStatMap;
|
|
47
49
|
|
|
48
|
-
enum ClockType
|
|
50
|
+
enum class ClockType
|
|
49
51
|
{
|
|
50
52
|
Wall,
|
|
51
53
|
CPU,
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
#ifndef INCLUDE_WPA_ANDERSEN_H_
|
|
36
36
|
#define INCLUDE_WPA_ANDERSEN_H_
|
|
37
37
|
|
|
38
|
+
#include "MemoryModel/PTATY.h"
|
|
38
39
|
#include "MemoryModel/PointerAnalysisImpl.h"
|
|
39
40
|
#include "WPA/WPAStat.h"
|
|
40
41
|
#include "WPA/WPASolver.h"
|
|
@@ -61,7 +62,7 @@ public:
|
|
|
61
62
|
public:
|
|
62
63
|
|
|
63
64
|
/// Constructor
|
|
64
|
-
AndersenBase(SVFIR* _pag, PTATY type = Andersen_BASE, bool alias_check = true)
|
|
65
|
+
AndersenBase(SVFIR* _pag, PTATY type = PTATY::Andersen_BASE, bool alias_check = true)
|
|
65
66
|
: BVDataPTAImpl(_pag, type, alias_check), consCG(nullptr)
|
|
66
67
|
{
|
|
67
68
|
iterationForPrintStat = OnTheFlyIterBudgetForStat;
|
|
@@ -107,13 +108,13 @@ public:
|
|
|
107
108
|
}
|
|
108
109
|
static inline bool classof(const PointerAnalysis *pta)
|
|
109
110
|
{
|
|
110
|
-
return ( pta->getAnalysisTy() == Andersen_BASE
|
|
111
|
-
|| pta->getAnalysisTy() == Andersen_WPA
|
|
112
|
-
|| pta->getAnalysisTy() == AndersenWaveDiff_WPA
|
|
113
|
-
|| pta->getAnalysisTy() == AndersenSCD_WPA
|
|
114
|
-
|| pta->getAnalysisTy() == AndersenSFR_WPA
|
|
115
|
-
|| pta->getAnalysisTy() == TypeCPP_WPA
|
|
116
|
-
|| pta->getAnalysisTy() == Steensgaard_WPA);
|
|
111
|
+
return ( pta->getAnalysisTy() == PTATY::Andersen_BASE
|
|
112
|
+
|| pta->getAnalysisTy() == PTATY::Andersen_WPA
|
|
113
|
+
|| pta->getAnalysisTy() == PTATY::AndersenWaveDiff_WPA
|
|
114
|
+
|| pta->getAnalysisTy() == PTATY::AndersenSCD_WPA
|
|
115
|
+
|| pta->getAnalysisTy() == PTATY::AndersenSFR_WPA
|
|
116
|
+
|| pta->getAnalysisTy() == PTATY::TypeCPP_WPA
|
|
117
|
+
|| pta->getAnalysisTy() == PTATY::Steensgaard_WPA);
|
|
117
118
|
}
|
|
118
119
|
//@}
|
|
119
120
|
|
|
@@ -193,7 +194,7 @@ public:
|
|
|
193
194
|
typedef SCCDetection<ConstraintGraph*> CGSCC;
|
|
194
195
|
|
|
195
196
|
/// Constructor
|
|
196
|
-
Andersen(SVFIR* _pag, PTATY type = Andersen_WPA, bool alias_check = true)
|
|
197
|
+
Andersen(SVFIR* _pag, PTATY type = PTATY::Andersen_WPA, bool alias_check = true)
|
|
197
198
|
: AndersenBase(_pag, type, alias_check)
|
|
198
199
|
{
|
|
199
200
|
}
|
|
@@ -227,10 +228,10 @@ public:
|
|
|
227
228
|
}
|
|
228
229
|
static inline bool classof(const PointerAnalysis *pta)
|
|
229
230
|
{
|
|
230
|
-
return (pta->getAnalysisTy() == Andersen_WPA
|
|
231
|
-
|| pta->getAnalysisTy() == AndersenWaveDiff_WPA
|
|
232
|
-
|| pta->getAnalysisTy() == AndersenSCD_WPA
|
|
233
|
-
|| pta->getAnalysisTy() == AndersenSFR_WPA);
|
|
231
|
+
return (pta->getAnalysisTy() == PTATY::Andersen_WPA
|
|
232
|
+
|| pta->getAnalysisTy() == PTATY::AndersenWaveDiff_WPA
|
|
233
|
+
|| pta->getAnalysisTy() == PTATY::AndersenSCD_WPA
|
|
234
|
+
|| pta->getAnalysisTy() == PTATY::AndersenSFR_WPA);
|
|
234
235
|
}
|
|
235
236
|
//@}
|
|
236
237
|
|
|
@@ -401,14 +402,14 @@ private:
|
|
|
401
402
|
static AndersenWaveDiff* diffWave; // static instance
|
|
402
403
|
|
|
403
404
|
public:
|
|
404
|
-
AndersenWaveDiff(SVFIR* _pag, PTATY type = AndersenWaveDiff_WPA, bool alias_check = true): Andersen(_pag, type, alias_check) {}
|
|
405
|
+
AndersenWaveDiff(SVFIR* _pag, PTATY type = PTATY::AndersenWaveDiff_WPA, bool alias_check = true): Andersen(_pag, type, alias_check) {}
|
|
405
406
|
|
|
406
407
|
/// Create an singleton instance directly instead of invoking llvm pass manager
|
|
407
408
|
static AndersenWaveDiff* createAndersenWaveDiff(SVFIR* _pag)
|
|
408
409
|
{
|
|
409
410
|
if(diffWave==nullptr)
|
|
410
411
|
{
|
|
411
|
-
diffWave = new AndersenWaveDiff(_pag, AndersenWaveDiff_WPA, false);
|
|
412
|
+
diffWave = new AndersenWaveDiff(_pag, PTATY::AndersenWaveDiff_WPA, false);
|
|
412
413
|
diffWave->analyze();
|
|
413
414
|
return diffWave;
|
|
414
415
|
}
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
#include "WPA/Andersen.h"
|
|
35
35
|
#include "WPA/CSC.h"
|
|
36
|
+
#include "MemoryModel/PTATY.h"
|
|
36
37
|
#include "MemoryModel/PointsTo.h"
|
|
37
38
|
|
|
38
39
|
namespace SVF
|
|
@@ -52,7 +53,7 @@ protected:
|
|
|
52
53
|
NodeToNodeMap pwcReps;
|
|
53
54
|
|
|
54
55
|
public:
|
|
55
|
-
AndersenSCD(SVFIR* _pag, PTATY type = AndersenSCD_WPA) :
|
|
56
|
+
AndersenSCD(SVFIR* _pag, PTATY type = PTATY::AndersenSCD_WPA) :
|
|
56
57
|
Andersen(_pag,type)
|
|
57
58
|
{
|
|
58
59
|
}
|
|
@@ -114,7 +115,7 @@ private:
|
|
|
114
115
|
FieldReps fieldReps;
|
|
115
116
|
|
|
116
117
|
public:
|
|
117
|
-
AndersenSFR(SVFIR* _pag, PTATY type = AndersenSFR_WPA) :
|
|
118
|
+
AndersenSFR(SVFIR* _pag, PTATY type = PTATY::AndersenSFR_WPA) :
|
|
118
119
|
AndersenSCD(_pag, type), csc(nullptr)
|
|
119
120
|
{
|
|
120
121
|
}
|
|
@@ -57,7 +57,7 @@ public:
|
|
|
57
57
|
typedef BVDataPTAImpl::MutDFPTDataTy::PtsMap PtsMap;
|
|
58
58
|
|
|
59
59
|
/// Constructor
|
|
60
|
-
explicit FlowSensitive(SVFIR* _pag, PTATY type = FSSPARSE_WPA) : WPASVFGFSSolver(), BVDataPTAImpl(_pag, type)
|
|
60
|
+
explicit FlowSensitive(SVFIR* _pag, PTATY type = PTATY::FSSPARSE_WPA) : WPASVFGFSSolver(), BVDataPTAImpl(_pag, type)
|
|
61
61
|
{
|
|
62
62
|
svfg = nullptr;
|
|
63
63
|
solveTime = sccTime = processTime = propagationTime = updateTime = 0;
|
|
@@ -126,7 +126,7 @@ public:
|
|
|
126
126
|
}
|
|
127
127
|
static inline bool classof(const PointerAnalysis *pta)
|
|
128
128
|
{
|
|
129
|
-
return pta->getAnalysisTy() == FSSPARSE_WPA;
|
|
129
|
+
return pta->getAnalysisTy() == PTATY::FSSPARSE_WPA;
|
|
130
130
|
}
|
|
131
131
|
//@}
|
|
132
132
|
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
#include "MSSA/SVFGBuilder.h"
|
|
19
19
|
#include "WPA/FlowSensitive.h"
|
|
20
20
|
#include "WPA/WPAFSSolver.h"
|
|
21
|
+
#include "MemoryModel/PTATY.h"
|
|
21
22
|
#include "MemoryModel/PointsTo.h"
|
|
22
23
|
|
|
23
24
|
namespace SVF
|
|
@@ -50,7 +51,7 @@ public:
|
|
|
50
51
|
static VersionedVar atKey(NodeID, Version);
|
|
51
52
|
|
|
52
53
|
/// Constructor
|
|
53
|
-
VersionedFlowSensitive(SVFIR *_pag, PTATY type = VFS_WPA);
|
|
54
|
+
VersionedFlowSensitive(SVFIR *_pag, PTATY type = PTATY::VFS_WPA);
|
|
54
55
|
|
|
55
56
|
/// Initialize analysis
|
|
56
57
|
virtual void initialize() override;
|
|
@@ -72,7 +73,7 @@ public:
|
|
|
72
73
|
}
|
|
73
74
|
static inline bool classof(const PointerAnalysis *pta)
|
|
74
75
|
{
|
|
75
|
-
return pta->getAnalysisTy() == VFS_WPA;
|
|
76
|
+
return pta->getAnalysisTy() == PTATY::VFS_WPA;
|
|
76
77
|
}
|
|
77
78
|
//@}
|
|
78
79
|
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
*
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
+
#include <iomanip>
|
|
30
31
|
#include "AE/Core/AbstractState.h"
|
|
31
32
|
#include "SVFIR/SVFIR.h"
|
|
32
33
|
#include "Util/SVFUtil.h"
|
|
@@ -341,4 +342,4 @@ bool AbstractState::geqVarToValMap(const VarToAbsValMap&lhs, const VarToAbsValMa
|
|
|
341
342
|
return false;
|
|
342
343
|
}
|
|
343
344
|
return true;
|
|
344
|
-
}
|
|
345
|
+
}
|
|
@@ -40,7 +40,7 @@ using namespace SVFUtil;
|
|
|
40
40
|
* Constructor
|
|
41
41
|
*/
|
|
42
42
|
ContextDDA::ContextDDA(SVFIR* _pag, DDAClient* client)
|
|
43
|
-
: CondPTAImpl<ContextCond>(_pag,
|
|
43
|
+
: CondPTAImpl<ContextCond>(_pag, PTATY::Cxt_DDA),DDAVFSolver<CxtVar,CxtPtSet,CxtLocDPItem>(),
|
|
44
44
|
_client(client)
|
|
45
45
|
{
|
|
46
46
|
flowDDA = new FlowDDA(_pag, client);
|
package/svf/lib/DDA/DDAPass.cpp
CHANGED
|
@@ -59,10 +59,9 @@ void DDAPass::runOnModule(SVFIR* pag)
|
|
|
59
59
|
|
|
60
60
|
selectClient();
|
|
61
61
|
|
|
62
|
-
for (u32_t i =
|
|
63
|
-
i < PointerAnalysis::Default_PTA; i++)
|
|
62
|
+
for (u32_t i = PTATY::FlowS_DDA; i < PTATY::Default_PTA; i++)
|
|
64
63
|
{
|
|
65
|
-
|
|
64
|
+
PTATY iPtTy = static_cast<PTATY>(i);
|
|
66
65
|
if (Options::DDASelected(iPtTy))
|
|
67
66
|
runPointerAnalysis(pag, i);
|
|
68
67
|
}
|
|
@@ -114,12 +113,12 @@ void DDAPass::runPointerAnalysis(SVFIR* pag, u32_t kind)
|
|
|
114
113
|
/// Initialize pointer analysis.
|
|
115
114
|
switch (kind)
|
|
116
115
|
{
|
|
117
|
-
case
|
|
116
|
+
case PTATY::Cxt_DDA:
|
|
118
117
|
{
|
|
119
118
|
_pta = std::make_unique<ContextDDA>(pag, _client);
|
|
120
119
|
break;
|
|
121
120
|
}
|
|
122
|
-
case
|
|
121
|
+
case PTATY::FlowS_DDA:
|
|
123
122
|
{
|
|
124
123
|
_pta = std::make_unique<FlowDDA>(pag, _client);
|
|
125
124
|
break;
|
package/svf/lib/Graphs/SVFG.cpp
CHANGED
|
@@ -852,10 +852,11 @@ struct DOTGraphTraits<SVFG*> : public DOTGraphTraits<SVFIR*>
|
|
|
852
852
|
|
|
853
853
|
std::string getNodeLabel(NodeType *node, SVFG *graph)
|
|
854
854
|
{
|
|
855
|
+
std::string cool = std::string(240, '-');
|
|
855
856
|
if (isSimple())
|
|
856
|
-
return getSimpleNodeLabel(node, graph);
|
|
857
|
+
return cool + getSimpleNodeLabel(node, graph);
|
|
857
858
|
else
|
|
858
|
-
return getCompleteNodeLabel(node, graph);
|
|
859
|
+
return cool + getCompleteNodeLabel(node, graph);
|
|
859
860
|
}
|
|
860
861
|
|
|
861
862
|
/// Return label of a VFG node without MemSSA information
|
package/svf/lib/Graphs/VFG.cpp
CHANGED
|
@@ -27,10 +27,11 @@
|
|
|
27
27
|
* Author: Yulei Sui
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
#include "MemoryModel/PointerAnalysis.h"
|
|
31
31
|
#include <Graphs/SVFGNode.h>
|
|
32
|
-
#include "
|
|
32
|
+
#include "Graphs/CallGraph.h"
|
|
33
33
|
#include "Graphs/VFG.h"
|
|
34
|
+
#include "Util/Options.h"
|
|
34
35
|
#include "Util/SVFUtil.h"
|
|
35
36
|
|
|
36
37
|
using namespace SVF;
|
|
@@ -928,8 +929,8 @@ void VFG::view()
|
|
|
928
929
|
void VFG::updateCallGraph(PointerAnalysis* pta)
|
|
929
930
|
{
|
|
930
931
|
VFGEdgeSetTy vfEdgesAtIndCallSite;
|
|
931
|
-
|
|
932
|
-
|
|
932
|
+
CallGraph::CallEdgeMap::const_iterator iter = pta->getIndCallMap().begin();
|
|
933
|
+
CallGraph::CallEdgeMap::const_iterator eiter = pta->getIndCallMap().end();
|
|
933
934
|
for (; iter != eiter; iter++)
|
|
934
935
|
{
|
|
935
936
|
const CallICFGNode* newcs = iter->first;
|
package/svf/lib/MSSA/MemSSA.cpp
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
#include "Util/Options.h"
|
|
31
|
+
#include "MemoryModel/PointerAnalysisImpl.h"
|
|
31
32
|
#include "MSSA/MemPartition.h"
|
|
32
33
|
#include "MSSA/MemSSA.h"
|
|
33
34
|
#include "Graphs/SVFGStat.h"
|
|
@@ -48,7 +49,7 @@ double MemSSA::timeOfSSARenaming = 0; ///< Time for SSA rename
|
|
|
48
49
|
MemSSA::MemSSA(BVDataPTAImpl* p, bool ptrOnlyMSSA)
|
|
49
50
|
{
|
|
50
51
|
pta = p;
|
|
51
|
-
assert((pta->getAnalysisTy()!=
|
|
52
|
+
assert((pta->getAnalysisTy() != PTATY::Default_PTA)
|
|
52
53
|
&& "please specify a pointer analysis");
|
|
53
54
|
|
|
54
55
|
if (Options::MemPar() == MemPartition::Distinct)
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
#include "Util/Options.h"
|
|
31
31
|
#include "Util/SVFUtil.h"
|
|
32
32
|
|
|
33
|
+
#include "MemoryModel/PTATY.h"
|
|
33
34
|
#include "MemoryModel/PointerAnalysisImpl.h"
|
|
34
35
|
#include "SVFIR/PAGBuilderFromFile.h"
|
|
35
36
|
#include "Util/PTAStat.h"
|
|
@@ -72,7 +73,7 @@ PointerAnalysis::PointerAnalysis(SVFIR *p, PTATY ty, bool alias_check) : ptaTy(t
|
|
|
72
73
|
pag = p;
|
|
73
74
|
OnTheFlyIterBudgetForStat = Options::StatBudget();
|
|
74
75
|
print_stat = Options::PStat();
|
|
75
|
-
ptaImplTy = BaseImpl;
|
|
76
|
+
ptaImplTy = PTAImplTy::BaseImpl;
|
|
76
77
|
alias_validation = (alias_check && Options::EnableAliasCheck());
|
|
77
78
|
}
|
|
78
79
|
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
31
|
|
|
32
|
+
#include "MemoryModel/PTATY.h"
|
|
32
33
|
#include "MemoryModel/PointerAnalysisImpl.h"
|
|
33
34
|
#include "Util/Options.h"
|
|
34
35
|
#include <fstream>
|
|
@@ -43,12 +44,12 @@ using namespace std;
|
|
|
43
44
|
/*!
|
|
44
45
|
* Constructor
|
|
45
46
|
*/
|
|
46
|
-
BVDataPTAImpl::BVDataPTAImpl(SVFIR* p,
|
|
47
|
+
BVDataPTAImpl::BVDataPTAImpl(SVFIR* p, PTATY type, bool alias_check) :
|
|
47
48
|
PointerAnalysis(p, type, alias_check), ptCache()
|
|
48
49
|
{
|
|
49
|
-
if (type == Andersen_BASE || type == Andersen_WPA || type == AndersenWaveDiff_WPA
|
|
50
|
-
|| type == TypeCPP_WPA || type == FlowS_DDA
|
|
51
|
-
|| type == AndersenSCD_WPA || type == AndersenSFR_WPA || type == CFLFICI_WPA || type == CFLFSCS_WPA)
|
|
50
|
+
if (type == PTATY::Andersen_BASE || type == PTATY::Andersen_WPA || type == PTATY::AndersenWaveDiff_WPA
|
|
51
|
+
|| type == PTATY::TypeCPP_WPA || type == PTATY::FlowS_DDA
|
|
52
|
+
|| type == PTATY::AndersenSCD_WPA || type == PTATY::AndersenSFR_WPA || type == PTATY::CFLFICI_WPA || type == PTATY::CFLFSCS_WPA)
|
|
52
53
|
{
|
|
53
54
|
// Only maintain reverse points-to when the analysis is field-sensitive, as objects turning
|
|
54
55
|
// field-insensitive is all it is used for.
|
|
@@ -57,14 +58,14 @@ BVDataPTAImpl::BVDataPTAImpl(SVFIR* p, PointerAnalysis::PTATY type, bool alias_c
|
|
|
57
58
|
else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersDiffPTDataTy>(getPtCache(), maintainRevPts);
|
|
58
59
|
else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
|
|
59
60
|
}
|
|
60
|
-
else if (type == Steensgaard_WPA)
|
|
61
|
+
else if (type == PTATY::Steensgaard_WPA)
|
|
61
62
|
{
|
|
62
63
|
// Steensgaard is only field-insensitive (for now?), so no reverse points-to.
|
|
63
64
|
if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutDiffPTDataTy>(false);
|
|
64
65
|
else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersDiffPTDataTy>(getPtCache(), false);
|
|
65
66
|
else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
|
|
66
67
|
}
|
|
67
|
-
else if (type == FSSPARSE_WPA)
|
|
68
|
+
else if (type == PTATY::FSSPARSE_WPA)
|
|
68
69
|
{
|
|
69
70
|
if (Options::INCDFPTData())
|
|
70
71
|
{
|
|
@@ -79,7 +80,7 @@ BVDataPTAImpl::BVDataPTAImpl(SVFIR* p, PointerAnalysis::PTATY type, bool alias_c
|
|
|
79
80
|
else assert(false && "BVDataPTAImpl::BVDataPTAImpl: unexpected points-to backing type!");
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
|
-
else if (type == VFS_WPA)
|
|
83
|
+
else if (type == PTATY::VFS_WPA)
|
|
83
84
|
{
|
|
84
85
|
if (Options::ptDataBacking() == PTBackingType::Mutable) ptD = std::make_unique<MutVersionedPTDataTy>(false);
|
|
85
86
|
else if (Options::ptDataBacking() == PTBackingType::Persistent) ptD = std::make_unique<PersVersionedPTDataTy>(getPtCache(), false);
|
|
@@ -87,7 +88,7 @@ BVDataPTAImpl::BVDataPTAImpl(SVFIR* p, PointerAnalysis::PTATY type, bool alias_c
|
|
|
87
88
|
}
|
|
88
89
|
else assert(false && "no points-to data available");
|
|
89
90
|
|
|
90
|
-
ptaImplTy = BVDataImpl;
|
|
91
|
+
ptaImplTy = PTAImplTy::BVDataImpl;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
void BVDataPTAImpl::finalize()
|
|
@@ -104,15 +105,15 @@ void BVDataPTAImpl::finalize()
|
|
|
104
105
|
|
|
105
106
|
std::string subtitle;
|
|
106
107
|
|
|
107
|
-
if(ptaTy >= Andersen_BASE && ptaTy <= Steensgaard_WPA)
|
|
108
|
+
if(ptaTy >= PTATY::Andersen_BASE && ptaTy <= PTATY::Steensgaard_WPA)
|
|
108
109
|
subtitle = "Andersen's analysis bitvector";
|
|
109
|
-
else if(ptaTy >=FSDATAFLOW_WPA && ptaTy <=FSCS_WPA)
|
|
110
|
+
else if(ptaTy >= PTATY::FSDATAFLOW_WPA && ptaTy <= PTATY::FSCS_WPA)
|
|
110
111
|
subtitle = "flow-sensitive analysis bitvector";
|
|
111
|
-
else if(ptaTy >=CFLFICI_WPA && ptaTy <=CFLFSCS_WPA)
|
|
112
|
+
else if(ptaTy >= PTATY::CFLFICI_WPA && ptaTy <= PTATY::CFLFSCS_WPA)
|
|
112
113
|
subtitle = "CFL analysis bitvector";
|
|
113
|
-
else if(ptaTy == TypeCPP_WPA)
|
|
114
|
+
else if(ptaTy == PTATY::TypeCPP_WPA)
|
|
114
115
|
subtitle = "Type analysis bitvector";
|
|
115
|
-
else if(ptaTy >=FieldS_DDA && ptaTy <=Cxt_DDA)
|
|
116
|
+
else if(ptaTy >= PTATY::FieldS_DDA && ptaTy <= PTATY::Cxt_DDA)
|
|
116
117
|
subtitle = "DDA bitvector";
|
|
117
118
|
else
|
|
118
119
|
subtitle = "bitvector";
|
package/svf/lib/SVFIR/SVFIR.cpp
CHANGED
package/svf/lib/Util/Options.cpp
CHANGED
|
@@ -4,19 +4,20 @@
|
|
|
4
4
|
#include "Util/CommandLine.h"
|
|
5
5
|
#include "FastCluster/fastcluster.h"
|
|
6
6
|
#include "Util/ExtAPI.h"
|
|
7
|
+
#include "MemoryModel/PTATY.h"
|
|
7
8
|
#include "MSSA/MemSSA.h"
|
|
8
9
|
#include "WPA/WPAPass.h"
|
|
9
10
|
#include "AE/Svfexe/AbstractInterpretation.h"
|
|
10
11
|
|
|
11
12
|
namespace SVF
|
|
12
13
|
{
|
|
13
|
-
const OptionMap<enum
|
|
14
|
+
const OptionMap<enum SVFStat::ClockType> Options::ClockType(
|
|
14
15
|
"clock-type",
|
|
15
16
|
"how time should be measured",
|
|
16
|
-
|
|
17
|
+
SVFStat::ClockType::CPU,
|
|
17
18
|
{
|
|
18
|
-
{
|
|
19
|
-
{
|
|
19
|
+
{SVFStat::ClockType::Wall, "wall", "use wall time"},
|
|
20
|
+
{SVFStat::ClockType::CPU, "cpu", "use CPU time"},
|
|
20
21
|
}
|
|
21
22
|
);
|
|
22
23
|
|
|
@@ -44,13 +45,13 @@ const Option<u32_t> Options::MaxFieldLimit(
|
|
|
44
45
|
512
|
|
45
46
|
);
|
|
46
47
|
|
|
47
|
-
const OptionMap<
|
|
48
|
+
const OptionMap<PTBackingType> Options::ptDataBacking(
|
|
48
49
|
"ptd",
|
|
49
50
|
"Overarching points-to data structure",
|
|
50
|
-
|
|
51
|
+
PTBackingType::Persistent,
|
|
51
52
|
{
|
|
52
|
-
{
|
|
53
|
-
{
|
|
53
|
+
{PTBackingType::Mutable, "mutable", "points-to set per pointer"},
|
|
54
|
+
{PTBackingType::Persistent, "persistent", "points-to set ID per pointer, operations hash-consed"},
|
|
54
55
|
}
|
|
55
56
|
);
|
|
56
57
|
|
|
@@ -136,11 +137,11 @@ const Option<bool> Options::WPANum(
|
|
|
136
137
|
|
|
137
138
|
/// register this into alias analysis group
|
|
138
139
|
//static RegisterAnalysisGroup<AliasAnalysis> AA_GROUP(DDAPA);
|
|
139
|
-
OptionMultiple<
|
|
140
|
+
OptionMultiple<PTATY> Options::DDASelected(
|
|
140
141
|
"Select pointer analysis",
|
|
141
142
|
{
|
|
142
|
-
{
|
|
143
|
-
{
|
|
143
|
+
{PTATY::FlowS_DDA, "dfs", "Demand-driven flow sensitive analysis"},
|
|
144
|
+
{PTATY::Cxt_DDA, "cxt", "Demand-driven context- flow- sensitive analysis"},
|
|
144
145
|
}
|
|
145
146
|
);
|
|
146
147
|
|
|
@@ -677,18 +678,18 @@ const Option<bool> Options::PrintAliases(
|
|
|
677
678
|
false
|
|
678
679
|
);
|
|
679
680
|
|
|
680
|
-
OptionMultiple<
|
|
681
|
+
OptionMultiple<PTATY> Options::PASelected(
|
|
681
682
|
"Select pointer analysis",
|
|
682
683
|
{
|
|
683
|
-
{
|
|
684
|
-
{
|
|
685
|
-
{
|
|
686
|
-
{
|
|
687
|
-
{
|
|
684
|
+
{PTATY::Andersen_WPA, "nander", "Standard inclusion-based analysis"},
|
|
685
|
+
{PTATY::AndersenSCD_WPA, "sander", "Selective cycle detection inclusion-based analysis"},
|
|
686
|
+
{PTATY::AndersenSFR_WPA, "sfrander", "Stride-based field representation inclusion-based analysis"},
|
|
687
|
+
{PTATY::AndersenWaveDiff_WPA, "ander", "Diff wave propagation inclusion-based analysis"},
|
|
688
|
+
{PTATY::Steensgaard_WPA, "steens", "Steensgaard's pointer analysis"},
|
|
688
689
|
// Disabled till further work is done.
|
|
689
|
-
{
|
|
690
|
-
{
|
|
691
|
-
{
|
|
690
|
+
{PTATY::FSSPARSE_WPA, "fspta", "Sparse flow sensitive pointer analysis"},
|
|
691
|
+
{PTATY::VFS_WPA, "vfspta", "Versioned sparse flow-sensitive points-to analysis"},
|
|
692
|
+
{PTATY::TypeCPP_WPA, "type", "Type-based fast analysis for Callgraph, SVFIR and CHA"},
|
|
692
693
|
}
|
|
693
694
|
);
|
|
694
695
|
|
|
@@ -856,4 +857,10 @@ const Option<u32_t> Options::AEPrecision(
|
|
|
856
857
|
0
|
|
857
858
|
);
|
|
858
859
|
|
|
860
|
+
const Option<u32_t> Options::MaxNodeLabelLength(
|
|
861
|
+
"max-node-label-length",
|
|
862
|
+
"maxmimum length of dumped graph node labels",
|
|
863
|
+
250
|
|
864
|
+
);
|
|
865
|
+
|
|
859
866
|
} // namespace SVF.
|
package/svf/lib/Util/PTAStat.cpp
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
#include <iomanip>
|
|
31
31
|
#include "Graphs/CallGraph.h"
|
|
32
32
|
#include "Util/PTAStat.h"
|
|
33
|
+
#include "MemoryModel/PTATY.h"
|
|
33
34
|
#include "MemoryModel/PointerAnalysisImpl.h"
|
|
34
35
|
#include "SVFIR/SVFIR.h"
|
|
35
36
|
|
|
@@ -129,13 +130,13 @@ void PTAStat::callgraphStat()
|
|
|
129
130
|
PTNumStatMap["TotalEdge"] = totalEdge;
|
|
130
131
|
PTNumStatMap["CalRetPairInCycle"] = edgeInCycle;
|
|
131
132
|
|
|
132
|
-
if(pta->getAnalysisTy() >=
|
|
133
|
+
if(pta->getAnalysisTy() >= PTATY::Andersen_BASE && pta->getAnalysisTy() <= PTATY::Steensgaard_WPA)
|
|
133
134
|
SVFStat::printStat("PTACallGraph Stats (Andersen analysis)");
|
|
134
|
-
else if(pta->getAnalysisTy() >=
|
|
135
|
+
else if(pta->getAnalysisTy() >= PTATY::FSDATAFLOW_WPA && pta->getAnalysisTy() <= PTATY::FSCS_WPA)
|
|
135
136
|
SVFStat::printStat("PTACallGraph Stats (Flow-sensitive analysis)");
|
|
136
|
-
else if(pta->getAnalysisTy() >=
|
|
137
|
+
else if(pta->getAnalysisTy() >= PTATY::CFLFICI_WPA && pta->getAnalysisTy() <= PTATY::CFLFSCS_WPA)
|
|
137
138
|
SVFStat::printStat("PTACallGraph Stats (CFL-R analysis)");
|
|
138
|
-
else if(pta->getAnalysisTy() >=
|
|
139
|
+
else if(pta->getAnalysisTy() >= PTATY::FieldS_DDA && pta->getAnalysisTy() <= PTATY::Cxt_DDA)
|
|
139
140
|
SVFStat::printStat("PTACallGraph Stats (DDA analysis)");
|
|
140
141
|
else
|
|
141
142
|
SVFStat::printStat("PTACallGraph Stats");
|
package/svf/lib/Util/SVFStat.cpp
CHANGED
package/svf/lib/Util/SVFUtil.cpp
CHANGED
|
@@ -27,10 +27,14 @@
|
|
|
27
27
|
* Author: Yulei Sui
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
|
+
#include <unistd.h>
|
|
31
|
+
#include <signal.h>
|
|
32
|
+
|
|
30
33
|
#include "Util/Options.h"
|
|
31
34
|
#include "Util/SVFUtil.h"
|
|
32
35
|
#include "MemoryModel/PointsTo.h"
|
|
33
36
|
#include "Graphs/CallGraph.h"
|
|
37
|
+
#include "SVFIR/SVFIR.h"
|
|
34
38
|
#include "SVFIR/SVFVariables.h"
|
|
35
39
|
|
|
36
40
|
#include <sys/resource.h> /// increase stack size
|
|
@@ -443,4 +447,4 @@ bool SVFUtil::isProgEntryFunction(const FunObjVar* funObjVar)
|
|
|
443
447
|
{
|
|
444
448
|
const char* main_name=Options::SVFMain() ? "svf.main" : "main";
|
|
445
449
|
return funObjVar && funObjVar->getName() == main_name;
|
|
446
|
-
}
|
|
450
|
+
}
|
package/svf/lib/WPA/WPAPass.cpp
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
#include "Util/Options.h"
|
|
37
|
+
#include "MemoryModel/PTATY.h"
|
|
37
38
|
#include "MemoryModel/PointerAnalysisImpl.h"
|
|
38
39
|
#include "WPA/WPAPass.h"
|
|
39
40
|
#include "WPA/Andersen.h"
|
|
@@ -67,9 +68,9 @@ WPAPass::~WPAPass()
|
|
|
67
68
|
*/
|
|
68
69
|
void WPAPass::runOnModule(SVFIR* pag)
|
|
69
70
|
{
|
|
70
|
-
for (u32_t i = 0; i<=
|
|
71
|
+
for (u32_t i = 0; i<= PTATY::Default_PTA; i++)
|
|
71
72
|
{
|
|
72
|
-
|
|
73
|
+
PTATY iPtaTy = static_cast<PTATY>(i);
|
|
73
74
|
if (Options::PASelected(iPtaTy))
|
|
74
75
|
runPointerAnalysis(pag, i);
|
|
75
76
|
}
|
|
@@ -84,28 +85,28 @@ void WPAPass::runPointerAnalysis(SVFIR* pag, u32_t kind)
|
|
|
84
85
|
/// Initialize pointer analysis.
|
|
85
86
|
switch (kind)
|
|
86
87
|
{
|
|
87
|
-
case
|
|
88
|
+
case PTATY::Andersen_WPA:
|
|
88
89
|
_pta = new Andersen(pag);
|
|
89
90
|
break;
|
|
90
|
-
case
|
|
91
|
+
case PTATY::AndersenSCD_WPA:
|
|
91
92
|
_pta = new AndersenSCD(pag);
|
|
92
93
|
break;
|
|
93
|
-
case
|
|
94
|
+
case PTATY::AndersenSFR_WPA:
|
|
94
95
|
_pta = new AndersenSFR(pag);
|
|
95
96
|
break;
|
|
96
|
-
case
|
|
97
|
+
case PTATY::AndersenWaveDiff_WPA:
|
|
97
98
|
_pta = new AndersenWaveDiff(pag);
|
|
98
99
|
break;
|
|
99
|
-
case
|
|
100
|
+
case PTATY::Steensgaard_WPA:
|
|
100
101
|
_pta = new Steensgaard(pag);
|
|
101
102
|
break;
|
|
102
|
-
case
|
|
103
|
+
case PTATY::FSSPARSE_WPA:
|
|
103
104
|
_pta = new FlowSensitive(pag);
|
|
104
105
|
break;
|
|
105
|
-
case
|
|
106
|
+
case PTATY::VFS_WPA:
|
|
106
107
|
_pta = new VersionedFlowSensitive(pag);
|
|
107
108
|
break;
|
|
108
|
-
case
|
|
109
|
+
case PTATY::TypeCPP_WPA:
|
|
109
110
|
_pta = new TypeAnalysis(pag);
|
|
110
111
|
break;
|
|
111
112
|
default:
|
|
@@ -121,7 +122,7 @@ void WPAPass::runPointerAnalysis(SVFIR* pag, u32_t kind)
|
|
|
121
122
|
assert(SVFUtil::isa<AndersenBase>(_pta) && "supports only andersen/steensgaard for pre-computed SVFG");
|
|
122
123
|
SVFG *svfg = memSSA.buildFullSVFG((BVDataPTAImpl*)_pta);
|
|
123
124
|
/// support mod-ref queries only for -ander
|
|
124
|
-
if (Options::PASelected(
|
|
125
|
+
if (Options::PASelected(PTATY::AndersenWaveDiff_WPA))
|
|
125
126
|
_svfg = svfg;
|
|
126
127
|
}
|
|
127
128
|
|
|
@@ -165,7 +166,7 @@ const PointsTo& WPAPass::getPts(NodeID var)
|
|
|
165
166
|
*/
|
|
166
167
|
ModRefInfo WPAPass::getModRefInfo(const CallICFGNode* callInst)
|
|
167
168
|
{
|
|
168
|
-
assert(Options::PASelected(
|
|
169
|
+
assert(Options::PASelected(PTATY::AndersenWaveDiff_WPA) && Options::AnderSVFG() && "mod-ref query is only support with -ander and -svfg turned on");
|
|
169
170
|
return _svfg->getMSSA()->getMRGenerator()->getModRefInfo(callInst);
|
|
170
171
|
}
|
|
171
172
|
|
|
@@ -175,6 +176,6 @@ ModRefInfo WPAPass::getModRefInfo(const CallICFGNode* callInst)
|
|
|
175
176
|
*/
|
|
176
177
|
ModRefInfo WPAPass::getModRefInfo(const CallICFGNode* callInst1, const CallICFGNode* callInst2)
|
|
177
178
|
{
|
|
178
|
-
assert(Options::PASelected(
|
|
179
|
+
assert(Options::PASelected(PTATY::AndersenWaveDiff_WPA) && Options::AnderSVFG() && "mod-ref query is only support with -ander and -svfg turned on");
|
|
179
180
|
return _svfg->getMSSA()->getMRGenerator()->getModRefInfo(callInst1, callInst2);
|
|
180
181
|
}
|