svf-lib 1.0.739 → 1.0.743

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.
@@ -1,8 +1,8 @@
1
- //===----- CHG.h -- Base class of pointer analyses ---------------------------//
1
+ //===----- CHG.h -- Class hirachary graph ---------------------------//
2
2
  //
3
3
  // SVF: Static Value-Flow Analysis
4
4
  //
5
- // Copyright (C) <2013-2017> <Yulei Sui>
5
+ // Copyright (C) <2013-> <Yulei Sui>
6
6
  //
7
7
 
8
8
  // This program is free software: you can redistribute it and/or modify
@@ -47,7 +47,7 @@ class VFGNode;
47
47
 
48
48
  /*!
49
49
  * Interprocedural control-flow graph node, representing different kinds of program statements
50
- * including top-level pointers (ValPN) and address-taken objects (ObjPN)
50
+ * including top-level pointers (ValVar) and address-taken objects (ObjVar)
51
51
  */
52
52
  typedef GenericNode<ICFGNode, ICFGEdge> GenericICFGNodeTy;
53
53
 
@@ -483,28 +483,28 @@ protected:
483
483
  setDef(pagNode,sNode);
484
484
  }
485
485
  /// Add an Address VFG node
486
- inline void addAddrVFGNode(const AddrPE* addr)
486
+ inline void addAddrVFGNode(const AddrStmt* addr)
487
487
  {
488
488
  AddrVFGNode* sNode = new AddrVFGNode(totalVFGNode++,addr);
489
489
  addStmtVFGNode(sNode, addr);
490
490
  setDef(addr->getDstNode(),sNode);
491
491
  }
492
492
  /// Add a Copy VFG node
493
- inline void addCopyVFGNode(const CopyPE* copy)
493
+ inline void addCopyVFGNode(const CopyStmt* copy)
494
494
  {
495
495
  CopyVFGNode* sNode = new CopyVFGNode(totalVFGNode++,copy);
496
496
  addStmtVFGNode(sNode, copy);
497
497
  setDef(copy->getDstNode(),sNode);
498
498
  }
499
499
  /// Add a Gep VFG node
500
- inline void addGepVFGNode(const GepPE* gep)
500
+ inline void addGepVFGNode(const GepStmt* gep)
501
501
  {
502
502
  GepVFGNode* sNode = new GepVFGNode(totalVFGNode++,gep);
503
503
  addStmtVFGNode(sNode, gep);
504
504
  setDef(gep->getDstNode(),sNode);
505
505
  }
506
506
  /// Add a Load VFG node
507
- void addLoadVFGNode(const LoadPE* load)
507
+ void addLoadVFGNode(const LoadStmt* load)
508
508
  {
509
509
  LoadVFGNode* sNode = new LoadVFGNode(totalVFGNode++,load);
510
510
  addStmtVFGNode(sNode, load);
@@ -512,7 +512,7 @@ protected:
512
512
  }
513
513
  /// Add a Store VFG node,
514
514
  /// To be noted store does not create a new pointer, we do not set def for any SVFIR node
515
- void addStoreVFGNode(const StorePE* store)
515
+ void addStoreVFGNode(const StoreStmt* store)
516
516
  {
517
517
  StoreVFGNode* sNode = new StoreVFGNode(totalVFGNode++,store);
518
518
  addStmtVFGNode(sNode, store);
@@ -569,7 +569,7 @@ protected:
569
569
  PAGNodeToActualRetMap[ret] = sNode;
570
570
  }
571
571
  /// Add an llvm PHI VFG node
572
- inline void addIntraPHIVFGNode(const PhiPE* edge)
572
+ inline void addIntraPHIVFGNode(const PhiStmt* edge)
573
573
  {
574
574
  IntraPHIVFGNode* sNode = new IntraPHIVFGNode(totalVFGNode++,edge->getRes());
575
575
  u32_t pos = 0;
@@ -583,7 +583,7 @@ protected:
583
583
  PAGNodeToIntraPHIVFGNodeMap[edge->getRes()] = sNode;
584
584
  }
585
585
  /// Add a Compare VFG node
586
- inline void addCmpVFGNode(const CmpPE* edge)
586
+ inline void addCmpVFGNode(const CmpStmt* edge)
587
587
  {
588
588
  CmpVFGNode* sNode = new CmpVFGNode(totalVFGNode++, edge->getRes());
589
589
  u32_t pos = 0;
@@ -597,7 +597,7 @@ protected:
597
597
  PAGNodeToCmpVFGNodeMap[edge->getRes()] = sNode;
598
598
  }
599
599
  /// Add a BinaryOperator VFG node
600
- inline void addBinaryOPVFGNode(const BinaryOPPE* edge)
600
+ inline void addBinaryOPVFGNode(const BinaryOPStmt* edge)
601
601
  {
602
602
  BinaryOPVFGNode* sNode = new BinaryOPVFGNode(totalVFGNode++, edge->getRes());
603
603
  u32_t pos = 0;
@@ -611,7 +611,7 @@ protected:
611
611
  PAGNodeToBinaryOPVFGNodeMap[edge->getRes()] = sNode;
612
612
  }
613
613
  /// Add a UnaryOperator VFG node
614
- inline void addUnaryOPVFGNode(const UnaryOPPE* edge)
614
+ inline void addUnaryOPVFGNode(const UnaryOPStmt* edge)
615
615
  {
616
616
  UnaryOPVFGNode* sNode = new UnaryOPVFGNode(totalVFGNode++, edge->getRes());
617
617
  sNode->setOpVer(0, edge->getOpVar());
@@ -40,7 +40,7 @@ namespace SVF
40
40
 
41
41
  /*!
42
42
  * Interprocedural control-flow graph node, representing different kinds of program statements
43
- * including top-level pointers (ValPN) and address-taken objects (ObjPN)
43
+ * including top-level pointers (ValVar) and address-taken objects (ObjVar)
44
44
  */
45
45
  typedef GenericNode<VFGNode,VFGEdge> GenericVFGNodeTy;
46
46
  class VFGNode : public GenericVFGNodeTy
@@ -202,7 +202,7 @@ private:
202
202
 
203
203
  public:
204
204
  /// Constructor
205
- LoadVFGNode(NodeID id, const LoadPE* edge): StmtVFGNode(id, edge,Load)
205
+ LoadVFGNode(NodeID id, const LoadStmt* edge): StmtVFGNode(id, edge,Load)
206
206
  {
207
207
 
208
208
  }
@@ -241,7 +241,7 @@ private:
241
241
 
242
242
  public:
243
243
  /// Constructor
244
- StoreVFGNode(NodeID id,const StorePE* edge): StmtVFGNode(id,edge,Store)
244
+ StoreVFGNode(NodeID id,const StoreStmt* edge): StmtVFGNode(id,edge,Store)
245
245
  {
246
246
 
247
247
  }
@@ -280,7 +280,7 @@ private:
280
280
 
281
281
  public:
282
282
  /// Constructor
283
- CopyVFGNode(NodeID id,const CopyPE* copy): StmtVFGNode(id,copy,Copy)
283
+ CopyVFGNode(NodeID id,const CopyStmt* copy): StmtVFGNode(id,copy,Copy)
284
284
  {
285
285
 
286
286
  }
@@ -591,7 +591,7 @@ private:
591
591
 
592
592
  public:
593
593
  /// Constructor
594
- GepVFGNode(NodeID id,const GepPE* edge): StmtVFGNode(id,edge,Gep)
594
+ GepVFGNode(NodeID id,const GepStmt* edge): StmtVFGNode(id,edge,Gep)
595
595
  {
596
596
 
597
597
  }
@@ -753,7 +753,7 @@ private:
753
753
 
754
754
  public:
755
755
  /// Constructor
756
- AddrVFGNode(NodeID id, const AddrPE* edge): StmtVFGNode(id, edge,Addr)
756
+ AddrVFGNode(NodeID id, const AddrStmt* edge): StmtVFGNode(id, edge,Addr)
757
757
  {
758
758
 
759
759
  }
@@ -166,13 +166,13 @@ class LoadMU : public MSSAMU<Cond>
166
166
  {
167
167
 
168
168
  private:
169
- const LoadPE* inst;
169
+ const LoadStmt* inst;
170
170
  const BasicBlock* bb;
171
171
 
172
172
  public:
173
173
  /// Constructor/Destructor for MU
174
174
  //@{
175
- LoadMU(const BasicBlock* b,const LoadPE* i, const MemRegion* m, Cond c = true) :
175
+ LoadMU(const BasicBlock* b,const LoadStmt* i, const MemRegion* m, Cond c = true) :
176
176
  MSSAMU<Cond>(MSSAMU<Cond>::LoadMSSAMU,m,c), inst(i), bb(b)
177
177
  {
178
178
  }
@@ -183,7 +183,7 @@ public:
183
183
  //@}
184
184
 
185
185
  /// Return load instruction
186
- inline const LoadPE* getLoadInst() const
186
+ inline const LoadStmt* getLoadInst() const
187
187
  {
188
188
  return inst;
189
189
  }
@@ -462,11 +462,11 @@ class StoreCHI : public MSSACHI<Cond>
462
462
  {
463
463
  private:
464
464
  const BasicBlock* bb;
465
- const StorePE* inst;
465
+ const StoreStmt* inst;
466
466
  public:
467
467
  /// Constructors for StoreCHI
468
468
  //@{
469
- StoreCHI(const BasicBlock* b, const StorePE* i, const MemRegion* m, Cond c = true) :
469
+ StoreCHI(const BasicBlock* b, const StoreStmt* i, const MemRegion* m, Cond c = true) :
470
470
  MSSACHI<Cond>(MSSADEF::StoreMSSACHI,m,c), bb(b), inst(i)
471
471
  {
472
472
  }
@@ -482,7 +482,7 @@ public:
482
482
  }
483
483
 
484
484
  /// Get store instruction
485
- inline const StorePE* getStoreInst() const
485
+ inline const StoreStmt* getStoreInst() const
486
486
  {
487
487
  return inst;
488
488
  }
@@ -146,15 +146,15 @@ public:
146
146
  /// Map loads/stores to its mem regions,
147
147
  /// TODO:visitAtomicCmpXchgInst, visitAtomicRMWInst??
148
148
  //@{
149
- typedef Map<const LoadPE*, MRSet> LoadsToMRsMap;
150
- typedef Map<const StorePE*, MRSet> StoresToMRsMap;
149
+ typedef Map<const LoadStmt*, MRSet> LoadsToMRsMap;
150
+ typedef Map<const StoreStmt*, MRSet> StoresToMRsMap;
151
151
  typedef Map<const CallBlockNode*, MRSet> CallSiteToMRsMap;
152
152
  //@}
153
153
 
154
154
  /// Map loads/stores/callsites to their cpts set
155
155
  //@{
156
- typedef Map<const LoadPE*, NodeBS> LoadsToPointsToMap;
157
- typedef Map<const StorePE*, NodeBS> StoresToPointsToMap;
156
+ typedef Map<const LoadStmt*, NodeBS> LoadsToPointsToMap;
157
+ typedef Map<const StoreStmt*, NodeBS> StoresToPointsToMap;
158
158
  typedef Map<const CallBlockNode*, NodeBS> CallSiteToPointsToMap;
159
159
  //@}
160
160
 
@@ -334,13 +334,13 @@ protected:
334
334
 
335
335
  /// Add cpts to store/load
336
336
  //@{
337
- inline void addCPtsToStore(NodeBS& cpts, const StorePE *st, const SVFFunction* fun)
337
+ inline void addCPtsToStore(NodeBS& cpts, const StoreStmt *st, const SVFFunction* fun)
338
338
  {
339
339
  storesToPointsToMap[st] = cpts;
340
340
  funToPointsToMap[fun].insert(cpts);
341
341
  addModSideEffectOfFunction(fun,cpts);
342
342
  }
343
- inline void addCPtsToLoad(NodeBS& cpts, const LoadPE *ld, const SVFFunction* fun)
343
+ inline void addCPtsToLoad(NodeBS& cpts, const LoadStmt *ld, const SVFFunction* fun)
344
344
  {
345
345
  loadsToPointsToMap[ld] = cpts;
346
346
  funToPointsToMap[fun].insert(cpts);
@@ -440,11 +440,11 @@ public:
440
440
  {
441
441
  return funToMRsMap[fun];
442
442
  }
443
- inline MRSet& getLoadMRSet(const LoadPE* load)
443
+ inline MRSet& getLoadMRSet(const LoadStmt* load)
444
444
  {
445
445
  return loadsToMRsMap[load];
446
446
  }
447
- inline MRSet& getStoreMRSet(const StorePE* store)
447
+ inline MRSet& getStoreMRSet(const StoreStmt* store)
448
448
  {
449
449
  return storesToMRsMap[store];
450
450
  }
@@ -71,8 +71,8 @@ public:
71
71
  /// Map loads/stores to its mem regions,
72
72
  /// TODO:visitAtomicCmpXchgInst, visitAtomicRMWInst??
73
73
  //@{
74
- typedef Map<const LoadPE*, MUSet> LoadToMUSetMap;
75
- typedef Map<const StorePE*, CHISet> StoreToChiSetMap;
74
+ typedef Map<const LoadStmt*, MUSet> LoadToMUSetMap;
75
+ typedef Map<const StoreStmt*, CHISet> StoreToChiSetMap;
76
76
  typedef Map<const CallBlockNode*, MUSet> CallSiteToMUSetMap;
77
77
  typedef Map<const CallBlockNode*, CHISet> CallSiteToCHISetMap;
78
78
  typedef Map<const BasicBlock*, PHISet> BBToPhiSetMap;
@@ -180,12 +180,12 @@ private:
180
180
 
181
181
  /// Add methods for mus/chis/phis
182
182
  //@{
183
- inline void AddLoadMU(const BasicBlock* bb, const LoadPE* load, const MRSet& mrSet)
183
+ inline void AddLoadMU(const BasicBlock* bb, const LoadStmt* load, const MRSet& mrSet)
184
184
  {
185
185
  for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
186
186
  AddLoadMU(bb,load,*iter);
187
187
  }
188
- inline void AddStoreCHI(const BasicBlock* bb, const StorePE* store, const MRSet& mrSet)
188
+ inline void AddStoreCHI(const BasicBlock* bb, const StoreStmt* store, const MRSet& mrSet)
189
189
  {
190
190
  for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
191
191
  AddStoreCHI(bb,store,*iter);
@@ -205,13 +205,13 @@ private:
205
205
  for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
206
206
  AddMSSAPHI(bb,*iter);
207
207
  }
208
- inline void AddLoadMU(const BasicBlock* bb, const LoadPE* load, const MemRegion* mr)
208
+ inline void AddLoadMU(const BasicBlock* bb, const LoadStmt* load, const MemRegion* mr)
209
209
  {
210
210
  LOADMU* mu = new LOADMU(bb,load, mr);
211
211
  load2MuSetMap[load].insert(mu);
212
212
  collectRegUses(mr);
213
213
  }
214
- inline void AddStoreCHI(const BasicBlock* bb, const StorePE* store, const MemRegion* mr)
214
+ inline void AddStoreCHI(const BasicBlock* bb, const StoreStmt* store, const MemRegion* mr)
215
215
  {
216
216
  STORECHI* chi = new STORECHI(bb,store, mr);
217
217
  store2ChiSetMap[store].insert(chi);
@@ -331,7 +331,7 @@ public:
331
331
  //@{
332
332
  inline bool hasMU(const PAGEdge* inst) const
333
333
  {
334
- if (const LoadPE* load = SVFUtil::dyn_cast<LoadPE>(inst))
334
+ if (const LoadStmt* load = SVFUtil::dyn_cast<LoadStmt>(inst))
335
335
  {
336
336
  assert(0 != load2MuSetMap.count(load)
337
337
  && "not associated with mem region!");
@@ -342,7 +342,7 @@ public:
342
342
  }
343
343
  inline bool hasCHI(const PAGEdge* inst) const
344
344
  {
345
- if (const StorePE* store = SVFUtil::dyn_cast<StorePE>(
345
+ if (const StoreStmt* store = SVFUtil::dyn_cast<StoreStmt>(
346
346
  inst))
347
347
  {
348
348
  assert(0 != store2ChiSetMap.count(store)
@@ -385,11 +385,11 @@ public:
385
385
 
386
386
  /// Get methods of mu/chi/phi
387
387
  //@{
388
- inline MUSet& getMUSet(const LoadPE* ld)
388
+ inline MUSet& getMUSet(const LoadStmt* ld)
389
389
  {
390
390
  return load2MuSetMap[ld];
391
391
  }
392
- inline CHISet& getCHISet(const StorePE* st)
392
+ inline CHISet& getCHISet(const StoreStmt* st)
393
393
  {
394
394
  return store2ChiSetMap[st];
395
395
  }
@@ -344,7 +344,7 @@ public:
344
344
  ///@{
345
345
  inline bool isFIObjNode(NodeID id) const
346
346
  {
347
- return (SVFUtil::isa<FIObjPN>(pag->getGNode(id)));
347
+ return (SVFUtil::isa<FIObjVar>(pag->getGNode(id)));
348
348
  }
349
349
  inline NodeID getBaseObjNode(NodeID id)
350
350
  {
@@ -577,11 +577,11 @@ public:
577
577
  const PAGNode* node = this->getPAG()->getGNode(*nIter);
578
578
  if (this->getPAG()->isValidTopLevelPtr(node))
579
579
  {
580
- if (SVFUtil::isa<DummyObjPN>(node))
580
+ if (SVFUtil::isa<DummyObjVar>(node))
581
581
  {
582
582
  SVFUtil::outs() << "##<Blackhole or constant> id:" << node->getId();
583
583
  }
584
- else if (!SVFUtil::isa<DummyValPN>(node))
584
+ else if (!SVFUtil::isa<DummyValVar>(node))
585
585
  {
586
586
  SVFUtil::outs() << "##<" << node->getValue()->getName() << "> ";
587
587
  //SVFUtil::outs() << "Source Loc: " << SVFUtil::getSourceLoc(node->getValue());
@@ -55,8 +55,8 @@ public:
55
55
  typedef Map<NodeID,NodeBS> MemObjToFieldsMap;
56
56
  typedef std::vector<const SVFStmt*> PAGEdgeList;
57
57
  typedef std::vector<const SVFVar*> PAGNodeList;
58
- typedef std::vector<const CopyPE*> CopyPEList;
59
- typedef Map<const SVFVar*,PhiPE*> PHINodeMap;
58
+ typedef std::vector<const CopyStmt*> CopyPEList;
59
+ typedef Map<const SVFVar*,PhiStmt*> PHINodeMap;
60
60
  typedef Map<const SVFFunction*,PAGNodeList> FunToArgsListMap;
61
61
  typedef Map<const CallBlockNode*,PAGNodeList> CSToArgsListMap;
62
62
  typedef Map<const RetBlockNode*,const SVFVar*> CSToRetMap;
@@ -292,7 +292,7 @@ public:
292
292
  }
293
293
  //@}
294
294
 
295
- /// Due to constaint expression, curInst is used to distinguish different instructions (e.g., memorycpy) when creating GepValPN.
295
+ /// Due to constaint expression, curInst is used to distinguish different instructions (e.g., memorycpy) when creating GepValVar.
296
296
  inline NodeID getGepValNode(const Value* curInst, NodeID base, const LocationSet& ls) const
297
297
  {
298
298
  GepValPNMap::const_iterator iter = GepValNodeMap.find(curInst);
@@ -353,17 +353,17 @@ public:
353
353
 
354
354
  /// Get memory object - Return memory object according to pag node id
355
355
  /// return whole allocated memory object if this node is a gep obj node
356
- /// return nullptr is this node is not a ObjPN type
356
+ /// return nullptr is this node is not a ObjVar type
357
357
  //@{
358
358
  inline const MemObj*getObject(NodeID id) const
359
359
  {
360
360
  const SVFVar* node = getGNode(id);
361
- if(const ObjPN* objPN = SVFUtil::dyn_cast<ObjPN>(node))
361
+ if(const ObjVar* objPN = SVFUtil::dyn_cast<ObjVar>(node))
362
362
  return getObject(objPN);
363
363
  else
364
364
  return nullptr;
365
365
  }
366
- inline const MemObj*getObject(const ObjPN* node) const
366
+ inline const MemObj*getObject(const ObjVar* node) const
367
367
  {
368
368
  return node->getMemObj();
369
369
  }
@@ -382,8 +382,8 @@ public:
382
382
  inline NodeID getFIObjNode(NodeID id) const
383
383
  {
384
384
  SVFVar* node = pag->getGNode(id);
385
- assert(SVFUtil::isa<ObjPN>(node) && "need an object node");
386
- ObjPN* obj = SVFUtil::cast<ObjPN>(node);
385
+ assert(SVFUtil::isa<ObjVar>(node) && "need an object node");
386
+ ObjVar* obj = SVFUtil::cast<ObjVar>(node);
387
387
  return getFIObjNode(obj->getMemObj());
388
388
  }
389
389
  //@}
@@ -415,7 +415,7 @@ public:
415
415
  inline bool isNonPointerObj(NodeID id) const
416
416
  {
417
417
  SVFVar* node = getGNode(id);
418
- if (FIObjPN* fiNode = SVFUtil::dyn_cast<FIObjPN>(node))
418
+ if (FIObjVar* fiNode = SVFUtil::dyn_cast<FIObjVar>(node))
419
419
  {
420
420
  return (fiNode->getMemObj()->hasPtrObj() == false);
421
421
  }
@@ -423,7 +423,7 @@ public:
423
423
  {
424
424
  return (gepNode->getMemObj()->isNonPtrFieldObj(gepNode->getLocationSet()));
425
425
  }
426
- else if (SVFUtil::isa<DummyObjPN>(node))
426
+ else if (SVFUtil::isa<DummyObjVar>(node))
427
427
  {
428
428
  return false;
429
429
  }
@@ -447,8 +447,8 @@ public:
447
447
  inline const MemObj* getBaseObj(NodeID id) const
448
448
  {
449
449
  const SVFVar* node = pag->getGNode(id);
450
- assert(SVFUtil::isa<ObjPN>(node) && "need an object node");
451
- const ObjPN* obj = SVFUtil::cast<ObjPN>(node);
450
+ assert(SVFUtil::isa<ObjVar>(node) && "need an object node");
451
+ const ObjVar* obj = SVFUtil::cast<ObjVar>(node);
452
452
  return obj->getMemObj();
453
453
  }
454
454
  //@}
@@ -530,7 +530,7 @@ private:
530
530
  /// Add a value (pointer) node
531
531
  inline NodeID addValNode(const Value* val, NodeID i)
532
532
  {
533
- SVFVar *node = new ValPN(val,i);
533
+ SVFVar *node = new ValVar(val,i);
534
534
  return addValNode(val, node, i);
535
535
  }
536
536
  /// Add a memory obj node
@@ -565,12 +565,12 @@ private:
565
565
  //@{
566
566
  inline NodeID addDummyValNode(NodeID i)
567
567
  {
568
- return addValNode(nullptr, new DummyValPN(i), i);
568
+ return addValNode(nullptr, new DummyValVar(i), i);
569
569
  }
570
570
  inline NodeID addDummyObjNode(NodeID i, const Type* type)
571
571
  {
572
572
  const MemObj* mem = addDummyMemObj(i, type);
573
- return addObjNode(nullptr, new DummyObjPN(i,mem), i);
573
+ return addObjNode(nullptr, new DummyObjVar(i,mem), i);
574
574
  }
575
575
  inline const MemObj* addDummyMemObj(NodeID i, const Type* type)
576
576
  {
@@ -578,11 +578,11 @@ private:
578
578
  }
579
579
  inline NodeID addBlackholeObjNode()
580
580
  {
581
- return addObjNode(nullptr, new DummyObjPN(getBlackHoleNode(),getBlackHoleObj()), getBlackHoleNode());
581
+ return addObjNode(nullptr, new DummyObjVar(getBlackHoleNode(),getBlackHoleObj()), getBlackHoleNode());
582
582
  }
583
583
  inline NodeID addConstantObjNode()
584
584
  {
585
- return addObjNode(nullptr, new DummyObjPN(getConstantNode(),getConstantObj()), getConstantNode());
585
+ return addObjNode(nullptr, new DummyObjVar(getConstantNode(),getConstantObj()), getConstantNode());
586
586
  }
587
587
  inline NodeID addBlackholePtrNode()
588
588
  {
@@ -626,33 +626,33 @@ private:
626
626
  /// Add an edge into SVFIR
627
627
  //@{
628
628
  /// Add Address edge
629
- AddrPE* addAddrPE(NodeID src, NodeID dst);
629
+ AddrStmt* addAddrPE(NodeID src, NodeID dst);
630
630
  /// Add Copy edge
631
- CopyPE* addCopyPE(NodeID src, NodeID dst);
631
+ CopyStmt* addCopyPE(NodeID src, NodeID dst);
632
632
  /// Add phi node information
633
- PhiPE* addPhiNode(NodeID res, NodeID opnd);
633
+ PhiStmt* addPhiNode(NodeID res, NodeID opnd);
634
634
  /// Add Copy edge
635
- CmpPE* addCmpPE(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
635
+ CmpStmt* addCmpPE(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
636
636
  /// Add Copy edge
637
- BinaryOPPE* addBinaryOPPE(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
637
+ BinaryOPStmt* addBinaryOPPE(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
638
638
  /// Add Unary edge
639
- UnaryOPPE* addUnaryOPPE(NodeID src, NodeID dst, u32_t opcode);
639
+ UnaryOPStmt* addUnaryOPPE(NodeID src, NodeID dst, u32_t opcode);
640
640
  /// Add BranchStmt
641
641
  BranchStmt* addBranchStmt(NodeID br, NodeID cond, std::vector<const ICFGNode*> succs);
642
642
  /// Add Load edge
643
- LoadPE* addLoadPE(NodeID src, NodeID dst);
643
+ LoadStmt* addLoadPE(NodeID src, NodeID dst);
644
644
  /// Add Store edge
645
- StorePE* addStorePE(NodeID src, NodeID dst, const IntraBlockNode* val);
645
+ StoreStmt* addStorePE(NodeID src, NodeID dst, const IntraBlockNode* val);
646
646
  /// Add Call edge
647
647
  CallPE* addCallPE(NodeID src, NodeID dst, const CallBlockNode* cs);
648
648
  /// Add Return edge
649
649
  RetPE* addRetPE(NodeID src, NodeID dst, const CallBlockNode* cs);
650
650
  /// Add Gep edge
651
- GepPE* addGepPE(NodeID src, NodeID dst, const LocationSet& ls, bool constGep);
651
+ GepStmt* addGepPE(NodeID src, NodeID dst, const LocationSet& ls, bool constGep);
652
652
  /// Add Offset(Gep) edge
653
- NormalGepPE* addNormalGepPE(NodeID src, NodeID dst, const LocationSet& ls);
653
+ NormalGepStmt* addNormalGepPE(NodeID src, NodeID dst, const LocationSet& ls);
654
654
  /// Add Variant(Gep) edge
655
- VariantGepPE* addVariantGepPE(NodeID src, NodeID dst);
655
+ VariantGepStmt* addVariantGepPE(NodeID src, NodeID dst);
656
656
  /// Add Thread fork edge for parameter passing
657
657
  TDForkPE* addThreadForkPE(NodeID src, NodeID dst, const CallBlockNode* cs);
658
658
  /// Add Thread join edge for parameter passing
@@ -193,16 +193,16 @@ private:
193
193
  /*!
194
194
  * Copy edge
195
195
  */
196
- class AddrPE: public SVFStmt
196
+ class AddrStmt: public SVFStmt
197
197
  {
198
198
  private:
199
- AddrPE(); ///< place holder
200
- AddrPE(const AddrPE &); ///< place holder
201
- void operator=(const AddrPE &); ///< place holder
199
+ AddrStmt(); ///< place holder
200
+ AddrStmt(const AddrStmt &); ///< place holder
201
+ void operator=(const AddrStmt &); ///< place holder
202
202
  public:
203
203
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
204
204
  //@{
205
- static inline bool classof(const AddrPE *)
205
+ static inline bool classof(const AddrStmt *)
206
206
  {
207
207
  return true;
208
208
  }
@@ -217,7 +217,7 @@ public:
217
217
  //@}
218
218
 
219
219
  /// constructor
220
- AddrPE(SVFVar* s, SVFVar* d) : SVFStmt(s,d,SVFStmt::Addr)
220
+ AddrStmt(SVFVar* s, SVFVar* d) : SVFStmt(s,d,SVFStmt::Addr)
221
221
  {
222
222
  }
223
223
 
@@ -228,16 +228,16 @@ public:
228
228
  /*!
229
229
  * Copy edge
230
230
  */
231
- class CopyPE: public SVFStmt
231
+ class CopyStmt: public SVFStmt
232
232
  {
233
233
  private:
234
- CopyPE(); ///< place holder
235
- CopyPE(const CopyPE &); ///< place holder
236
- void operator=(const CopyPE &); ///< place holder
234
+ CopyStmt(); ///< place holder
235
+ CopyStmt(const CopyStmt &); ///< place holder
236
+ void operator=(const CopyStmt &); ///< place holder
237
237
  public:
238
238
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
239
239
  //@{
240
- static inline bool classof(const CopyPE *)
240
+ static inline bool classof(const CopyStmt *)
241
241
  {
242
242
  return true;
243
243
  }
@@ -252,7 +252,7 @@ public:
252
252
  //@}
253
253
 
254
254
  /// constructor
255
- CopyPE(SVFVar* s, SVFVar* d) : SVFStmt(s,d,SVFStmt::Copy)
255
+ CopyStmt(SVFVar* s, SVFVar* d) : SVFStmt(s,d,SVFStmt::Copy)
256
256
  {
257
257
  }
258
258
 
@@ -325,12 +325,12 @@ public:
325
325
  /*!
326
326
  * Phi instruction edge
327
327
  */
328
- class PhiPE: public MultiOpndStmt
328
+ class PhiStmt: public MultiOpndStmt
329
329
  {
330
330
  private:
331
- PhiPE(); ///< place holder
332
- PhiPE(const PhiPE &); ///< place holder
333
- void operator=(const PhiPE &); ///< place holder
331
+ PhiStmt(); ///< place holder
332
+ PhiStmt(const PhiStmt &); ///< place holder
333
+ void operator=(const PhiStmt &); ///< place holder
334
334
  SVFVar* getSrcNode(); ///< place holder, not allowed since this SVFStmt has multiple operands but not a single source
335
335
  SVFVar* getDstNode(); ///< place holder, use getRes() instead
336
336
  SVFVar* getSrcID(); ///< place holder, use getOpVarID(pos) instead
@@ -339,7 +339,7 @@ private:
339
339
  public:
340
340
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
341
341
  //@{
342
- static inline bool classof(const PhiPE *)
342
+ static inline bool classof(const PhiStmt *)
343
343
  {
344
344
  return true;
345
345
  }
@@ -358,7 +358,7 @@ public:
358
358
  //@}
359
359
 
360
360
  /// constructor
361
- PhiPE(SVFVar* s, const OPVars& opnds) : MultiOpndStmt(s,opnds,SVFStmt::Phi)
361
+ PhiStmt(SVFVar* s, const OPVars& opnds) : MultiOpndStmt(s,opnds,SVFStmt::Phi)
362
362
  {
363
363
  }
364
364
  void addOpVar(SVFVar* op){
@@ -371,12 +371,12 @@ public:
371
371
  /*!
372
372
  * Compare instruction edge
373
373
  */
374
- class CmpPE: public MultiOpndStmt
374
+ class CmpStmt: public MultiOpndStmt
375
375
  {
376
376
  private:
377
- CmpPE(); ///< place holder
378
- CmpPE(const CmpPE &); ///< place holder
379
- void operator=(const CmpPE &); ///< place holder
377
+ CmpStmt(); ///< place holder
378
+ CmpStmt(const CmpStmt &); ///< place holder
379
+ void operator=(const CmpStmt &); ///< place holder
380
380
  SVFVar* getSrcNode(); ///< place holder, not allowed since this SVFStmt has multiple operands but not a single source
381
381
  SVFVar* getDstNode(); ///< place holder, use getRes() instead
382
382
  SVFVar* getSrcID(); ///< place holder, use getOpVarID(pos) instead
@@ -386,7 +386,7 @@ private:
386
386
  public:
387
387
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
388
388
  //@{
389
- static inline bool classof(const CmpPE *)
389
+ static inline bool classof(const CmpStmt *)
390
390
  {
391
391
  return true;
392
392
  }
@@ -405,7 +405,7 @@ public:
405
405
  //@}
406
406
 
407
407
  /// constructor
408
- CmpPE(SVFVar* s, const OPVars& opnds, u32_t oc) : MultiOpndStmt(s,opnds,SVFStmt::Cmp), opcode(oc)
408
+ CmpStmt(SVFVar* s, const OPVars& opnds, u32_t oc) : MultiOpndStmt(s,opnds,SVFStmt::Cmp), opcode(oc)
409
409
  {
410
410
  }
411
411
 
@@ -421,12 +421,12 @@ public:
421
421
  /*!
422
422
  * Binary instruction edge
423
423
  */
424
- class BinaryOPPE: public MultiOpndStmt
424
+ class BinaryOPStmt: public MultiOpndStmt
425
425
  {
426
426
  private:
427
- BinaryOPPE(); ///< place holder
428
- BinaryOPPE(const BinaryOPPE &); ///< place holder
429
- void operator=(const BinaryOPPE &); ///< place holder
427
+ BinaryOPStmt(); ///< place holder
428
+ BinaryOPStmt(const BinaryOPStmt &); ///< place holder
429
+ void operator=(const BinaryOPStmt &); ///< place holder
430
430
  SVFVar* getSrcNode(); ///< place holder, not allowed since this SVFStmt has multiple operands but not a single source
431
431
  SVFVar* getDstNode(); ///< place holder, use getRes() instead
432
432
  SVFVar* getSrcID(); ///< place holder, use getOpVarID(pos) instead
@@ -437,7 +437,7 @@ private:
437
437
  public:
438
438
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
439
439
  //@{
440
- static inline bool classof(const BinaryOPPE *)
440
+ static inline bool classof(const BinaryOPStmt *)
441
441
  {
442
442
  return true;
443
443
  }
@@ -456,7 +456,7 @@ public:
456
456
  //@}
457
457
 
458
458
  /// constructor
459
- BinaryOPPE(SVFVar* s, const OPVars& opnds, u32_t oc) : MultiOpndStmt(s,opnds,SVFStmt::BinaryOp), opcode(oc)
459
+ BinaryOPStmt(SVFVar* s, const OPVars& opnds, u32_t oc) : MultiOpndStmt(s,opnds,SVFStmt::BinaryOp), opcode(oc)
460
460
  {
461
461
  }
462
462
 
@@ -471,12 +471,12 @@ public:
471
471
  /*!
472
472
  * Unary instruction edge
473
473
  */
474
- class UnaryOPPE: public SVFStmt
474
+ class UnaryOPStmt: public SVFStmt
475
475
  {
476
476
  private:
477
- UnaryOPPE(); ///< place holder
478
- UnaryOPPE(const UnaryOPPE &); ///< place holder
479
- void operator=(const UnaryOPPE &); ///< place holder
477
+ UnaryOPStmt(); ///< place holder
478
+ UnaryOPStmt(const UnaryOPStmt &); ///< place holder
479
+ void operator=(const UnaryOPStmt &); ///< place holder
480
480
  SVFVar* getSrcNode(); ///< place holder, use getOpVar() instead
481
481
  SVFVar* getDstNode(); ///< place holder, use getRes() instead
482
482
  SVFVar* getSrcID(); ///< place holder, use getOpVarID() instead
@@ -486,7 +486,7 @@ private:
486
486
  public:
487
487
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
488
488
  //@{
489
- static inline bool classof(const UnaryOPPE *)
489
+ static inline bool classof(const UnaryOPStmt *)
490
490
  {
491
491
  return true;
492
492
  }
@@ -501,7 +501,7 @@ public:
501
501
  //@}
502
502
 
503
503
  /// constructor
504
- UnaryOPPE(SVFVar* s, SVFVar* d, u32_t oc) : SVFStmt(s,d,SVFStmt::UnaryOp), opcode(oc)
504
+ UnaryOPStmt(SVFVar* s, SVFVar* d, u32_t oc) : SVFStmt(s,d,SVFStmt::UnaryOp), opcode(oc)
505
505
  {
506
506
  }
507
507
 
@@ -588,17 +588,17 @@ public:
588
588
  /*!
589
589
  * Store edge
590
590
  */
591
- class StorePE: public SVFStmt
591
+ class StoreStmt: public SVFStmt
592
592
  {
593
593
  private:
594
- StorePE(); ///< place holder
595
- StorePE(const StorePE &); ///< place holder
596
- void operator=(const StorePE &); ///< place holder
594
+ StoreStmt(); ///< place holder
595
+ StoreStmt(const StoreStmt &); ///< place holder
596
+ void operator=(const StoreStmt &); ///< place holder
597
597
 
598
598
  public:
599
599
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
600
600
  //@{
601
- static inline bool classof(const StorePE *)
601
+ static inline bool classof(const StoreStmt *)
602
602
  {
603
603
  return true;
604
604
  }
@@ -613,7 +613,7 @@ public:
613
613
  //@}
614
614
 
615
615
  /// constructor
616
- StorePE(SVFVar* s, SVFVar* d, const IntraBlockNode* st) :
616
+ StoreStmt(SVFVar* s, SVFVar* d, const IntraBlockNode* st) :
617
617
  SVFStmt(s, d, makeEdgeFlagWithStoreInst(SVFStmt::Store, st))
618
618
  {
619
619
  }
@@ -625,17 +625,17 @@ public:
625
625
  /*!
626
626
  * Load edge
627
627
  */
628
- class LoadPE: public SVFStmt
628
+ class LoadStmt: public SVFStmt
629
629
  {
630
630
  private:
631
- LoadPE(); ///< place holder
632
- LoadPE(const LoadPE &); ///< place holder
633
- void operator=(const LoadPE &); ///< place holder
631
+ LoadStmt(); ///< place holder
632
+ LoadStmt(const LoadStmt &); ///< place holder
633
+ void operator=(const LoadStmt &); ///< place holder
634
634
 
635
635
  public:
636
636
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
637
637
  //@{
638
- static inline bool classof(const LoadPE *)
638
+ static inline bool classof(const LoadStmt *)
639
639
  {
640
640
  return true;
641
641
  }
@@ -650,7 +650,7 @@ public:
650
650
  //@}
651
651
 
652
652
  /// constructor
653
- LoadPE(SVFVar* s, SVFVar* d) : SVFStmt(s,d,SVFStmt::Load)
653
+ LoadStmt(SVFVar* s, SVFVar* d) : SVFStmt(s,d,SVFStmt::Load)
654
654
  {
655
655
  }
656
656
 
@@ -661,17 +661,17 @@ public:
661
661
  /*!
662
662
  * Gep edge
663
663
  */
664
- class GepPE: public SVFStmt
664
+ class GepStmt: public SVFStmt
665
665
  {
666
666
  private:
667
- GepPE(); ///< place holder
668
- GepPE(const GepPE &); ///< place holder
669
- void operator=(const GepPE &); ///< place holder
667
+ GepStmt(); ///< place holder
668
+ GepStmt(const GepStmt &); ///< place holder
669
+ void operator=(const GepStmt &); ///< place holder
670
670
 
671
671
  public:
672
672
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
673
673
  //@{
674
- static inline bool classof(const GepPE *)
674
+ static inline bool classof(const GepStmt *)
675
675
  {
676
676
  return true;
677
677
  }
@@ -689,7 +689,7 @@ public:
689
689
 
690
690
  protected:
691
691
  /// constructor
692
- GepPE(SVFVar* s, SVFVar* d, PEDGEK k) : SVFStmt(s,d,k)
692
+ GepStmt(SVFVar* s, SVFVar* d, PEDGEK k) : SVFStmt(s,d,k)
693
693
  {
694
694
 
695
695
  }
@@ -701,23 +701,23 @@ protected:
701
701
  /*!
702
702
  * Gep edge with a fixed offset
703
703
  */
704
- class NormalGepPE : public GepPE
704
+ class NormalGepStmt : public GepStmt
705
705
  {
706
706
  private:
707
- NormalGepPE(); ///< place holder
708
- NormalGepPE(const NormalGepPE&); ///< place holder
709
- void operator=(const NormalGepPE&); ///< place holder
707
+ NormalGepStmt(); ///< place holder
708
+ NormalGepStmt(const NormalGepStmt&); ///< place holder
709
+ void operator=(const NormalGepStmt&); ///< place holder
710
710
 
711
711
  LocationSet ls; ///< location set of the gep edge
712
712
 
713
713
  public:
714
714
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
715
715
  //@{
716
- static inline bool classof(const NormalGepPE *)
716
+ static inline bool classof(const NormalGepStmt *)
717
717
  {
718
718
  return true;
719
719
  }
720
- static inline bool classof(const GepPE *edge)
720
+ static inline bool classof(const GepStmt *edge)
721
721
  {
722
722
  return edge->getEdgeKind() == SVFStmt::NormalGep;
723
723
  }
@@ -732,7 +732,7 @@ public:
732
732
  //@}
733
733
 
734
734
  /// constructor
735
- NormalGepPE(SVFVar* s, SVFVar* d, const LocationSet& l) : GepPE(s,d,SVFStmt::NormalGep), ls(l)
735
+ NormalGepStmt(SVFVar* s, SVFVar* d, const LocationSet& l) : GepStmt(s,d,SVFStmt::NormalGep), ls(l)
736
736
  {}
737
737
 
738
738
  /// offset of the gep edge
@@ -751,21 +751,21 @@ public:
751
751
  /*!
752
752
  * Gep edge with a variant offset
753
753
  */
754
- class VariantGepPE : public GepPE
754
+ class VariantGepStmt : public GepStmt
755
755
  {
756
756
  private:
757
- VariantGepPE(); ///< place holder
758
- VariantGepPE(const VariantGepPE&); ///< place holder
759
- void operator=(const VariantGepPE&); ///< place holder
757
+ VariantGepStmt(); ///< place holder
758
+ VariantGepStmt(const VariantGepStmt&); ///< place holder
759
+ void operator=(const VariantGepStmt&); ///< place holder
760
760
 
761
761
  public:
762
762
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
763
763
  //@{
764
- static inline bool classof(const VariantGepPE *)
764
+ static inline bool classof(const VariantGepStmt *)
765
765
  {
766
766
  return true;
767
767
  }
768
- static inline bool classof(const GepPE *edge)
768
+ static inline bool classof(const GepStmt *edge)
769
769
  {
770
770
  return edge->getEdgeKind() == SVFStmt::VariantGep;
771
771
  }
@@ -780,7 +780,7 @@ public:
780
780
  //@}
781
781
 
782
782
  /// constructor
783
- VariantGepPE(SVFVar* s, SVFVar* d) : GepPE(s,d,SVFStmt::VariantGep) {}
783
+ VariantGepStmt(SVFVar* s, SVFVar* d) : GepStmt(s,d,SVFStmt::VariantGep) {}
784
784
 
785
785
  virtual const std::string toString() const override;
786
786
 
@@ -270,13 +270,13 @@ public:
270
270
  /*
271
271
  * Value(Pointer) node
272
272
  */
273
- class ValPN: public SVFVar
273
+ class ValVar: public SVFVar
274
274
  {
275
275
 
276
276
  public:
277
277
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
278
278
  //@{
279
- static inline bool classof(const ValPN *)
279
+ static inline bool classof(const ValVar *)
280
280
  {
281
281
  return true;
282
282
  }
@@ -295,7 +295,7 @@ public:
295
295
  //@}
296
296
 
297
297
  /// Constructor
298
- ValPN(const Value* val, NodeID i, PNODEK ty = ValNode) :
298
+ ValVar(const Value* val, NodeID i, PNODEK ty = ValNode) :
299
299
  SVFVar(val, i, ty)
300
300
  {
301
301
  }
@@ -314,20 +314,20 @@ public:
314
314
  /*
315
315
  * Memory Object node
316
316
  */
317
- class ObjPN: public SVFVar
317
+ class ObjVar: public SVFVar
318
318
  {
319
319
 
320
320
  protected:
321
321
  const MemObj* mem; ///< memory object
322
322
  /// Constructor
323
- ObjPN(const Value* val, NodeID i, const MemObj* m, PNODEK ty = ObjNode) :
323
+ ObjVar(const Value* val, NodeID i, const MemObj* m, PNODEK ty = ObjNode) :
324
324
  SVFVar(val, i, ty), mem(m)
325
325
  {
326
326
  }
327
327
  public:
328
328
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
329
329
  //@{
330
- static inline bool classof(const ObjPN *)
330
+ static inline bool classof(const ObjVar *)
331
331
  {
332
332
  return true;
333
333
  }
@@ -381,7 +381,7 @@ public:
381
381
  * e.g. memcpy, temp gep value node needs to be created
382
382
  * Each Gep Value node is connected to base value node via gep edge
383
383
  */
384
- class GepValPN: public ValPN
384
+ class GepValVar: public ValVar
385
385
  {
386
386
 
387
387
  private:
@@ -392,11 +392,11 @@ private:
392
392
  public:
393
393
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
394
394
  //@{
395
- static inline bool classof(const GepValPN *)
395
+ static inline bool classof(const GepValVar *)
396
396
  {
397
397
  return true;
398
398
  }
399
- static inline bool classof(const ValPN * node)
399
+ static inline bool classof(const ValVar * node)
400
400
  {
401
401
  return node->getNodeKind() == SVFVar::GepValNode;
402
402
  }
@@ -411,8 +411,8 @@ public:
411
411
  //@}
412
412
 
413
413
  /// Constructor
414
- GepValPN(const Value* val, NodeID i, const LocationSet& l, const Type *ty, u32_t idx) :
415
- ValPN(val, i, GepValNode), ls(l), gepValType(ty), fieldIdx(idx)
414
+ GepValVar(const Value* val, NodeID i, const LocationSet& l, const Type *ty, u32_t idx) :
415
+ ValVar(val, i, GepValNode), ls(l), gepValType(ty), fieldIdx(idx)
416
416
  {
417
417
  }
418
418
 
@@ -448,7 +448,7 @@ public:
448
448
  * Gep Obj node, this is dynamic generated for field sensitive analysis
449
449
  * Each gep obj node is one field of a MemObj (base)
450
450
  */
451
- class GepObjPN: public ObjPN
451
+ class GepObjPN: public ObjVar
452
452
  {
453
453
  private:
454
454
  LocationSet ls;
@@ -461,7 +461,7 @@ public:
461
461
  {
462
462
  return true;
463
463
  }
464
- static inline bool classof(const ObjPN * node)
464
+ static inline bool classof(const ObjVar * node)
465
465
  {
466
466
  return node->getNodeKind() == SVFVar::GepObjNode
467
467
  || node->getNodeKind() == SVFVar::CloneGepObjNode;
@@ -480,7 +480,7 @@ public:
480
480
 
481
481
  /// Constructor
482
482
  GepObjPN(const MemObj* mem, NodeID i, const LocationSet& l, PNODEK ty = GepObjNode) :
483
- ObjPN(mem->getValue(), i, mem, ty), ls(l)
483
+ ObjVar(mem->getValue(), i, mem, ty), ls(l)
484
484
  {
485
485
  base = mem->getId();
486
486
  }
@@ -524,17 +524,17 @@ public:
524
524
  * Field-insensitive Gep Obj node, 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
- class FIObjPN: public ObjPN
527
+ class FIObjVar: public ObjVar
528
528
  {
529
529
  public:
530
530
 
531
531
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
532
532
  //@{
533
- static inline bool classof(const FIObjPN *)
533
+ static inline bool classof(const FIObjVar *)
534
534
  {
535
535
  return true;
536
536
  }
537
- static inline bool classof(const ObjPN * node)
537
+ static inline bool classof(const ObjVar * node)
538
538
  {
539
539
  return node->getNodeKind() == SVFVar::FIObjNode
540
540
  || node->getNodeKind() == SVFVar::CloneFIObjNode;
@@ -552,8 +552,8 @@ public:
552
552
  //@}
553
553
 
554
554
  /// Constructor
555
- FIObjPN(const Value* val, NodeID i, const MemObj* mem, PNODEK ty = FIObjNode) :
556
- ObjPN(val, i, mem, ty)
555
+ FIObjVar(const Value* val, NodeID i, const MemObj* mem, PNODEK ty = FIObjNode) :
556
+ ObjVar(val, i, mem, ty)
557
557
  {
558
558
  }
559
559
 
@@ -651,13 +651,13 @@ public:
651
651
  /*
652
652
  * Dummy node
653
653
  */
654
- class DummyValPN: public ValPN
654
+ class DummyValVar: public ValVar
655
655
  {
656
656
 
657
657
  public:
658
658
 
659
659
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
660
- static inline bool classof(const DummyValPN *)
660
+ static inline bool classof(const DummyValVar *)
661
661
  {
662
662
  return true;
663
663
  }
@@ -672,7 +672,7 @@ public:
672
672
  //@}
673
673
 
674
674
  /// Constructor
675
- DummyValPN(NodeID i) : ValPN(nullptr, i, DummyValNode)
675
+ DummyValVar(NodeID i) : ValVar(nullptr, i, DummyValNode)
676
676
  {
677
677
  }
678
678
 
@@ -690,13 +690,13 @@ public:
690
690
  /*
691
691
  * Dummy node
692
692
  */
693
- class DummyObjPN: public ObjPN
693
+ class DummyObjVar: public ObjVar
694
694
  {
695
695
 
696
696
  public:
697
697
 
698
698
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
699
- static inline bool classof(const DummyObjPN *)
699
+ static inline bool classof(const DummyObjVar *)
700
700
  {
701
701
  return true;
702
702
  }
@@ -713,8 +713,8 @@ public:
713
713
  //@}
714
714
 
715
715
  /// Constructor
716
- DummyObjPN(NodeID i,const MemObj* m, PNODEK ty = DummyObjNode)
717
- : ObjPN(nullptr, i, m, ty)
716
+ DummyObjVar(NodeID i,const MemObj* m, PNODEK ty = DummyObjNode)
717
+ : ObjVar(nullptr, i, m, ty)
718
718
  {
719
719
  }
720
720
 
@@ -730,11 +730,11 @@ public:
730
730
  /*
731
731
  * Clone object node for dummy objects.
732
732
  */
733
- class CloneDummyObjPN: public DummyObjPN
733
+ class CloneDummyObjVar: public DummyObjVar
734
734
  {
735
735
  public:
736
736
  //@{ Methods to support type inquiry through isa, cast, and dyn_cast:
737
- static inline bool classof(const CloneDummyObjPN *)
737
+ static inline bool classof(const CloneDummyObjVar *)
738
738
  {
739
739
  return true;
740
740
  }
@@ -749,15 +749,15 @@ public:
749
749
  //@}
750
750
 
751
751
  /// Constructor
752
- CloneDummyObjPN(NodeID i, const MemObj* m, PNODEK ty = CloneDummyObjNode)
753
- : DummyObjPN(i, m, ty)
752
+ CloneDummyObjVar(NodeID i, const MemObj* m, PNODEK ty = CloneDummyObjNode)
753
+ : DummyObjVar(i, m, ty)
754
754
  {
755
755
  }
756
756
 
757
757
  /// Return name of this node
758
758
  inline const std::string getValueName() const
759
759
  {
760
- return "clone of " + ObjPN::getValueName();
760
+ return "clone of " + ObjVar::getValueName();
761
761
  }
762
762
 
763
763
  virtual const std::string toString() const;
@@ -766,11 +766,11 @@ public:
766
766
  /*
767
767
  * Clone object for GEP objects.
768
768
  */
769
- class CloneGepObjPN : public GepObjPN
769
+ class CloneGepObjVar : public GepObjPN
770
770
  {
771
771
  public:
772
772
  //@{ Methods to support type inquiry through isa, cast, and dyn_cast:
773
- static inline bool classof(const CloneGepObjPN *)
773
+ static inline bool classof(const CloneGepObjVar *)
774
774
  {
775
775
  return true;
776
776
  }
@@ -785,7 +785,7 @@ public:
785
785
  //@}
786
786
 
787
787
  /// Constructor
788
- CloneGepObjPN(const MemObj* mem, NodeID i, const LocationSet& l, PNODEK ty = CloneGepObjNode) :
788
+ CloneGepObjVar(const MemObj* mem, NodeID i, const LocationSet& l, PNODEK ty = CloneGepObjNode) :
789
789
  GepObjPN(mem, i, l, ty)
790
790
  {
791
791
  }
@@ -802,11 +802,11 @@ public:
802
802
  /*
803
803
  * Clone object for FI objects.
804
804
  */
805
- class CloneFIObjPN : public FIObjPN
805
+ class CloneFIObjVar : public FIObjVar
806
806
  {
807
807
  public:
808
808
  //@{ Methods to support type inquiry through isa, cast, and dyn_cast:
809
- static inline bool classof(const CloneFIObjPN *)
809
+ static inline bool classof(const CloneFIObjVar *)
810
810
  {
811
811
  return true;
812
812
  }
@@ -821,15 +821,15 @@ public:
821
821
  //@}
822
822
 
823
823
  /// Constructor
824
- CloneFIObjPN(const Value* val, NodeID i, const MemObj* mem, PNODEK ty = CloneFIObjNode) :
825
- FIObjPN(val, i, mem, ty)
824
+ CloneFIObjVar(const Value* val, NodeID i, const MemObj* mem, PNODEK ty = CloneFIObjNode) :
825
+ FIObjVar(val, i, mem, ty)
826
826
  {
827
827
  }
828
828
 
829
829
  /// Return name of this node
830
830
  inline const std::string getValueName() const
831
831
  {
832
- return "clone (FI) of " + FIObjPN::getValueName();
832
+ return "clone (FI) of " + FIObjVar::getValueName();
833
833
  }
834
834
 
835
835
  virtual const std::string toString() const;
@@ -281,44 +281,44 @@ public:
281
281
  }
282
282
 
283
283
  /// Add Address edge
284
- inline AddrPE* addAddrEdge(NodeID src, NodeID dst)
284
+ inline AddrStmt* addAddrEdge(NodeID src, NodeID dst)
285
285
  {
286
- AddrPE *edge = pag->addAddrPE(src, dst);
286
+ AddrStmt *edge = pag->addAddrPE(src, dst);
287
287
  setCurrentBBAndValueForPAGEdge(edge);
288
288
  return edge;
289
289
  }
290
290
  /// Add Copy edge
291
- inline CopyPE* addCopyEdge(NodeID src, NodeID dst)
291
+ inline CopyStmt* addCopyEdge(NodeID src, NodeID dst)
292
292
  {
293
- CopyPE *edge = pag->addCopyPE(src, dst);
293
+ CopyStmt *edge = pag->addCopyPE(src, dst);
294
294
  setCurrentBBAndValueForPAGEdge(edge);
295
295
  return edge;
296
296
  }
297
297
  /// Add Copy edge
298
- inline PhiPE* addPhiNode(NodeID res, NodeID opnd)
298
+ inline PhiStmt* addPhiNode(NodeID res, NodeID opnd)
299
299
  {
300
- PhiPE *edge = pag->addPhiNode(res,opnd);
300
+ PhiStmt *edge = pag->addPhiNode(res,opnd);
301
301
  setCurrentBBAndValueForPAGEdge(edge);
302
302
  return edge;
303
303
  }
304
304
  /// Add Copy edge
305
- inline CmpPE* addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
305
+ inline CmpStmt* addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
306
306
  {
307
- CmpPE *edge = pag->addCmpPE(op1, op2, dst, opcode);
307
+ CmpStmt *edge = pag->addCmpPE(op1, op2, dst, opcode);
308
308
  setCurrentBBAndValueForPAGEdge(edge);
309
309
  return edge;
310
310
  }
311
311
  /// Add Copy edge
312
- inline BinaryOPPE* addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
312
+ inline BinaryOPStmt* addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
313
313
  {
314
- BinaryOPPE *edge = pag->addBinaryOPPE(op1, op2, dst, opcode);
314
+ BinaryOPStmt *edge = pag->addBinaryOPPE(op1, op2, dst, opcode);
315
315
  setCurrentBBAndValueForPAGEdge(edge);
316
316
  return edge;
317
317
  }
318
318
  /// Add Unary edge
319
- inline UnaryOPPE* addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
319
+ inline UnaryOPStmt* addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
320
320
  {
321
- UnaryOPPE *edge = pag->addUnaryOPPE(src, dst, opcode);
321
+ UnaryOPStmt *edge = pag->addUnaryOPPE(src, dst, opcode);
322
322
  setCurrentBBAndValueForPAGEdge(edge);
323
323
  return edge;
324
324
  }
@@ -329,21 +329,21 @@ public:
329
329
  return edge;
330
330
  }
331
331
  /// Add Load edge
332
- inline LoadPE* addLoadEdge(NodeID src, NodeID dst)
332
+ inline LoadStmt* addLoadEdge(NodeID src, NodeID dst)
333
333
  {
334
- LoadPE *edge = pag->addLoadPE(src, dst);
334
+ LoadStmt *edge = pag->addLoadPE(src, dst);
335
335
  setCurrentBBAndValueForPAGEdge(edge);
336
336
  return edge;
337
337
  }
338
338
  /// Add Store edge
339
- inline StorePE* addStoreEdge(NodeID src, NodeID dst)
339
+ inline StoreStmt* addStoreEdge(NodeID src, NodeID dst)
340
340
  {
341
341
  IntraBlockNode* node;
342
342
  if(const Instruction* inst = SVFUtil::dyn_cast<Instruction>(curVal))
343
343
  node = pag->getICFG()->getIntraBlockNode(inst);
344
344
  else
345
345
  node = nullptr;
346
- StorePE *edge = pag->addStorePE(src, dst, node);
346
+ StoreStmt *edge = pag->addStorePE(src, dst, node);
347
347
  setCurrentBBAndValueForPAGEdge(edge);
348
348
  return edge;
349
349
  }
@@ -362,23 +362,23 @@ public:
362
362
  return edge;
363
363
  }
364
364
  /// Add Gep edge
365
- inline GepPE* addGepEdge(NodeID src, NodeID dst, const LocationSet& ls, bool constGep)
365
+ inline GepStmt* addGepEdge(NodeID src, NodeID dst, const LocationSet& ls, bool constGep)
366
366
  {
367
- GepPE *edge = pag->addGepPE(src, dst, ls, constGep);
367
+ GepStmt *edge = pag->addGepPE(src, dst, ls, constGep);
368
368
  setCurrentBBAndValueForPAGEdge(edge);
369
369
  return edge;
370
370
  }
371
371
  /// Add Offset(Gep) edge
372
- inline NormalGepPE* addNormalGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
372
+ inline NormalGepStmt* addNormalGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
373
373
  {
374
- NormalGepPE *edge = pag->addNormalGepPE(src, dst, ls);
374
+ NormalGepStmt *edge = pag->addNormalGepPE(src, dst, ls);
375
375
  setCurrentBBAndValueForPAGEdge(edge);
376
376
  return edge;
377
377
  }
378
378
  /// Add Variant(Gep) edge
379
- inline VariantGepPE* addVariantGepEdge(NodeID src, NodeID dst)
379
+ inline VariantGepStmt* addVariantGepEdge(NodeID src, NodeID dst)
380
380
  {
381
- VariantGepPE *edge = pag->addVariantGepPE(src, dst);
381
+ VariantGepStmt *edge = pag->addVariantGepPE(src, dst);
382
382
  setCurrentBBAndValueForPAGEdge(edge);
383
383
  return edge;
384
384
  }
Binary file
@@ -1,8 +1,8 @@
1
- //===----- CHG.h -- Base class of pointer analyses ---------------------------//
1
+ //===----- CHG.h -- Class hirachary graph ---------------------------//
2
2
  //
3
3
  // SVF: Static Value-Flow Analysis
4
4
  //
5
- // Copyright (C) <2013-2017> <Yulei Sui>
5
+ // Copyright (C) <2013-> <Yulei Sui>
6
6
  //
7
7
 
8
8
  // This program is free software: you can redistribute it and/or modify
@@ -103,8 +103,9 @@ protected:
103
103
  NodeID phiId = getDef(cs_ret);
104
104
  NodeID retdef = getDef(fun_ret);
105
105
  /// If a function does not have any return instruction. The def of a FormalRetVFGNode is itself (see VFG.h: addFormalRetVFGNode).
106
- /// Therefore, we do not connect return edge from a function without any return instruction.
107
- if (retdef == getFormalRetVFGNode(fun_ret)->getId())
106
+ /// Therefore, we do not connect return edge from a function without any return instruction (i.e., pag->isPhiNode(fun_ret)==false)
107
+ /// because unique fun_ret PAGNode was not collected as a PhiNode in SVFIRBuilder::visitReturnInst
108
+ if (pag->isPhiNode(fun_ret)==false)
108
109
  return;
109
110
 
110
111
  SVFGEdge* edge = addRetEdge(retdef, phiId, csId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.739",
3
+ "version": "1.0.743",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {