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.
@@ -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
- * Location set represents a set of locations in a memory block with following offsets:
44
- * { offset + \sum_{i=0}^N (stride_i * j_i) | 0 \leq j_i < M_i }
45
- * where N is the size of number-stride pair vector, M_i (stride_i) is i-th number (stride)
46
- * in the number-stride pair vector.
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<std::pair<const SVFValue*, const SVFType*> > OffsetValueVec;
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), offsetValues(ls.getOffsetValueVec())
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
- offsetValues = rhs.getOffsetValueVec();
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->offsetValues == rhs.offsetValues;
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 OffsetValueVec& getOffsetValueVec() const
102
+ inline const OffsetVarVec& getOffsetVarVec() const
99
103
  {
100
- return offsetValues;
104
+ return offsetVars;
101
105
  }
102
106
  //@}
103
107
 
104
- /// Return accumulated constant offset given OffsetValueVec
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
- bool addOffsetValue(const SVFValue* offsetValue, const SVFType* type);
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
- OffsetValueVec offsetValues; ///< a vector of actual offset in the form of Values
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::OffsetValueVec> v;
144
- return h(std::make_pair(ls.accumulateConstantFieldIdx(), v(ls.getOffsetValueVec())));
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::OffsetValueVec& getOffsetValueVec() const
447
+ inline const LocationSet::OffsetVarVec getOffsetVarVec() const
448
448
  {
449
- return getLocationSet().getOffsetValueVec();
449
+ return getLocationSet().getOffsetVarVec();
450
450
  }
451
451
  /// Return TRUE if this is a constant location set.
452
452
  inline bool isConstantOffset() const
@@ -41,7 +41,7 @@ namespace SVF
41
41
 
42
42
  class SymbolTableBuilder
43
43
  {
44
-
44
+ friend class SVFIRBuilder;
45
45
  private:
46
46
  SymbolTableInfo* symInfo;
47
47
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1449",
3
+ "version": "1.0.1450",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {