svf-lib 1.0.1449 → 1.0.1451
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/svf/libSvfCore.a +0 -0
- package/SVF-linux/Release-build/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-linux/svf/include/MemoryModel/LocationSet.h +21 -16
- package/SVF-linux/svf/include/SVFIR/SVFStatements.h +2 -2
- package/SVF-linux/svf-llvm/include/SVF-LLVM/SymbolTableBuilder.h +1 -1
- package/SVF-osx/Release-build/svf/libSvfCore.a +0 -0
- package/SVF-osx/Release-build/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-osx/svf/include/MemoryModel/LocationSet.h +11 -10
- package/SVF-osx/svf/include/SVFIR/SVFStatements.h +2 -2
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -36,15 +36,19 @@
|
|
|
36
36
|
|
|
37
37
|
#include "SVFIR/SVFValue.h"
|
|
38
38
|
|
|
39
|
+
|
|
39
40
|
namespace SVF
|
|
40
41
|
{
|
|
41
42
|
|
|
43
|
+
class SVFVar;
|
|
44
|
+
|
|
45
|
+
|
|
42
46
|
/*
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
* Location set represents a set of locations in a memory block with following offsets:
|
|
48
|
+
* { offset + \sum_{i=0}^N (stride_i * j_i) | 0 \leq j_i < M_i }
|
|
49
|
+
* where N is the size of number-stride pair vector, M_i (stride_i) is i-th number (stride)
|
|
50
|
+
* in the number-stride pair vector.
|
|
51
|
+
*/
|
|
48
52
|
class LocationSet
|
|
49
53
|
{
|
|
50
54
|
friend class SymbolTableInfo;
|
|
@@ -54,7 +58,7 @@ public:
|
|
|
54
58
|
NonOverlap, Overlap, Subset, Superset, Same
|
|
55
59
|
};
|
|
56
60
|
|
|
57
|
-
typedef std::vector<
|
|
61
|
+
typedef std::vector<const SVFVar*> OffsetVarVec;
|
|
58
62
|
|
|
59
63
|
/// Constructor
|
|
60
64
|
LocationSet(s32_t o = 0) : fldIdx(o)
|
|
@@ -62,7 +66,7 @@ public:
|
|
|
62
66
|
|
|
63
67
|
/// Copy Constructor
|
|
64
68
|
LocationSet(const LocationSet& ls)
|
|
65
|
-
: fldIdx(ls.fldIdx),
|
|
69
|
+
: fldIdx(ls.fldIdx), offsetVars(ls.getOffsetVarVec())
|
|
66
70
|
{
|
|
67
71
|
}
|
|
68
72
|
|
|
@@ -75,13 +79,13 @@ public:
|
|
|
75
79
|
inline const LocationSet& operator= (const LocationSet& rhs)
|
|
76
80
|
{
|
|
77
81
|
fldIdx = rhs.fldIdx;
|
|
78
|
-
|
|
82
|
+
offsetVars = rhs.getOffsetVarVec();
|
|
79
83
|
return *this;
|
|
80
84
|
}
|
|
81
85
|
inline bool operator==(const LocationSet& rhs) const
|
|
82
86
|
{
|
|
83
87
|
return this->fldIdx == rhs.fldIdx
|
|
84
|
-
&& this->
|
|
88
|
+
&& this->offsetVars == rhs.offsetVars;
|
|
85
89
|
}
|
|
86
90
|
//@}
|
|
87
91
|
|
|
@@ -95,19 +99,20 @@ public:
|
|
|
95
99
|
{
|
|
96
100
|
fldIdx = idx;
|
|
97
101
|
}
|
|
98
|
-
inline const
|
|
102
|
+
inline const OffsetVarVec& getOffsetVarVec() const
|
|
99
103
|
{
|
|
100
|
-
return
|
|
104
|
+
return offsetVars;
|
|
101
105
|
}
|
|
102
106
|
//@}
|
|
103
107
|
|
|
104
|
-
/// Return accumulated constant offset given
|
|
108
|
+
/// Return accumulated constant offset given OffsetVarVec
|
|
105
109
|
s32_t accumulateConstantOffset() const;
|
|
106
110
|
|
|
107
111
|
/// Return element number of a type.
|
|
108
112
|
u32_t getElementNum(const SVFType* type) const;
|
|
109
113
|
|
|
110
|
-
|
|
114
|
+
|
|
115
|
+
bool addOffsetVar(const SVFVar* var);
|
|
111
116
|
|
|
112
117
|
/// Return TRUE if this is a constant location set.
|
|
113
118
|
bool isConstantOffset() const;
|
|
@@ -130,7 +135,7 @@ private:
|
|
|
130
135
|
NodeBS computeAllLocations() const;
|
|
131
136
|
|
|
132
137
|
s32_t fldIdx; ///< Accumulated Constant Offsets
|
|
133
|
-
|
|
138
|
+
OffsetVarVec offsetVars; ///< a vector of actual offset in the form of SVF Vars
|
|
134
139
|
};
|
|
135
140
|
|
|
136
141
|
} // End namespace SVF
|
|
@@ -140,8 +145,8 @@ template <> struct std::hash<SVF::LocationSet>
|
|
|
140
145
|
size_t operator()(const SVF::LocationSet &ls) const
|
|
141
146
|
{
|
|
142
147
|
SVF::Hash<std::pair<SVF::NodeID, SVF::NodeID>> h;
|
|
143
|
-
std::hash<SVF::LocationSet::
|
|
144
|
-
return h(std::make_pair(ls.accumulateConstantFieldIdx(), v(ls.
|
|
148
|
+
std::hash<SVF::LocationSet::OffsetVarVec> v;
|
|
149
|
+
return h(std::make_pair(ls.accumulateConstantFieldIdx(), v(ls.getOffsetVarVec())));
|
|
145
150
|
}
|
|
146
151
|
};
|
|
147
152
|
|
|
@@ -444,9 +444,9 @@ public:
|
|
|
444
444
|
{
|
|
445
445
|
return ls;
|
|
446
446
|
}
|
|
447
|
-
inline const LocationSet::
|
|
447
|
+
inline const LocationSet::OffsetVarVec getOffsetVarVec() const
|
|
448
448
|
{
|
|
449
|
-
return getLocationSet().
|
|
449
|
+
return getLocationSet().getOffsetVarVec();
|
|
450
450
|
}
|
|
451
451
|
/// Return TRUE if this is a constant location set.
|
|
452
452
|
inline bool isConstantOffset() const
|
|
Binary file
|
|
Binary file
|
|
@@ -58,7 +58,8 @@ public:
|
|
|
58
58
|
NonOverlap, Overlap, Subset, Superset, Same
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
typedef std::
|
|
61
|
+
typedef std::pair<const SVFVar*, const SVFType*> VarAndGepTypePair;
|
|
62
|
+
typedef std::vector<VarAndGepTypePair> OffsetVarAndGepTypePairs;
|
|
62
63
|
|
|
63
64
|
/// Constructor
|
|
64
65
|
LocationSet(s32_t o = 0) : fldIdx(o)
|
|
@@ -66,7 +67,7 @@ public:
|
|
|
66
67
|
|
|
67
68
|
/// Copy Constructor
|
|
68
69
|
LocationSet(const LocationSet& ls)
|
|
69
|
-
: fldIdx(ls.fldIdx),
|
|
70
|
+
: fldIdx(ls.fldIdx), offsetVarAndGepTypePairs(ls.getOffsetVarAndGepTypePairVec())
|
|
70
71
|
{
|
|
71
72
|
}
|
|
72
73
|
|
|
@@ -79,13 +80,13 @@ public:
|
|
|
79
80
|
inline const LocationSet& operator= (const LocationSet& rhs)
|
|
80
81
|
{
|
|
81
82
|
fldIdx = rhs.fldIdx;
|
|
82
|
-
|
|
83
|
+
offsetVarAndGepTypePairs = rhs.getOffsetVarAndGepTypePairVec();
|
|
83
84
|
return *this;
|
|
84
85
|
}
|
|
85
86
|
inline bool operator==(const LocationSet& rhs) const
|
|
86
87
|
{
|
|
87
88
|
return this->fldIdx == rhs.fldIdx
|
|
88
|
-
&& this->
|
|
89
|
+
&& this->offsetVarAndGepTypePairs == rhs.offsetVarAndGepTypePairs;
|
|
89
90
|
}
|
|
90
91
|
//@}
|
|
91
92
|
|
|
@@ -99,9 +100,9 @@ public:
|
|
|
99
100
|
{
|
|
100
101
|
fldIdx = idx;
|
|
101
102
|
}
|
|
102
|
-
inline const
|
|
103
|
+
inline const OffsetVarAndGepTypePairs& getOffsetVarAndGepTypePairVec() const
|
|
103
104
|
{
|
|
104
|
-
return
|
|
105
|
+
return offsetVarAndGepTypePairs;
|
|
105
106
|
}
|
|
106
107
|
//@}
|
|
107
108
|
|
|
@@ -112,7 +113,7 @@ public:
|
|
|
112
113
|
u32_t getElementNum(const SVFType* type) const;
|
|
113
114
|
|
|
114
115
|
|
|
115
|
-
bool
|
|
116
|
+
bool addOffsetVarAndGepTypePair(const SVFVar* var, const SVFType* gepIterType);
|
|
116
117
|
|
|
117
118
|
/// Return TRUE if this is a constant location set.
|
|
118
119
|
bool isConstantOffset() const;
|
|
@@ -135,7 +136,7 @@ private:
|
|
|
135
136
|
NodeBS computeAllLocations() const;
|
|
136
137
|
|
|
137
138
|
s32_t fldIdx; ///< Accumulated Constant Offsets
|
|
138
|
-
|
|
139
|
+
OffsetVarAndGepTypePairs offsetVarAndGepTypePairs; ///< a vector of actual offset in the form of <SVF Var, iterator type>s
|
|
139
140
|
};
|
|
140
141
|
|
|
141
142
|
} // End namespace SVF
|
|
@@ -145,8 +146,8 @@ template <> struct std::hash<SVF::LocationSet>
|
|
|
145
146
|
size_t operator()(const SVF::LocationSet &ls) const
|
|
146
147
|
{
|
|
147
148
|
SVF::Hash<std::pair<SVF::NodeID, SVF::NodeID>> h;
|
|
148
|
-
std::hash<SVF::LocationSet::
|
|
149
|
-
return h(std::make_pair(ls.accumulateConstantFieldIdx(), v(ls.
|
|
149
|
+
std::hash<SVF::LocationSet::OffsetVarAndGepTypePairs> v;
|
|
150
|
+
return h(std::make_pair(ls.accumulateConstantFieldIdx(), v(ls.getOffsetVarAndGepTypePairVec())));
|
|
150
151
|
}
|
|
151
152
|
};
|
|
152
153
|
|
|
@@ -444,9 +444,9 @@ public:
|
|
|
444
444
|
{
|
|
445
445
|
return ls;
|
|
446
446
|
}
|
|
447
|
-
inline const LocationSet::
|
|
447
|
+
inline const LocationSet::OffsetVarAndGepTypePairs getOffsetVarAndGepTypePairVec() const
|
|
448
448
|
{
|
|
449
|
-
return getLocationSet().
|
|
449
|
+
return getLocationSet().getOffsetVarAndGepTypePairVec();
|
|
450
450
|
}
|
|
451
451
|
/// Return TRUE if this is a constant location set.
|
|
452
452
|
inline bool isConstantOffset() const
|