svf-lib 1.0.906 → 1.0.907

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.
Binary file
@@ -238,18 +238,18 @@ public:
238
238
  void view();
239
239
  void printCH();
240
240
 
241
- inline s64_t getVirtualFunctionID(const SVFFunction* vfn) const
241
+ inline u32_t getVirtualFunctionID(const SVFFunction* vfn) const
242
242
  {
243
- Map<const SVFFunction*, s64_t>::const_iterator it =
243
+ Map<const SVFFunction*, u32_t>::const_iterator it =
244
244
  virtualFunctionToIDMap.find(vfn);
245
245
  if (it != virtualFunctionToIDMap.end())
246
246
  return it->second;
247
247
  else
248
248
  return -1;
249
249
  }
250
- inline const SVFFunction* getVirtualFunctionBasedonID(s64_t id) const
250
+ inline const SVFFunction* getVirtualFunctionBasedonID(u32_t id) const
251
251
  {
252
- Map<const SVFFunction*, s64_t>::const_iterator it, eit;
252
+ Map<const SVFFunction*, u32_t>::const_iterator it, eit;
253
253
  for (it = virtualFunctionToIDMap.begin(), eit =
254
254
  virtualFunctionToIDMap.end(); it != eit; ++it)
255
255
  {
@@ -309,7 +309,7 @@ public:
309
309
  private:
310
310
  SVFModule* svfMod;
311
311
  u32_t classNum;
312
- s64_t vfID;
312
+ u32_t vfID;
313
313
  double buildingCHGTime;
314
314
  Map<std::string, CHNode *> classNameToNodeMap;
315
315
  NameToCHNodesMap classNameToDescendantsMap;
@@ -318,7 +318,7 @@ private:
318
318
  NameToCHNodesMap templateNameToInstancesMap;
319
319
  CallSiteToCHNodesMap csToClassesMap;
320
320
 
321
- Map<const SVFFunction*, s64_t> virtualFunctionToIDMap;
321
+ Map<const SVFFunction*, u32_t> virtualFunctionToIDMap;
322
322
  CallSiteToVTableSetMap csToCHAVtblsMap;
323
323
  CallSiteToVFunSetMap csToCHAVFnsMap;
324
324
  };
@@ -304,7 +304,7 @@ public:
304
304
  }
305
305
 
306
306
  /// Get location set of the gep edge
307
- inline s64_t getConstantFieldIdx() const
307
+ inline s32_t getConstantFieldIdx() const
308
308
  {
309
309
  return ls.accumulateConstantFieldIdx();
310
310
  }
@@ -128,7 +128,7 @@ protected:
128
128
  /// Add control-flow edges for top level pointers
129
129
  //@{
130
130
  ICFGEdge* addIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode);
131
- ICFGEdge* addConditionalIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Value* condition, s64_t branchCondVal);
131
+ ICFGEdge* addConditionalIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Value* condition, s32_t branchCondVal);
132
132
  ICFGEdge* addCallEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Instruction* cs);
133
133
  ICFGEdge* addRetEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Instruction* cs);
134
134
  //@}
@@ -138,12 +138,12 @@ public:
138
138
  return conditionVar;
139
139
  }
140
140
 
141
- const s64_t getSuccessorCondValue() const{
141
+ const s32_t getSuccessorCondValue() const{
142
142
  assert(getCondition() && "this is not a conditional branch edge");
143
143
  return branchCondVal;
144
144
  }
145
145
 
146
- void setBranchCondition(const Value* c, s64_t bVal){
146
+ void setBranchCondition(const Value* c, s32_t bVal){
147
147
  conditionVar = c;
148
148
  branchCondVal = bVal;
149
149
  }
@@ -156,7 +156,7 @@ private:
156
156
  /// e.g., Inst1: br %cmp label 0, label 1, Inst2 is label 0 and Inst 3 is label 1;
157
157
  /// for edge between Inst1 and Inst 2, the first element is %cmp and second element is 0
158
158
  const Value* conditionVar;
159
- s64_t branchCondVal;
159
+ s32_t branchCondVal;
160
160
  };
161
161
 
162
162
  /*!
@@ -57,7 +57,7 @@ public:
57
57
  typedef std::vector<std::pair<const Value*, const Type*> > OffsetValueVec;
58
58
 
59
59
  /// Constructor
60
- LocationSet(s64_t o = 0) : fldIdx(o)
60
+ LocationSet(s32_t o = 0) : fldIdx(o)
61
61
  {}
62
62
 
63
63
  /// Copy Constructor
@@ -87,11 +87,11 @@ public:
87
87
 
88
88
  /// Get methods
89
89
  //@{
90
- inline s64_t accumulateConstantFieldIdx() const
90
+ inline s32_t accumulateConstantFieldIdx() const
91
91
  {
92
92
  return fldIdx;
93
93
  }
94
- inline void setFldIdx(s64_t idx)
94
+ inline void setFldIdx(s32_t idx)
95
95
  {
96
96
  fldIdx = idx;
97
97
  }
@@ -102,7 +102,7 @@ public:
102
102
  //@}
103
103
 
104
104
  /// Return accumulated constant offset given OffsetValueVec
105
- s64_t accumulateConstantOffset() const;
105
+ s32_t accumulateConstantOffset() const;
106
106
 
107
107
  /// Return element number of a type.
108
108
  u32_t getElementNum(const Type* type) const;
@@ -129,7 +129,7 @@ private:
129
129
  /// Compute all possible locations according to offset and number-stride pairs.
130
130
  NodeBS computeAllLocations() const;
131
131
 
132
- s64_t fldIdx; ///< Accumulated Constant Offsets
132
+ s32_t fldIdx; ///< Accumulated Constant Offsets
133
133
  OffsetValueVec offsetValues; ///< a vector of actual offset in the form of Values
134
134
  };
135
135
 
@@ -71,7 +71,7 @@ public:
71
71
  SVFIR* build();
72
72
 
73
73
  // Add edges
74
- void addEdge(NodeID nodeSrc, NodeID nodeDst, s64_t offset,
74
+ void addEdge(NodeID nodeSrc, NodeID nodeDst, s32_t offset,
75
75
  std::string edge);
76
76
  };
77
77
 
@@ -63,7 +63,7 @@ public:
63
63
  typedef Map<const SVFFunction*,SVFStmtSet> FunToPAGEdgeSetMap;
64
64
  typedef Map<const ICFGNode*,SVFStmtList> ICFGNode2SVFStmtsMap;
65
65
  typedef Map<NodeID, NodeID> NodeToNodeMap;
66
- typedef std::pair<NodeID, s64_t> NodeOffset;
66
+ typedef std::pair<NodeID, s32_t> NodeOffset;
67
67
  typedef std::pair<NodeID, LocationSet> NodeLocationSet;
68
68
  typedef Map<NodeOffset,NodeID> NodeOffsetMap;
69
69
  typedef Map<NodeLocationSet,NodeID> NodeLocationSetMap;
@@ -445,12 +445,12 @@ public:
445
445
  return getLocationSet().isConstantOffset();
446
446
  }
447
447
  /// Return accumulated constant offset (when accessing array or struct) if this offset is a constant.
448
- inline s64_t accumulateConstantOffset() const
448
+ inline s32_t accumulateConstantOffset() const
449
449
  {
450
450
  return getLocationSet().accumulateConstantOffset();
451
451
  }
452
452
  /// Field index of the gep statement if it access the field of a struct
453
- inline s64_t getConstantFieldIdx() const
453
+ inline s32_t getConstantFieldIdx() const
454
454
  {
455
455
  assert(isVariantFieldGep()==false && "Can't retrieve the LocationSet if using a variable field index (pointer arithmetic) for struct field access ");
456
456
  return getLocationSet().accumulateConstantFieldIdx();
@@ -921,7 +921,7 @@ public:
921
921
  class BranchStmt: public SVFStmt
922
922
  {
923
923
  public:
924
- typedef std::vector<std::pair<const ICFGNode*, s64_t> > SuccAndCondPairVec;
924
+ typedef std::vector<std::pair<const ICFGNode*, s32_t> > SuccAndCondPairVec;
925
925
  private:
926
926
  BranchStmt(); ///< place holder
927
927
  BranchStmt(const BranchStmt &); ///< place holder
@@ -987,7 +987,7 @@ public:
987
987
  const ICFGNode* getSuccessor (u32_t i) const{
988
988
  return successors.at(i).first;
989
989
  }
990
- s64_t getSuccessorCondValue (u32_t i) const{
990
+ s32_t getSuccessorCondValue (u32_t i) const{
991
991
  return successors.at(i).second;
992
992
  }
993
993
  //@}
@@ -413,7 +413,7 @@ public:
413
413
  }
414
414
 
415
415
  /// offset of the base value variable
416
- inline s64_t getConstantFieldIdx() const
416
+ inline s32_t getConstantFieldIdx() const
417
417
  {
418
418
  return ls.accumulateConstantFieldIdx();
419
419
  }
@@ -483,7 +483,7 @@ public:
483
483
  }
484
484
 
485
485
  /// offset of the mem object
486
- inline s64_t getConstantFieldIdx() const
486
+ inline s32_t getConstantFieldIdx() const
487
487
  {
488
488
  return ls.accumulateConstantFieldIdx();
489
489
  }
@@ -350,7 +350,7 @@ public:
350
350
  /// Number of flattenned elements of an array or struct
351
351
  u32_t getNumOfFlattenElements(const Type *T);
352
352
  /// Flatterned element idx of an array or struct by considering stride
353
- u32_t getFlattenedElemIdx(const Type *T, s64_t origId);
353
+ u32_t getFlattenedElemIdx(const Type *T, u32_t origId);
354
354
 
355
355
  /// struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;
356
356
  /// OriginalElemType of b with field_idx 1 : Struct A
@@ -74,7 +74,7 @@ public:
74
74
  //@{
75
75
  void initialiseNodes();
76
76
  void addEdge(NodeID src, NodeID dst, SVFStmt::PEDGEK kind,
77
- s64_t offset = 0, Instruction* cs = nullptr);
77
+ s32_t offset = 0, Instruction* cs = nullptr);
78
78
  // @}
79
79
 
80
80
  /// Sanity check for SVFIR
@@ -220,7 +220,7 @@ protected:
220
220
  void processCE(const Value *val);
221
221
 
222
222
  /// Infer field index from byteoffset.
223
- u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s64_t idx);
223
+ u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s32_t idx);
224
224
 
225
225
  /// Compute offset of a gep instruction or gep constant expression
226
226
  bool computeGepOffset(const User *V, LocationSet& ls);
@@ -85,7 +85,7 @@ private:
85
85
  {
86
86
  std::string label = it->getName().str();
87
87
  std::string toErase = "gepnode-";
88
- SVF::s64_t pos = label.find(toErase);
88
+ SVF::s32_t pos = label.find(toErase);
89
89
  if (pos == std::string::npos)
90
90
  {
91
91
  continue;
@@ -96,7 +96,7 @@ private:
96
96
  auto mdNode = it->getOperand(0);
97
97
 
98
98
  SVF::NodeID baseNodeId = std::stoi(llvm::cast<llvm::MDString>(mdNode->getOperand(0))->getString().str());
99
- SVF::s64_t locationSetOffset = std::stoi(llvm::cast<llvm::MDString>(mdNode->getOperand(1))->getString().str());
99
+ SVF::s32_t locationSetOffset = std::stoi(llvm::cast<llvm::MDString>(mdNode->getOperand(1))->getString().str());
100
100
 
101
101
  LocationSet locationSet = LocationSet(locationSetOffset);
102
102
  SVF::NodeID gepnodeId = pag->getGepObjVar(baseNodeId, locationSet);
@@ -149,7 +149,7 @@ public:
149
149
  protected:
150
150
  void initialize();
151
151
  void PWCDetect();
152
- void fieldExpand(NodeSet& initials, s64_t offset, NodeBS& strides, PointsTo& expandPts);
152
+ void fieldExpand(NodeSet& initials, s32_t offset, NodeBS& strides, PointsTo& expandPts);
153
153
  bool processGepPts(PointsTo& pts, const GepCGEdge* edge);
154
154
  bool mergeSrcToTgt(NodeID nodeId, NodeID newRepId);
155
155
 
@@ -69,7 +69,7 @@ public:
69
69
  : _consG(g), _scc(c), _I(0) {}
70
70
 
71
71
  void find(NodeStack& candidates);
72
- void visit(NodeID nodeId, s64_t _w);
72
+ void visit(NodeID nodeId, s32_t _w);
73
73
  void clear();
74
74
 
75
75
  bool isVisited(NodeID nId)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.906",
3
+ "version": "1.0.907",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {