svf-lib 1.0.744 → 1.0.748

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.
Files changed (40) hide show
  1. package/SVF-linux/Release-build/lib/libSvf.a +0 -0
  2. package/SVF-linux/include/DDA/ContextDDA.h +1 -1
  3. package/SVF-linux/include/DDA/FlowDDA.h +1 -1
  4. package/SVF-linux/include/Graphs/ConsG.h +10 -10
  5. package/SVF-linux/include/Graphs/ICFGNode.h +3 -3
  6. package/SVF-linux/include/Graphs/IRGraph.h +7 -7
  7. package/SVF-linux/include/Graphs/VFG.h +4 -4
  8. package/SVF-linux/include/MSSA/MemRegion.h +3 -3
  9. package/SVF-linux/include/MSSA/MemSSA.h +1 -1
  10. package/SVF-linux/include/MemoryModel/PointerAnalysis.h +8 -8
  11. package/SVF-linux/include/MemoryModel/PointerAnalysisImpl.h +2 -2
  12. package/SVF-linux/include/MemoryModel/SVFIR.h +66 -67
  13. package/SVF-linux/include/MemoryModel/SVFStatements.h +30 -25
  14. package/SVF-linux/include/MemoryModel/SVFVariables.h +32 -32
  15. package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +15 -15
  16. package/SVF-linux/include/Util/IRAnnotator.h +1 -1
  17. package/SVF-linux/include/Util/TypeBasedHeapCloning.h +2 -2
  18. package/SVF-linux/include/WPA/Andersen.h +1 -1
  19. package/SVF-linux/include/WPA/FlowSensitiveTBHC.h +1 -1
  20. package/SVF-osx/Release-build/lib/CUDD/libCudd.a +0 -0
  21. package/SVF-osx/Release-build/lib/libSvf.a +0 -0
  22. package/SVF-osx/include/DDA/ContextDDA.h +1 -1
  23. package/SVF-osx/include/DDA/FlowDDA.h +1 -1
  24. package/SVF-osx/include/Graphs/ConsG.h +10 -10
  25. package/SVF-osx/include/Graphs/ICFGNode.h +3 -3
  26. package/SVF-osx/include/Graphs/IRGraph.h +7 -7
  27. package/SVF-osx/include/Graphs/VFG.h +4 -4
  28. package/SVF-osx/include/MSSA/MemRegion.h +3 -3
  29. package/SVF-osx/include/MSSA/MemSSA.h +1 -1
  30. package/SVF-osx/include/MemoryModel/PointerAnalysis.h +8 -8
  31. package/SVF-osx/include/MemoryModel/PointerAnalysisImpl.h +2 -2
  32. package/SVF-osx/include/MemoryModel/SVFIR.h +66 -67
  33. package/SVF-osx/include/MemoryModel/SVFStatements.h +30 -25
  34. package/SVF-osx/include/MemoryModel/SVFVariables.h +32 -32
  35. package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +15 -15
  36. package/SVF-osx/include/Util/IRAnnotator.h +1 -1
  37. package/SVF-osx/include/Util/TypeBasedHeapCloning.h +2 -2
  38. package/SVF-osx/include/WPA/Andersen.h +1 -1
  39. package/SVF-osx/include/WPA/FlowSensitiveTBHC.h +1 -1
  40. package/package.json +1 -1
@@ -40,14 +40,14 @@ namespace SVF
40
40
 
41
41
  class SVFVar;
42
42
  /*
43
- * SVFIR node
43
+ * SVFIR program variables (PAGNodes)
44
44
  */
45
45
  typedef GenericNode<SVFVar,SVFStmt> GenericPAGNodeTy;
46
46
  class SVFVar : public GenericPAGNodeTy
47
47
  {
48
48
 
49
49
  public:
50
- /// Nine kinds of SVFIR nodes
50
+ /// Nine kinds of SVFIR variables
51
51
  /// ValNode: llvm pointer value
52
52
  /// ObjNode: memory object
53
53
  /// RetNode: unique return node
@@ -76,8 +76,8 @@ public:
76
76
 
77
77
  protected:
78
78
  const Value* value; ///< value of this SVFIR node
79
- SVFStmt::PAGKindToEdgeSetMapTy InEdgeKindToSetMap;
80
- SVFStmt::PAGKindToEdgeSetMapTy OutEdgeKindToSetMap;
79
+ SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap;
80
+ SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap;
81
81
  bool isTLPointer; /// top-level pointer
82
82
  bool isATPointer; /// address-taken pointer
83
83
 
@@ -157,22 +157,22 @@ public:
157
157
  return nullptr;
158
158
  }
159
159
 
160
- /// Get incoming SVFIR edges
161
- inline SVFStmt::PAGEdgeSetTy& getIncomingEdges(SVFStmt::PEDGEK kind)
160
+ /// Get incoming SVFIR statements (edges)
161
+ inline SVFStmt::SVFStmtSetTy& getIncomingEdges(SVFStmt::PEDGEK kind)
162
162
  {
163
163
  return InEdgeKindToSetMap[kind];
164
164
  }
165
165
 
166
- /// Get outgoing SVFIR edges
167
- inline SVFStmt::PAGEdgeSetTy& getOutgoingEdges(SVFStmt::PEDGEK kind)
166
+ /// Get outgoing SVFIR statements (edges)
167
+ inline SVFStmt::SVFStmtSetTy& getOutgoingEdges(SVFStmt::PEDGEK kind)
168
168
  {
169
169
  return OutEdgeKindToSetMap[kind];
170
170
  }
171
171
 
172
- /// Has incoming SVFIR edges
172
+ /// Has incoming SVFIR statements (edges)
173
173
  inline bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
174
174
  {
175
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
175
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
176
176
  if (it != InEdgeKindToSetMap.end())
177
177
  return (!it->second.empty());
178
178
  else
@@ -182,7 +182,7 @@ public:
182
182
  /// Has incoming VariantGepEdges
183
183
  inline bool hasIncomingVariantGepEdge() const
184
184
  {
185
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::VariantGep);
185
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::VariantGep);
186
186
  if (it != InEdgeKindToSetMap.end())
187
187
  {
188
188
  return (!it->second.empty());
@@ -191,25 +191,25 @@ public:
191
191
  }
192
192
 
193
193
  /// Get incoming SVFStmt iterator
194
- inline SVFStmt::PAGEdgeSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
194
+ inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
195
195
  {
196
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
196
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
197
197
  assert(it!=InEdgeKindToSetMap.end() && "The node does not have such kind of edge");
198
198
  return it->second.begin();
199
199
  }
200
200
 
201
201
  /// Get incoming SVFStmt iterator
202
- inline SVFStmt::PAGEdgeSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
202
+ inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
203
203
  {
204
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
204
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
205
205
  assert(it!=InEdgeKindToSetMap.end() && "The node does not have such kind of edge");
206
206
  return it->second.end();
207
207
  }
208
208
 
209
- /// Has outgoing SVFIR edges
209
+ /// Has outgoing SVFIR statements (edges)
210
210
  inline bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
211
211
  {
212
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
212
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
213
213
  if (it != OutEdgeKindToSetMap.end())
214
214
  return (!it->second.empty());
215
215
  else
@@ -217,17 +217,17 @@ public:
217
217
  }
218
218
 
219
219
  /// Get outgoing SVFStmt iterator
220
- inline SVFStmt::PAGEdgeSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
220
+ inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
221
221
  {
222
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
222
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
223
223
  assert(it!=OutEdgeKindToSetMap.end() && "The node does not have such kind of edge");
224
224
  return it->second.begin();
225
225
  }
226
226
 
227
227
  /// Get outgoing SVFStmt iterator
228
- inline SVFStmt::PAGEdgeSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
228
+ inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
229
229
  {
230
- SVFStmt::PAGKindToEdgeSetMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
230
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
231
231
  assert(it!=OutEdgeKindToSetMap.end() && "The node does not have such kind of edge");
232
232
  return it->second.end();
233
233
  }
@@ -268,7 +268,7 @@ public:
268
268
 
269
269
 
270
270
  /*
271
- * Value(Pointer) node
271
+ * Value (Pointer) variable
272
272
  */
273
273
  class ValVar: public SVFVar
274
274
  {
@@ -312,7 +312,7 @@ public:
312
312
 
313
313
 
314
314
  /*
315
- * Memory Object node
315
+ * Memory Object variable
316
316
  */
317
317
  class ObjVar: public SVFVar
318
318
  {
@@ -377,9 +377,9 @@ public:
377
377
 
378
378
 
379
379
  /*
380
- * Gep Value (Pointer) node, this node can be dynamic generated for field sensitive analysis
381
- * e.g. memcpy, temp gep value node needs to be created
382
- * Each Gep Value node is connected to base value node via gep edge
380
+ * Gep Value (Pointer) variable, this variable can be dynamic generated for field sensitive analysis
381
+ * e.g. memcpy, temp gep value variable needs to be created
382
+ * Each Gep Value variable is connected to base value variable via gep edge
383
383
  */
384
384
  class GepValVar: public ValVar
385
385
  {
@@ -416,7 +416,7 @@ public:
416
416
  {
417
417
  }
418
418
 
419
- /// offset of the base value node
419
+ /// offset of the base value variable
420
420
  inline u32_t getOffset() const
421
421
  {
422
422
  return ls.getOffset();
@@ -445,8 +445,8 @@ public:
445
445
 
446
446
 
447
447
  /*
448
- * Gep Obj node, this is dynamic generated for field sensitive analysis
449
- * Each gep obj node is one field of a MemObj (base)
448
+ * Gep Obj variable, this is dynamic generated for field sensitive analysis
449
+ * Each gep obj variable is one field of a MemObj (base)
450
450
  */
451
451
  class GepObjPN: public ObjVar
452
452
  {
@@ -521,7 +521,7 @@ public:
521
521
  };
522
522
 
523
523
  /*
524
- * Field-insensitive Gep Obj node, this is dynamic generated for field sensitive analysis
524
+ * Field-insensitive Gep Obj variable, this is dynamic generated for field sensitive analysis
525
525
  * Each field-insensitive gep obj node represents all fields of a MemObj (base)
526
526
  */
527
527
  class FIObjVar: public ObjVar
@@ -649,7 +649,7 @@ public:
649
649
 
650
650
 
651
651
  /*
652
- * Dummy node
652
+ * Dummy variable without any LLVM value
653
653
  */
654
654
  class DummyValVar: public ValVar
655
655
  {
@@ -688,7 +688,7 @@ public:
688
688
 
689
689
 
690
690
  /*
691
- * Dummy node
691
+ * Dummy object variable
692
692
  */
693
693
  class DummyObjVar: public ObjVar
694
694
  {
@@ -269,13 +269,13 @@ public:
269
269
 
270
270
  public:
271
271
 
272
- NodeID getGepValNode(const Value* val, const LocationSet& ls, const Type *baseType, u32_t fieldidx);
272
+ NodeID getGepValVar(const Value* val, const LocationSet& ls, const Type *baseType, u32_t fieldidx);
273
273
 
274
274
  void setCurrentBBAndValueForPAGEdge(PAGEdge* edge);
275
275
 
276
276
  inline PAGEdge* addBlackHoleAddrEdge(NodeID node)
277
277
  {
278
- PAGEdge *edge = pag->addBlackHoleAddrPE(node);
278
+ PAGEdge *edge = pag->addBlackHoleAddrStmt(node);
279
279
  setCurrentBBAndValueForPAGEdge(edge);
280
280
  return edge;
281
281
  }
@@ -283,42 +283,42 @@ public:
283
283
  /// Add Address edge
284
284
  inline AddrStmt* addAddrEdge(NodeID src, NodeID dst)
285
285
  {
286
- AddrStmt *edge = pag->addAddrPE(src, dst);
286
+ AddrStmt *edge = pag->addAddrStmt(src, dst);
287
287
  setCurrentBBAndValueForPAGEdge(edge);
288
288
  return edge;
289
289
  }
290
290
  /// Add Copy edge
291
291
  inline CopyStmt* addCopyEdge(NodeID src, NodeID dst)
292
292
  {
293
- CopyStmt *edge = pag->addCopyPE(src, dst);
293
+ CopyStmt *edge = pag->addCopyStmt(src, dst);
294
294
  setCurrentBBAndValueForPAGEdge(edge);
295
295
  return edge;
296
296
  }
297
297
  /// Add Copy edge
298
- inline PhiStmt* addPhiNode(NodeID res, NodeID opnd)
298
+ inline PhiStmt* addPhiStmt(NodeID res, NodeID opnd)
299
299
  {
300
- PhiStmt *edge = pag->addPhiNode(res,opnd);
300
+ PhiStmt *edge = pag->addPhiStmt(res,opnd);
301
301
  setCurrentBBAndValueForPAGEdge(edge);
302
302
  return edge;
303
303
  }
304
304
  /// Add Copy edge
305
- inline CmpStmt* addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
305
+ inline CmpStmt* addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t predict)
306
306
  {
307
- CmpStmt *edge = pag->addCmpPE(op1, op2, dst, opcode);
307
+ CmpStmt *edge = pag->addCmpStmt(op1, op2, dst, predict);
308
308
  setCurrentBBAndValueForPAGEdge(edge);
309
309
  return edge;
310
310
  }
311
311
  /// Add Copy edge
312
312
  inline BinaryOPStmt* addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
313
313
  {
314
- BinaryOPStmt *edge = pag->addBinaryOPPE(op1, op2, dst, opcode);
314
+ BinaryOPStmt *edge = pag->addBinaryOPStmt(op1, op2, dst, opcode);
315
315
  setCurrentBBAndValueForPAGEdge(edge);
316
316
  return edge;
317
317
  }
318
318
  /// Add Unary edge
319
319
  inline UnaryOPStmt* addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
320
320
  {
321
- UnaryOPStmt *edge = pag->addUnaryOPPE(src, dst, opcode);
321
+ UnaryOPStmt *edge = pag->addUnaryOPStmt(src, dst, opcode);
322
322
  setCurrentBBAndValueForPAGEdge(edge);
323
323
  return edge;
324
324
  }
@@ -331,7 +331,7 @@ public:
331
331
  /// Add Load edge
332
332
  inline LoadStmt* addLoadEdge(NodeID src, NodeID dst)
333
333
  {
334
- LoadStmt *edge = pag->addLoadPE(src, dst);
334
+ LoadStmt *edge = pag->addLoadStmt(src, dst);
335
335
  setCurrentBBAndValueForPAGEdge(edge);
336
336
  return edge;
337
337
  }
@@ -343,7 +343,7 @@ public:
343
343
  node = pag->getICFG()->getIntraBlockNode(inst);
344
344
  else
345
345
  node = nullptr;
346
- StoreStmt *edge = pag->addStorePE(src, dst, node);
346
+ StoreStmt *edge = pag->addStoreStmt(src, dst, node);
347
347
  setCurrentBBAndValueForPAGEdge(edge);
348
348
  return edge;
349
349
  }
@@ -364,21 +364,21 @@ public:
364
364
  /// Add Gep edge
365
365
  inline GepStmt* addGepEdge(NodeID src, NodeID dst, const LocationSet& ls, bool constGep)
366
366
  {
367
- GepStmt *edge = pag->addGepPE(src, dst, ls, constGep);
367
+ GepStmt *edge = pag->addGepStmt(src, dst, ls, constGep);
368
368
  setCurrentBBAndValueForPAGEdge(edge);
369
369
  return edge;
370
370
  }
371
371
  /// Add Offset(Gep) edge
372
372
  inline NormalGepStmt* addNormalGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
373
373
  {
374
- NormalGepStmt *edge = pag->addNormalGepPE(src, dst, ls);
374
+ NormalGepStmt *edge = pag->addNormalGepStmt(src, dst, ls);
375
375
  setCurrentBBAndValueForPAGEdge(edge);
376
376
  return edge;
377
377
  }
378
378
  /// Add Variant(Gep) edge
379
379
  inline VariantGepStmt* addVariantGepEdge(NodeID src, NodeID dst)
380
380
  {
381
- VariantGepStmt *edge = pag->addVariantGepPE(src, dst);
381
+ VariantGepStmt *edge = pag->addVariantGepStmt(src, dst);
382
382
  setCurrentBBAndValueForPAGEdge(edge);
383
383
  return edge;
384
384
  }
@@ -99,7 +99,7 @@ private:
99
99
  SVF::Size_t locationSetOffset = std::stoi(llvm::cast<llvm::MDString>(mdNode->getOperand(1))->getString().str());
100
100
 
101
101
  LocationSet locationSet = LocationSet(locationSetOffset);
102
- SVF::NodeID gepnodeId = pag->getGepObjNode(baseNodeId, locationSet);
102
+ SVF::NodeID gepnodeId = pag->getGepObjVar(baseNodeId, locationSet);
103
103
 
104
104
  assert(nodeId == gepnodeId && "nodeId != gepnodeId");
105
105
  }
@@ -97,8 +97,8 @@ protected:
97
97
  const NodeBS &getGepObjs(NodeID base);
98
98
 
99
99
  /// Returns the GEP object node(s) of base for ls. This may include clones.
100
- /// If there are no GEP objects, then getGepObjNode is called on the SVFIR
101
- /// (through base's getGepObjNode) which will create one.
100
+ /// If there are no GEP objects, then getGepObjVar is called on the SVFIR
101
+ /// (through base's getGepObjVar) which will create one.
102
102
  const NodeBS getGepObjClones(NodeID base, unsigned offset);
103
103
 
104
104
  /// Initialise the pointees of p at loc (which is type tildet *). reuse indicates
@@ -383,7 +383,7 @@ protected:
383
383
 
384
384
  for (NodeID o : fldInsenObjs)
385
385
  {
386
- const NodeBS &allFields = consCG->getAllFieldsObjNode(o);
386
+ const NodeBS &allFields = consCG->getAllFieldsObjVars(o);
387
387
  for (NodeID f : allFields) addPts(it->first, f);
388
388
  }
389
389
  }
@@ -73,7 +73,7 @@ public:
73
73
  virtual bool processPhi(const PHISVFGNode* phi) override;
74
74
  virtual bool processCopy(const CopySVFGNode* copy) override;
75
75
 
76
- virtual inline const NodeBS& getAllFieldsObjNode(NodeID id) override;
76
+ virtual inline const NodeBS& getAllFieldsObjVars(NodeID id) override;
77
77
 
78
78
  virtual inline bool updateInFromIn(const SVFGNode* srcStmt, NodeID srcVar, const SVFGNode* dstStmt, NodeID dstVar) override;
79
79
  virtual inline bool updateInFromOut(const SVFGNode* srcStmt, NodeID srcVar, const SVFGNode* dstStmt, NodeID dstVar) override;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.744",
3
+ "version": "1.0.748",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {