svf-lib 1.0.907 → 1.0.910

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.
@@ -98,9 +98,6 @@ private:
98
98
  /// Module
99
99
  SVFModule* mod;
100
100
 
101
- /// Max field limit
102
- static u32_t maxFieldLimit;
103
-
104
101
  /// Clean up memory
105
102
  void destroy();
106
103
 
@@ -513,7 +510,6 @@ private:
513
510
  /// Type vector of fields
514
511
  std::vector<const Type*> flattenElementTypes;
515
512
  /// Max field limit
516
- static u32_t maxFieldLimit;
517
513
 
518
514
  StInfo(); ///< place holder
519
515
  StInfo(const StInfo& st); ///< place holder
@@ -529,16 +525,6 @@ public:
529
525
  {
530
526
  }
531
527
 
532
- static inline void setMaxFieldLimit(u32_t limit)
533
- {
534
- maxFieldLimit = limit;
535
- }
536
-
537
- static inline u32_t getMaxFieldLimit()
538
- {
539
- return maxFieldLimit;
540
- }
541
-
542
528
  /// struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;
543
529
  /// OriginalFieldType of b with field_idx 1 : Struct A
544
530
  /// FlatternedFieldType of b with field_idx 1 : int
@@ -620,6 +606,8 @@ private:
620
606
  /// maximum number of field object can be created
621
607
  /// minimum number is 0 (field insensitive analysis)
622
608
  u32_t maxOffsetLimit;
609
+ /// Size of the object or number of elements
610
+ u32_t elemNum;
623
611
 
624
612
  void resetTypeForHeapStaticObj(const Type* type);
625
613
  public:
@@ -650,6 +638,19 @@ public:
650
638
  maxOffsetLimit = limit;
651
639
  }
652
640
 
641
+ /// Set the number of elements of this object
642
+ inline void setNumOfElements(u32_t num)
643
+ {
644
+ elemNum = num;
645
+ setMaxFieldOffsetLimit(num);
646
+ }
647
+
648
+ /// Get the number of elements of this object
649
+ inline u32_t getNumOfElements()
650
+ {
651
+ return elemNum;
652
+ }
653
+
653
654
  /// Flag for this object type
654
655
  //@{
655
656
  inline void setFlag(MEMTYPE mask)
Binary file
@@ -98,9 +98,6 @@ private:
98
98
  /// Module
99
99
  SVFModule* mod;
100
100
 
101
- /// Max field limit
102
- static u32_t maxFieldLimit;
103
-
104
101
  /// Clean up memory
105
102
  void destroy();
106
103
 
@@ -513,7 +510,6 @@ private:
513
510
  /// Type vector of fields
514
511
  std::vector<const Type*> flattenElementTypes;
515
512
  /// Max field limit
516
- static u32_t maxFieldLimit;
517
513
 
518
514
  StInfo(); ///< place holder
519
515
  StInfo(const StInfo& st); ///< place holder
@@ -529,16 +525,6 @@ public:
529
525
  {
530
526
  }
531
527
 
532
- static inline void setMaxFieldLimit(u32_t limit)
533
- {
534
- maxFieldLimit = limit;
535
- }
536
-
537
- static inline u32_t getMaxFieldLimit()
538
- {
539
- return maxFieldLimit;
540
- }
541
-
542
528
  /// struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;
543
529
  /// OriginalFieldType of b with field_idx 1 : Struct A
544
530
  /// FlatternedFieldType of b with field_idx 1 : int
@@ -620,6 +606,8 @@ private:
620
606
  /// maximum number of field object can be created
621
607
  /// minimum number is 0 (field insensitive analysis)
622
608
  u32_t maxOffsetLimit;
609
+ /// Size of the object or number of elements
610
+ u32_t elemNum;
623
611
 
624
612
  void resetTypeForHeapStaticObj(const Type* type);
625
613
  public:
@@ -650,6 +638,19 @@ public:
650
638
  maxOffsetLimit = limit;
651
639
  }
652
640
 
641
+ /// Set the number of elements of this object
642
+ inline void setNumOfElements(u32_t num)
643
+ {
644
+ elemNum = num;
645
+ setMaxFieldOffsetLimit(num);
646
+ }
647
+
648
+ /// Get the number of elements of this object
649
+ inline u32_t getNumOfElements()
650
+ {
651
+ return elemNum;
652
+ }
653
+
653
654
  /// Flag for this object type
654
655
  //@{
655
656
  inline void setFlag(MEMTYPE mask)
@@ -517,6 +517,9 @@ const Value *stripAllCasts(const Value *val) ;
517
517
  /// Get the type of the heap allocation
518
518
  const Type *getTypeOfHeapAlloc(const llvm::Instruction *inst) ;
519
519
 
520
+ /// Return the bitcast instruction which is val's only use site, otherwise return nullptr
521
+ const Value* getUniqueUseViaCastInst(const Value* val);
522
+
520
523
  /// Return corresponding constant expression, otherwise return nullptr
521
524
  //@{
522
525
  inline const ConstantExpr *isGepConstantExpr(const Value *val)
@@ -84,8 +84,6 @@ public:
84
84
  void analyzeHeapObjType(ObjTypeInfo* typeinfo, const Value* val);
85
85
  /// Analyse types of heap and static objects
86
86
  void analyzeStaticObjType(ObjTypeInfo* typeinfo, const Value* val);
87
- /// Return the bitcast instruction which is val's only use site, otherwise return nullptr
88
- const Value* getUniqueUseViaCastInst(const Value* val);
89
87
 
90
88
  /// Return size of this object based on LLVM value
91
89
  u32_t getObjSize(const Value* val);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.907",
3
+ "version": "1.0.910",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {