svf-lib 1.0.1449 → 1.0.1450
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/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
|