svf-lib 1.0.2312 → 1.0.2314

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.
@@ -197,15 +197,15 @@ private:
197
197
  StInfo* typeinfo; ///< SVF's TypeInfo
198
198
  bool isSingleValTy; ///< The type represents a single value, not struct or
199
199
  u32_t byteSize; ///< LLVM Byte Size
200
+ u32_t id;
200
201
  ///< array
201
202
 
202
203
  protected:
203
- SVFType(bool svt, SVFTyKind k, u32_t Sz = 1)
204
+ SVFType(bool svt, SVFTyKind k, u32_t i = 0, u32_t Sz = 1)
204
205
  : kind(k), typeinfo(nullptr),
205
- isSingleValTy(svt), byteSize(Sz)
206
+ isSingleValTy(svt), byteSize(Sz), id(i)
206
207
  {
207
208
  }
208
-
209
209
  public:
210
210
  SVFType(void) = delete;
211
211
  virtual ~SVFType() {}
@@ -222,6 +222,11 @@ public:
222
222
  virtual void print(std::ostream& os) const = 0;
223
223
 
224
224
 
225
+ u32_t getId() const
226
+ {
227
+ return id;
228
+ }
229
+
225
230
  inline void setTypeInfo(StInfo* ti)
226
231
  {
227
232
  typeinfo = ti;
@@ -275,8 +280,8 @@ class SVFPointerType : public SVFType
275
280
  friend class SVFIRReader;
276
281
 
277
282
  public:
278
- SVFPointerType(u32_t byteSize = 1)
279
- : SVFType(true, SVFPointerTy, byteSize)
283
+ SVFPointerType(u32_t i, u32_t byteSize = 1)
284
+ : SVFType(true, SVFPointerTy, i, byteSize)
280
285
  {
281
286
  }
282
287
 
@@ -297,7 +302,7 @@ private:
297
302
  short signAndWidth; ///< For printing
298
303
 
299
304
  public:
300
- SVFIntegerType(u32_t byteSize = 1) : SVFType(true, SVFIntegerTy, byteSize) {}
305
+ SVFIntegerType(u32_t i, u32_t byteSize = 1) : SVFType(true, SVFIntegerTy, i, byteSize) {}
301
306
  static inline bool classof(const SVFType* node)
302
307
  {
303
308
  return node->getKind() == SVFIntegerTy;
@@ -327,8 +332,8 @@ private:
327
332
  bool varArg;
328
333
 
329
334
  public:
330
- SVFFunctionType(const SVFType* rt, const std::vector<const SVFType*>& p, bool isvararg)
331
- : SVFType(false, SVFFunctionTy, 1), retTy(rt), params(p), varArg(isvararg)
335
+ SVFFunctionType(u32_t i, const SVFType* rt, const std::vector<const SVFType*>& p, bool isvararg)
336
+ : SVFType(false, SVFFunctionTy, i, 1), retTy(rt), params(p), varArg(isvararg)
332
337
  {
333
338
  }
334
339
 
@@ -363,9 +368,13 @@ class SVFStructType : public SVFType
363
368
  private:
364
369
  /// @brief Field for printing & debugging
365
370
  std::string name;
371
+ std::vector<const SVFType*> fields;
366
372
 
367
373
  public:
368
- SVFStructType(u32_t byteSize = 1) : SVFType(false, SVFStructTy, byteSize) {}
374
+ SVFStructType(u32_t i, std::vector<const SVFType *> &f, u32_t byteSize = 1) :
375
+ SVFType(false, SVFStructTy, i, byteSize), fields(f)
376
+ {
377
+ }
369
378
 
370
379
  static inline bool classof(const SVFType* node)
371
380
  {
@@ -386,6 +395,11 @@ public:
386
395
  {
387
396
  name = std::move(structName);
388
397
  }
398
+
399
+ const std::vector<const SVFType*>& getFieldTypes() const
400
+ {
401
+ return fields;
402
+ }
389
403
  };
390
404
 
391
405
  class SVFArrayType : public SVFType
@@ -398,8 +412,8 @@ private:
398
412
  const SVFType* typeOfElement; /// For printing & debugging
399
413
 
400
414
  public:
401
- SVFArrayType(u32_t byteSize = 1)
402
- : SVFType(false, SVFArrayTy, byteSize), numOfElement(0), typeOfElement(nullptr)
415
+ SVFArrayType(u32_t i, u32_t byteSize = 1)
416
+ : SVFType(false, SVFArrayTy, i, byteSize), numOfElement(0), typeOfElement(nullptr)
403
417
  {
404
418
  }
405
419
 
@@ -437,7 +451,7 @@ private:
437
451
  std::string repr; /// Field representation for printing
438
452
 
439
453
  public:
440
- SVFOtherType(bool isSingleValueTy, u32_t byteSize = 1) : SVFType(isSingleValueTy, SVFOtherTy, byteSize) {}
454
+ SVFOtherType(u32_t i, bool isSingleValueTy, u32_t byteSize = 1) : SVFType(isSingleValueTy, SVFOtherTy, i, byteSize) {}
441
455
 
442
456
  static inline bool classof(const SVFType* node)
443
457
  {
@@ -197,15 +197,15 @@ private:
197
197
  StInfo* typeinfo; ///< SVF's TypeInfo
198
198
  bool isSingleValTy; ///< The type represents a single value, not struct or
199
199
  u32_t byteSize; ///< LLVM Byte Size
200
+ u32_t id;
200
201
  ///< array
201
202
 
202
203
  protected:
203
- SVFType(bool svt, SVFTyKind k, u32_t Sz = 1)
204
+ SVFType(bool svt, SVFTyKind k, u32_t i = 0, u32_t Sz = 1)
204
205
  : kind(k), typeinfo(nullptr),
205
- isSingleValTy(svt), byteSize(Sz)
206
+ isSingleValTy(svt), byteSize(Sz), id(i)
206
207
  {
207
208
  }
208
-
209
209
  public:
210
210
  SVFType(void) = delete;
211
211
  virtual ~SVFType() {}
@@ -222,6 +222,11 @@ public:
222
222
  virtual void print(std::ostream& os) const = 0;
223
223
 
224
224
 
225
+ u32_t getId() const
226
+ {
227
+ return id;
228
+ }
229
+
225
230
  inline void setTypeInfo(StInfo* ti)
226
231
  {
227
232
  typeinfo = ti;
@@ -275,8 +280,8 @@ class SVFPointerType : public SVFType
275
280
  friend class SVFIRReader;
276
281
 
277
282
  public:
278
- SVFPointerType(u32_t byteSize = 1)
279
- : SVFType(true, SVFPointerTy, byteSize)
283
+ SVFPointerType(u32_t i, u32_t byteSize = 1)
284
+ : SVFType(true, SVFPointerTy, i, byteSize)
280
285
  {
281
286
  }
282
287
 
@@ -297,7 +302,7 @@ private:
297
302
  short signAndWidth; ///< For printing
298
303
 
299
304
  public:
300
- SVFIntegerType(u32_t byteSize = 1) : SVFType(true, SVFIntegerTy, byteSize) {}
305
+ SVFIntegerType(u32_t i, u32_t byteSize = 1) : SVFType(true, SVFIntegerTy, i, byteSize) {}
301
306
  static inline bool classof(const SVFType* node)
302
307
  {
303
308
  return node->getKind() == SVFIntegerTy;
@@ -327,8 +332,8 @@ private:
327
332
  bool varArg;
328
333
 
329
334
  public:
330
- SVFFunctionType(const SVFType* rt, const std::vector<const SVFType*>& p, bool isvararg)
331
- : SVFType(false, SVFFunctionTy, 1), retTy(rt), params(p), varArg(isvararg)
335
+ SVFFunctionType(u32_t i, const SVFType* rt, const std::vector<const SVFType*>& p, bool isvararg)
336
+ : SVFType(false, SVFFunctionTy, i, 1), retTy(rt), params(p), varArg(isvararg)
332
337
  {
333
338
  }
334
339
 
@@ -363,9 +368,13 @@ class SVFStructType : public SVFType
363
368
  private:
364
369
  /// @brief Field for printing & debugging
365
370
  std::string name;
371
+ std::vector<const SVFType*> fields;
366
372
 
367
373
  public:
368
- SVFStructType(u32_t byteSize = 1) : SVFType(false, SVFStructTy, byteSize) {}
374
+ SVFStructType(u32_t i, std::vector<const SVFType *> &f, u32_t byteSize = 1) :
375
+ SVFType(false, SVFStructTy, i, byteSize), fields(f)
376
+ {
377
+ }
369
378
 
370
379
  static inline bool classof(const SVFType* node)
371
380
  {
@@ -386,6 +395,11 @@ public:
386
395
  {
387
396
  name = std::move(structName);
388
397
  }
398
+
399
+ const std::vector<const SVFType*>& getFieldTypes() const
400
+ {
401
+ return fields;
402
+ }
389
403
  };
390
404
 
391
405
  class SVFArrayType : public SVFType
@@ -398,8 +412,8 @@ private:
398
412
  const SVFType* typeOfElement; /// For printing & debugging
399
413
 
400
414
  public:
401
- SVFArrayType(u32_t byteSize = 1)
402
- : SVFType(false, SVFArrayTy, byteSize), numOfElement(0), typeOfElement(nullptr)
415
+ SVFArrayType(u32_t i, u32_t byteSize = 1)
416
+ : SVFType(false, SVFArrayTy, i, byteSize), numOfElement(0), typeOfElement(nullptr)
403
417
  {
404
418
  }
405
419
 
@@ -437,7 +451,7 @@ private:
437
451
  std::string repr; /// Field representation for printing
438
452
 
439
453
  public:
440
- SVFOtherType(bool isSingleValueTy, u32_t byteSize = 1) : SVFType(isSingleValueTy, SVFOtherTy, byteSize) {}
454
+ SVFOtherType(u32_t i, bool isSingleValueTy, u32_t byteSize = 1) : SVFType(isSingleValueTy, SVFOtherTy, i, byteSize) {}
441
455
 
442
456
  static inline bool classof(const SVFType* node)
443
457
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.2312",
3
+ "version": "1.0.2314",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {