svf-lib 1.0.745 → 1.0.749

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 (32) 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/Options.h +3 -1
  18. package/SVF-linux/include/Util/TypeBasedHeapCloning.h +2 -2
  19. package/SVF-linux/include/WPA/Andersen.h +1 -1
  20. package/SVF-linux/include/WPA/FlowSensitiveTBHC.h +1 -1
  21. package/SVF-osx/Release-build/lib/CUDD/libCudd.a +0 -0
  22. package/SVF-osx/Release-build/lib/libSvf.a +0 -0
  23. package/SVF-osx/include/Graphs/ConsG.h +2 -2
  24. package/SVF-osx/include/MemoryModel/PointerAnalysis.h +2 -2
  25. package/SVF-osx/include/MemoryModel/PointerAnalysisImpl.h +1 -1
  26. package/SVF-osx/include/MemoryModel/SVFIR.h +12 -12
  27. package/SVF-osx/include/MemoryModel/SVFStatements.h +26 -22
  28. package/SVF-osx/include/MemoryModel/SVFVariables.h +17 -17
  29. package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +2 -2
  30. package/SVF-osx/include/WPA/Andersen.h +1 -1
  31. package/SVF-osx/include/WPA/FlowSensitiveTBHC.h +1 -1
  32. package/package.json +1 -1
@@ -41,15 +41,15 @@ namespace SVF
41
41
  class SVFVar;
42
42
 
43
43
  /*
44
- * SVFIR edge between nodes
44
+ * SVFIR program statements (PAGEdges)
45
45
  */
46
46
  typedef GenericEdge<SVFVar> GenericPAGEdgeTy;
47
47
  class SVFStmt : public GenericPAGEdgeTy
48
48
  {
49
49
 
50
50
  public:
51
- /// Thirteen kinds of SVFIR edges
52
- /// Gep represents offset edge for field sensitivity
51
+ /// Types of SVFIR statements
52
+ /// Gep represents (base + offset) for field sensitivity
53
53
  /// ThreadFork/ThreadJoin is to model parameter passings between thread spawners and spawnees.
54
54
  enum PEDGEK
55
55
  {
@@ -175,9 +175,10 @@ public:
175
175
  }
176
176
  //@}
177
177
 
178
- typedef GenericNode<SVFVar,SVFStmt>::GEdgeSetTy PAGEdgeSetTy;
179
- typedef Map<EdgeID, PAGEdgeSetTy> PAGEdgeToSetMapTy;
180
- typedef PAGEdgeToSetMapTy PAGKindToEdgeSetMapTy;
178
+ typedef GenericNode<SVFVar,SVFStmt>::GEdgeSetTy SVFStmtSetTy;
179
+ typedef Map<EdgeID, SVFStmtSetTy> PAGEdgeToSetMapTy;
180
+ typedef PAGEdgeToSetMapTy KindToSVFStmtMapTy;
181
+ typedef SVFStmtSetTy PAGEdgeSetTy;
181
182
 
182
183
  private:
183
184
  typedef Map<const ICFGNode*, u32_t> Inst2LabelMap;
@@ -191,7 +192,7 @@ private:
191
192
 
192
193
 
193
194
  /*!
194
- * Copy edge
195
+ * Address statement (memory allocations)
195
196
  */
196
197
  class AddrStmt: public SVFStmt
197
198
  {
@@ -226,7 +227,7 @@ public:
226
227
 
227
228
 
228
229
  /*!
229
- * Copy edge
230
+ * Copy statements (simple assignment and casting)
230
231
  */
231
232
  class CopyStmt: public SVFStmt
232
233
  {
@@ -259,6 +260,9 @@ public:
259
260
  virtual const std::string toString() const override;
260
261
  };
261
262
 
263
+ /*
264
+ * Program statements with multiple operands including BinaryOPStmt, CmpStmt and PhiStmt
265
+ */
262
266
  class MultiOpndStmt : public SVFStmt{
263
267
  public:
264
268
  typedef std::vector<SVFVar*> OPVars;
@@ -323,7 +327,8 @@ public:
323
327
  };
324
328
 
325
329
  /*!
326
- * Phi instruction edge
330
+ * Phi statement (e.g., p = phi(q,r) which receives values from variables q and r from different paths)
331
+ * it is typically at a joint point of the control-flow graph
327
332
  */
328
333
  class PhiStmt: public MultiOpndStmt
329
334
  {
@@ -369,7 +374,7 @@ public:
369
374
 
370
375
 
371
376
  /*!
372
- * Compare instruction edge
377
+ * Comparison statement
373
378
  */
374
379
  class CmpStmt: public MultiOpndStmt
375
380
  {
@@ -382,7 +387,7 @@ private:
382
387
  SVFVar* getSrcID(); ///< place holder, use getOpVarID(pos) instead
383
388
  SVFVar* getDstID(); ///< place holder, use getResID() instead
384
389
 
385
- u32_t opcode;
390
+ u32_t predicate;
386
391
  public:
387
392
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
388
393
  //@{
@@ -405,13 +410,13 @@ public:
405
410
  //@}
406
411
 
407
412
  /// constructor
408
- CmpStmt(SVFVar* s, const OPVars& opnds, u32_t oc) : MultiOpndStmt(s,opnds,SVFStmt::Cmp), opcode(oc)
413
+ CmpStmt(SVFVar* s, const OPVars& opnds, u32_t pre) : MultiOpndStmt(s,opnds,SVFStmt::Cmp), predicate(pre)
409
414
  {
410
415
  }
411
416
 
412
- u32_t getOpcode() const
417
+ u32_t getPredicate() const
413
418
  {
414
- return opcode;
419
+ return predicate;
415
420
  }
416
421
 
417
422
  virtual const std::string toString() const override;
@@ -419,7 +424,7 @@ public:
419
424
 
420
425
 
421
426
  /*!
422
- * Binary instruction edge
427
+ * Binary statement
423
428
  */
424
429
  class BinaryOPStmt: public MultiOpndStmt
425
430
  {
@@ -469,7 +474,7 @@ public:
469
474
  };
470
475
 
471
476
  /*!
472
- * Unary instruction edge
477
+ * Unary statement
473
478
  */
474
479
  class UnaryOPStmt: public SVFStmt
475
480
  {
@@ -586,7 +591,7 @@ public:
586
591
  };
587
592
 
588
593
  /*!
589
- * Store edge
594
+ * Store statement
590
595
  */
591
596
  class StoreStmt: public SVFStmt
592
597
  {
@@ -623,7 +628,7 @@ public:
623
628
 
624
629
 
625
630
  /*!
626
- * Load edge
631
+ * Load statement
627
632
  */
628
633
  class LoadStmt: public SVFStmt
629
634
  {
@@ -659,7 +664,7 @@ public:
659
664
 
660
665
 
661
666
  /*!
662
- * Gep edge
667
+ * Gep statement for field access and pointer arithmetic
663
668
  */
664
669
  class GepStmt: public SVFStmt
665
670
  {
@@ -699,7 +704,7 @@ protected:
699
704
 
700
705
 
701
706
  /*!
702
- * Gep edge with a fixed offset
707
+ * Gep statement with a fixed offset
703
708
  */
704
709
  class NormalGepStmt : public GepStmt
705
710
  {
@@ -749,7 +754,7 @@ public:
749
754
  };
750
755
 
751
756
  /*!
752
- * Gep edge with a variant offset
757
+ * Gep statement with a variant offset
753
758
  */
754
759
  class VariantGepStmt : public GepStmt
755
760
  {
@@ -788,7 +793,7 @@ public:
788
793
 
789
794
 
790
795
  /*!
791
- * Call edge
796
+ * Call
792
797
  */
793
798
  class CallPE: public SVFStmt
794
799
  {
@@ -840,7 +845,7 @@ public:
840
845
 
841
846
 
842
847
  /*!
843
- * Return edge
848
+ * Return
844
849
  */
845
850
  class RetPE: public SVFStmt
846
851
  {
@@ -892,7 +897,7 @@ public:
892
897
 
893
898
 
894
899
  /*!
895
- * Thread Fork Edge
900
+ * Thread Fork
896
901
  */
897
902
  class TDForkPE: public CallPE
898
903
  {
@@ -930,7 +935,7 @@ public:
930
935
 
931
936
 
932
937
  /*!
933
- * Thread Join Edge
938
+ * Thread Join
934
939
  */
935
940
  class TDJoinPE: public RetPE
936
941
  {
@@ -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
  }
@@ -243,13 +243,15 @@ public:
243
243
  // TypeAnalysis.cpp
244
244
  static const llvm::cl::opt<bool> GenICFG;
245
245
 
246
- //WPAPass.cpp
246
+ // WPAPass.cpp
247
247
  static const llvm::cl::opt<bool> AnderSVFG;
248
248
  static const llvm::cl::opt<bool> SABERFULLSVFG;
249
249
  static const llvm::cl::opt<bool> PrintAliases;
250
250
  static llvm::cl::bits<PointerAnalysis::PTATY> PASelected;
251
251
  static llvm::cl::bits<WPAPass::AliasCheckRule> AliasRule;
252
252
 
253
+ // DOTGraphTraits
254
+ static const llvm::cl::opt<bool> ShowHiddenNode;
253
255
  };
254
256
  } // namespace SVF
255
257
 
@@ -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;
Binary file
@@ -310,9 +310,9 @@ public:
310
310
  {
311
311
  return pag->isBlkObjOrConstantObj(id);
312
312
  }
313
- inline NodeBS& getAllFieldsObjNode(NodeID id)
313
+ inline NodeBS& getAllFieldsObjVars(NodeID id)
314
314
  {
315
- return pag->getAllFieldsObjNode(id);
315
+ return pag->getAllFieldsObjVars(id);
316
316
  }
317
317
  inline NodeID getBaseObjVar(NodeID id)
318
318
  {
@@ -358,9 +358,9 @@ public:
358
358
  {
359
359
  return pag->getGepObjVar(id,ls);
360
360
  }
361
- virtual inline const NodeBS& getAllFieldsObjNode(NodeID id)
361
+ virtual inline const NodeBS& getAllFieldsObjVars(NodeID id)
362
362
  {
363
- return pag->getAllFieldsObjNode(id);
363
+ return pag->getAllFieldsObjVars(id);
364
364
  }
365
365
  inline void setObjFieldInsensitive(NodeID id)
366
366
  {
@@ -354,7 +354,7 @@ public:
354
354
  {
355
355
  if(pag->getBaseObjVar(cit->get_id())==cit->get_id())
356
356
  {
357
- NodeBS& fields = pag->getAllFieldsObjNode(cit->get_id());
357
+ NodeBS& fields = pag->getAllFieldsObjVars(cit->get_id());
358
358
  for(NodeBS::iterator it = fields.begin(), eit = fields.end(); it!=eit; ++it)
359
359
  {
360
360
  CVar cvar(cit->get_cond(),*it);
@@ -61,7 +61,7 @@ public:
61
61
  typedef Map<const RetBlockNode*,const SVFVar*> CSToRetMap;
62
62
  typedef Map<const SVFFunction*,const SVFVar*> FunToRetMap;
63
63
  typedef Map<const SVFFunction*,SVFStmtSet> FunToPAGEdgeSetMap;
64
- typedef Map<const ICFGNode*,SVFStmtList> Inst2PAGEdgesMap;
64
+ typedef Map<const ICFGNode*,SVFStmtList> ICFGNode2SVFStmtsMap;
65
65
  typedef Map<NodeID, NodeID> NodeToNodeMap;
66
66
  typedef std::pair<NodeID, Size_t> NodeOffset;
67
67
  typedef std::pair<NodeID, LocationSet> NodeLocationSet;
@@ -73,8 +73,8 @@ public:
73
73
  private:
74
74
  /// ValueNodes - This map indicates the Node that a particular Value* is
75
75
  /// represented by. This contains entries for all pointers.
76
- Inst2PAGEdgesMap inst2SVFStmtsMap; ///< Map a instruction to its PAGEdges
77
- Inst2PAGEdgesMap inst2PTASVFStmtsMap; ///< Map a instruction to its PointerAnalysis related PAGEdges
76
+ ICFGNode2SVFStmtsMap icfgNode2SVFStmtsMap; ///< Map an ICFGNode to its SVFStmts
77
+ ICFGNode2SVFStmtsMap icfgNode2PTASVFStmtsMap; ///< Map an ICFGNode to its PointerAnalysis related SVFStmts
78
78
  GepValueVarMap GepValObjMap; ///< Map a pair<base,off> to a gep value node id
79
79
  NodeLocationSetMap GepObjVarMap; ///< Map a pair<base,off> to a gep obj node id
80
80
  MemObjToFieldsMap memToFieldsMap; ///< Map a mem object id to all its fields
@@ -171,29 +171,29 @@ public:
171
171
  /// Whether this instruction has SVFIR Edge
172
172
  inline bool hasSVFStmtList(const ICFGNode* inst) const
173
173
  {
174
- return inst2SVFStmtsMap.find(inst)!=inst2SVFStmtsMap.end();
174
+ return icfgNode2SVFStmtsMap.find(inst)!=icfgNode2SVFStmtsMap.end();
175
175
  }
176
176
  inline bool hasPTASVFStmtList(const ICFGNode* inst) const
177
177
  {
178
- return inst2PTASVFStmtsMap.find(inst)!=inst2PTASVFStmtsMap.end();
178
+ return icfgNode2PTASVFStmtsMap.find(inst)!=icfgNode2PTASVFStmtsMap.end();
179
179
  }
180
180
  /// Given an instruction, get all its PAGEdges
181
181
  inline SVFStmtList& getSVFStmtList(const ICFGNode* inst)
182
182
  {
183
- return inst2SVFStmtsMap[inst];
183
+ return icfgNode2SVFStmtsMap[inst];
184
184
  }
185
185
  /// Given an instruction, get all its PTA PAGEdges
186
186
  inline SVFStmtList& getPTASVFStmtList(const ICFGNode* inst)
187
187
  {
188
- return inst2PTASVFStmtsMap[inst];
188
+ return icfgNode2PTASVFStmtsMap[inst];
189
189
  }
190
190
  /// Add a SVFStmt into instruction map
191
191
  inline void addToSVFStmtList(ICFGNode* inst, SVFStmt* edge)
192
192
  {
193
193
  edge->setICFGNode(inst);
194
- inst2SVFStmtsMap[inst].push_back(edge);
194
+ icfgNode2SVFStmtsMap[inst].push_back(edge);
195
195
  if (edge->isPTAEdge())
196
- inst2PTASVFStmtsMap[inst].push_back(edge);
196
+ icfgNode2PTASVFStmtsMap[inst].push_back(edge);
197
197
  }
198
198
  /// Get global PAGEdges (not in a procedure)
199
199
  inline SVFStmtSet& getGlobalSVFStmtSet()
@@ -454,8 +454,8 @@ public:
454
454
 
455
455
  /// Get all fields of an object
456
456
  //@{
457
- NodeBS& getAllFieldsObjNode(const MemObj* obj);
458
- NodeBS& getAllFieldsObjNode(NodeID id);
457
+ NodeBS& getAllFieldsObjVars(const MemObj* obj);
458
+ NodeBS& getAllFieldsObjVars(NodeID id);
459
459
  NodeBS getFieldsAfterCollapse(NodeID id);
460
460
  //@}
461
461
  inline NodeID addDummyValNode()
@@ -631,7 +631,7 @@ private:
631
631
  /// Add phi node information
632
632
  PhiStmt* addPhiStmt(NodeID res, NodeID opnd);
633
633
  /// Add Copy edge
634
- CmpStmt* addCmpStmt(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
634
+ CmpStmt* addCmpStmt(NodeID op1, NodeID op2, NodeID dst, u32_t predict);
635
635
  /// Add Copy edge
636
636
  BinaryOPStmt* addBinaryOPStmt(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
637
637
  /// Add Unary edge