svf-lib 1.0.1328 → 1.0.1330
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/DDA/DDAPass.h +1 -1
- package/SVF-linux/include/DDA/FlowDDA.h +1 -1
- package/SVF-linux/include/Graphs/ICFG.h +1 -1
- package/SVF-linux/include/Graphs/SVFG.h +3 -4
- package/SVF-linux/include/Graphs/SVFGOPT.h +7 -7
- package/SVF-linux/include/MSSA/MemSSA.h +2 -0
- package/SVF-linux/include/MSSA/SVFGBuilder.h +5 -14
- package/SVF-linux/include/MTA/MTA.h +2 -2
- package/SVF-linux/include/MemoryModel/MutablePointsToDS.h +3 -3
- package/SVF-linux/include/MemoryModel/PersistentPointsToCache.h +7 -8
- package/SVF-linux/include/MemoryModel/PersistentPointsToDS.h +93 -93
- package/SVF-linux/include/MemoryModel/PointerAnalysisImpl.h +17 -28
- package/SVF-linux/include/MemoryModel/PointsTo.h +24 -24
- package/SVF-linux/include/SABER/SrcSnkDDA.h +10 -13
- package/SVF-linux/include/SVF-LLVM/LLVMLoopAnalysis.h +2 -1
- package/SVF-linux/include/SVF-LLVM/LLVMModule.h +6 -6
- package/SVF-linux/include/SVFIR/SVFIR.h +3 -5
- package/SVF-linux/include/SVFIR/SVFType.h +6 -8
- package/SVF-linux/include/SVFIR/SVFValue.h +3 -3
- package/SVF-linux/include/Util/Options.h +0 -1
- package/SVF-linux/include/Util/SparseBitVector.h +6 -14
- package/SVF-linux/include/WPA/FlowSensitive.h +13 -20
- package/SVF-linux/include/WPA/WPASolver.h +5 -9
- package/SVF-osx/Release-build/lib/libSvf.a +0 -0
- package/package.json +1 -1
|
Binary file
|
|
@@ -89,7 +89,7 @@ private:
|
|
|
89
89
|
void collectCxtInsenEdgeForRecur(PointerAnalysis* pta, const SVFG* svfg,SVFGEdgeSet& insensitveEdges);
|
|
90
90
|
void collectCxtInsenEdgeForVFCycle(PointerAnalysis* pta, const SVFG* svfg,const SVFGSCC* svfgSCC, SVFGEdgeSet& insensitveEdges);
|
|
91
91
|
|
|
92
|
-
PointerAnalysis
|
|
92
|
+
std::unique_ptr<PointerAnalysis> _pta; ///< pointer analysis to be executed.
|
|
93
93
|
DDAClient* _client; ///< DDA client used
|
|
94
94
|
|
|
95
95
|
};
|
|
@@ -158,7 +158,7 @@ public:
|
|
|
158
158
|
//@}
|
|
159
159
|
|
|
160
160
|
/// Union pts
|
|
161
|
-
|
|
161
|
+
bool unionDDAPts(LocDPItem dpm, const PointsTo& targetPts) override
|
|
162
162
|
{
|
|
163
163
|
if (isTopLevelPtrStmt(dpm.getLoc())) return unionPts(dpm.getCurNodeID(), targetPts);
|
|
164
164
|
else return dpmToADCPtSetMap[dpm] |= targetPts;
|
|
@@ -102,14 +102,14 @@ protected:
|
|
|
102
102
|
FunctionToFormalINsMapTy funToFormalINMap;
|
|
103
103
|
FunctionToFormalOUTsMapTy funToFormalOUTMap;
|
|
104
104
|
SVFGStat * stat;
|
|
105
|
-
MemSSA
|
|
105
|
+
std::unique_ptr<MemSSA> mssa;
|
|
106
106
|
PointerAnalysis* pta;
|
|
107
107
|
|
|
108
108
|
/// Clean up memory
|
|
109
109
|
void destroy();
|
|
110
110
|
|
|
111
111
|
/// Constructor
|
|
112
|
-
SVFG(MemSSA
|
|
112
|
+
SVFG(std::unique_ptr<MemSSA> mssa, VFGK k);
|
|
113
113
|
|
|
114
114
|
/// Start building SVFG
|
|
115
115
|
virtual void buildSVFG();
|
|
@@ -130,14 +130,13 @@ public:
|
|
|
130
130
|
/// Clear MSSA
|
|
131
131
|
inline void clearMSSA()
|
|
132
132
|
{
|
|
133
|
-
delete mssa;
|
|
134
133
|
mssa = nullptr;
|
|
135
134
|
}
|
|
136
135
|
|
|
137
136
|
/// Get SVFG memory SSA
|
|
138
137
|
inline MemSSA* getMSSA() const
|
|
139
138
|
{
|
|
140
|
-
return mssa;
|
|
139
|
+
return mssa.get();
|
|
141
140
|
}
|
|
142
141
|
|
|
143
142
|
/// Get Pointer Analysis
|
|
@@ -61,12 +61,12 @@ class SVFGOPT : public SVFG
|
|
|
61
61
|
|
|
62
62
|
public:
|
|
63
63
|
/// Constructor
|
|
64
|
-
SVFGOPT(MemSSA
|
|
64
|
+
SVFGOPT(std::unique_ptr<MemSSA> mssa, VFGK kind) : SVFG(std::move(mssa), kind)
|
|
65
65
|
{
|
|
66
66
|
keepAllSelfCycle = keepContextSelfCycle = keepActualOutFormalIn = false;
|
|
67
67
|
}
|
|
68
68
|
/// Destructor
|
|
69
|
-
|
|
69
|
+
~SVFGOPT() override = default;
|
|
70
70
|
|
|
71
71
|
inline void setTokeepActualOutFormalIn()
|
|
72
72
|
{
|
|
@@ -82,11 +82,11 @@ public:
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
protected:
|
|
85
|
-
|
|
85
|
+
void buildSVFG() override;
|
|
86
86
|
|
|
87
87
|
/// Connect SVFG nodes between caller and callee for indirect call sites
|
|
88
88
|
//@{
|
|
89
|
-
|
|
89
|
+
inline void connectAParamAndFParam(const PAGNode* cs_arg, const PAGNode* fun_arg, const CallICFGNode*, CallSiteID csId, SVFGEdgeSetTy& edges) override
|
|
90
90
|
{
|
|
91
91
|
NodeID phiId = getDef(fun_arg);
|
|
92
92
|
SVFGEdge* edge = addCallEdge(getDef(cs_arg), phiId, csId);
|
|
@@ -98,7 +98,7 @@ protected:
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
/// Connect formal-ret and actual ret
|
|
101
|
-
|
|
101
|
+
inline void connectFRetAndARet(const PAGNode* fun_ret, const PAGNode* cs_ret, CallSiteID csId, SVFGEdgeSetTy& edges) override
|
|
102
102
|
{
|
|
103
103
|
NodeID phiId = getDef(cs_ret);
|
|
104
104
|
NodeID retdef = getDef(fun_ret);
|
|
@@ -117,7 +117,7 @@ protected:
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
/// Connect actual-in and formal-in
|
|
120
|
-
|
|
120
|
+
inline void connectAInAndFIn(const ActualINSVFGNode* actualIn, const FormalINSVFGNode* formalIn, CallSiteID csId, SVFGEdgeSetTy& edges) override
|
|
121
121
|
{
|
|
122
122
|
NodeBS intersection = actualIn->getPointsTo();
|
|
123
123
|
intersection &= formalIn->getPointsTo();
|
|
@@ -130,7 +130,7 @@ protected:
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
/// Connect formal-out and actual-out
|
|
133
|
-
|
|
133
|
+
inline void connectFOutAndAOut(const FormalOUTSVFGNode* formalOut, const ActualOUTSVFGNode* actualOut, CallSiteID csId, SVFGEdgeSetTy& edges) override
|
|
134
134
|
{
|
|
135
135
|
NodeBS intersection = formalOut->getPointsTo();
|
|
136
136
|
intersection &= actualOut->getPointsTo();
|
|
@@ -49,27 +49,18 @@ public:
|
|
|
49
49
|
typedef SVFG::SVFGEdgeSetTy SVFGEdgeSet;
|
|
50
50
|
|
|
51
51
|
/// Constructor
|
|
52
|
-
SVFGBuilder(bool _SVFGWithIndCall = false): svfg(nullptr), SVFGWithIndCall(_SVFGWithIndCall) {}
|
|
52
|
+
explicit SVFGBuilder(bool _SVFGWithIndCall = false): svfg(nullptr), SVFGWithIndCall(_SVFGWithIndCall) {}
|
|
53
53
|
|
|
54
54
|
/// Destructor
|
|
55
|
-
virtual ~SVFGBuilder()
|
|
56
|
-
|
|
57
|
-
static SVFG* globalSvfg;
|
|
55
|
+
virtual ~SVFGBuilder() = default;
|
|
58
56
|
|
|
59
57
|
SVFG* buildPTROnlySVFG(BVDataPTAImpl* pta);
|
|
60
58
|
SVFG* buildFullSVFG(BVDataPTAImpl* pta);
|
|
61
59
|
|
|
62
|
-
/// Clean up
|
|
63
|
-
static void releaseSVFG()
|
|
64
|
-
{
|
|
65
|
-
if (globalSvfg)
|
|
66
|
-
delete globalSvfg;
|
|
67
|
-
globalSvfg = nullptr;
|
|
68
|
-
}
|
|
69
60
|
/// Get SVFG instance
|
|
70
61
|
inline SVFG* getSVFG() const
|
|
71
62
|
{
|
|
72
|
-
return svfg;
|
|
63
|
+
return svfg.get();
|
|
73
64
|
}
|
|
74
65
|
|
|
75
66
|
/// Mark feasible VF edge by removing it from set vfEdgesAtIndCallSite
|
|
@@ -85,7 +76,7 @@ public:
|
|
|
85
76
|
}
|
|
86
77
|
|
|
87
78
|
/// Build Memory SSA
|
|
88
|
-
virtual MemSSA
|
|
79
|
+
virtual std::unique_ptr<MemSSA> buildMSSA(BVDataPTAImpl* pta, bool ptrOnlyMSSA);
|
|
89
80
|
|
|
90
81
|
protected:
|
|
91
82
|
/// Create a DDA SVFG. By default actualOut and FormalIN are removed, unless withAOFI is set true.
|
|
@@ -97,7 +88,7 @@ protected:
|
|
|
97
88
|
|
|
98
89
|
/// SVFG Edges connected at indirect call/ret sites
|
|
99
90
|
SVFGEdgeSet vfEdgesAtIndCallSite;
|
|
100
|
-
SVFG
|
|
91
|
+
std::unique_ptr<SVFG> svfg;
|
|
101
92
|
/// SVFG with precomputed indirect call edges
|
|
102
93
|
bool SVFGWithIndCall;
|
|
103
94
|
};
|
|
@@ -234,16 +234,16 @@ public:
|
|
|
234
234
|
typedef typename MutablePTData<Key, KeySet, Data, DataSet>::PtsMap PtsMap;
|
|
235
235
|
|
|
236
236
|
/// Constructor
|
|
237
|
-
MutableDiffPTData(bool reversePT = true, PTDataTy ty = PTDataTy::Diff) : BaseDiffPTData(reversePT, ty), mutPTData(reversePT) { }
|
|
237
|
+
explicit MutableDiffPTData(bool reversePT = true, PTDataTy ty = PTDataTy::Diff) : BaseDiffPTData(reversePT, ty), mutPTData(reversePT) { }
|
|
238
238
|
|
|
239
|
-
|
|
239
|
+
~MutableDiffPTData() override = default;
|
|
240
240
|
|
|
241
241
|
virtual inline const PtsMap& getPtsMap() const
|
|
242
242
|
{
|
|
243
243
|
return mutPTData.getPtsMap();
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
|
|
246
|
+
inline void clear() override
|
|
247
247
|
{
|
|
248
248
|
mutPTData.clear();
|
|
249
249
|
}
|
|
@@ -44,7 +44,7 @@ public:
|
|
|
44
44
|
public:
|
|
45
45
|
PersistentPointsToCache(void) : idCounter(1)
|
|
46
46
|
{
|
|
47
|
-
idToPts.push_back(
|
|
47
|
+
idToPts.push_back(std::make_unique<Data>());
|
|
48
48
|
ptsToId[Data()] = emptyPointsToId();
|
|
49
49
|
|
|
50
50
|
initStats();
|
|
@@ -53,7 +53,6 @@ public:
|
|
|
53
53
|
/// Clear the cache.
|
|
54
54
|
void clear()
|
|
55
55
|
{
|
|
56
|
-
for (const Data *d : idToPts) delete d;
|
|
57
56
|
idToPts.clear();
|
|
58
57
|
ptsToId.clear();
|
|
59
58
|
|
|
@@ -69,7 +68,7 @@ public:
|
|
|
69
68
|
|
|
70
69
|
// Put the empty data back in.
|
|
71
70
|
ptsToId[Data()] = emptyPointsToId();
|
|
72
|
-
idToPts.push_back(
|
|
71
|
+
idToPts.push_back(std::make_unique<Data>());
|
|
73
72
|
|
|
74
73
|
idCounter = 1;
|
|
75
74
|
// Cache is empty...
|
|
@@ -79,7 +78,7 @@ public:
|
|
|
79
78
|
/// Remaps all points-to sets stored in the cache to the current mapping.
|
|
80
79
|
void remapAllPts(void)
|
|
81
80
|
{
|
|
82
|
-
for (
|
|
81
|
+
for (auto &d : idToPts) d->checkAndRemap();
|
|
83
82
|
|
|
84
83
|
// Rebuild ptsToId from idToPts.
|
|
85
84
|
ptsToId.clear();
|
|
@@ -96,7 +95,7 @@ public:
|
|
|
96
95
|
|
|
97
96
|
// Otherwise, insert it.
|
|
98
97
|
PointsToID id = newPointsToId();
|
|
99
|
-
idToPts.push_back(
|
|
98
|
+
idToPts.push_back(std::make_unique<Data>(pts));
|
|
100
99
|
ptsToId[pts] = id;
|
|
101
100
|
|
|
102
101
|
return id;
|
|
@@ -345,7 +344,7 @@ public:
|
|
|
345
344
|
Map<Data, unsigned> getAllPts(void)
|
|
346
345
|
{
|
|
347
346
|
Map<Data, unsigned> allPts;
|
|
348
|
-
for (const
|
|
347
|
+
for (const auto &d : idToPts) allPts[*d] = 1;
|
|
349
348
|
return allPts;
|
|
350
349
|
}
|
|
351
350
|
|
|
@@ -389,7 +388,7 @@ private:
|
|
|
389
388
|
else
|
|
390
389
|
{
|
|
391
390
|
resultId = newPointsToId();
|
|
392
|
-
idToPts.push_back(
|
|
391
|
+
idToPts.push_back(std::make_unique<Data>(result));
|
|
393
392
|
ptsToId[result] = resultId;
|
|
394
393
|
}
|
|
395
394
|
|
|
@@ -426,7 +425,7 @@ private:
|
|
|
426
425
|
/// Elements are only added through push_back, so the number of elements
|
|
427
426
|
/// stored is the size of the vector.
|
|
428
427
|
/// Not const so we can remap.
|
|
429
|
-
std::vector<Data
|
|
428
|
+
std::vector<std::unique_ptr<Data>> idToPts;
|
|
430
429
|
/// Maps points-to sets to their corresponding ID.
|
|
431
430
|
PTSToIDMap ptsToId;
|
|
432
431
|
|