svf-lib 1.0.1450 → 1.0.1452

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.
@@ -58,7 +58,8 @@ public:
58
58
  NonOverlap, Overlap, Subset, Superset, Same
59
59
  };
60
60
 
61
- typedef std::vector<const SVFVar*> OffsetVarVec;
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), offsetVars(ls.getOffsetVarVec())
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
- offsetVars = rhs.getOffsetVarVec();
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->offsetVars == rhs.offsetVars;
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 OffsetVarVec& getOffsetVarVec() const
103
+ inline const OffsetVarAndGepTypePairs& getOffsetVarAndGepTypePairVec() const
103
104
  {
104
- return offsetVars;
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 addOffsetVar(const SVFVar* var);
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
- OffsetVarVec offsetVars; ///< a vector of actual offset in the form of SVF Vars
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::OffsetVarVec> v;
149
- return h(std::make_pair(ls.accumulateConstantFieldIdx(), v(ls.getOffsetVarVec())));
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::OffsetVarVec getOffsetVarVec() const
447
+ inline const LocationSet::OffsetVarAndGepTypePairs getOffsetVarAndGepTypePairVec() const
448
448
  {
449
- return getLocationSet().getOffsetVarVec();
449
+ return getLocationSet().getOffsetVarAndGepTypePairVec();
450
450
  }
451
451
  /// Return TRUE if this is a constant location set.
452
452
  inline bool isConstantOffset() const
@@ -58,7 +58,8 @@ public:
58
58
  NonOverlap, Overlap, Subset, Superset, Same
59
59
  };
60
60
 
61
- typedef std::vector<const SVFVar*> OffsetVarVec;
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), offsetVars(ls.getOffsetVarVec())
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
- offsetVars = rhs.getOffsetVarVec();
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->offsetVars == rhs.offsetVars;
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 OffsetVarVec& getOffsetVarVec() const
103
+ inline const OffsetVarAndGepTypePairs& getOffsetVarAndGepTypePairVec() const
103
104
  {
104
- return offsetVars;
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 addOffsetVar(const SVFVar* var);
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
- OffsetVarVec offsetVars; ///< a vector of actual offset in the form of SVF Vars
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::OffsetVarVec> v;
149
- return h(std::make_pair(ls.accumulateConstantFieldIdx(), v(ls.getOffsetVarVec())));
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::OffsetVarVec getOffsetVarVec() const
447
+ inline const LocationSet::OffsetVarAndGepTypePairs getOffsetVarAndGepTypePairVec() const
448
448
  {
449
- return getLocationSet().getOffsetVarVec();
449
+ return getLocationSet().getOffsetVarAndGepTypePairVec();
450
450
  }
451
451
  /// Return TRUE if this is a constant location set.
452
452
  inline bool isConstantOffset() const
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1450",
3
+ "version": "1.0.1452",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {