svf-tools 1.0.677 → 1.0.679

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.
@@ -133,6 +133,7 @@ template <typename Key, typename Value, typename Hash = Hash<Key>,
133
133
  {
134
134
  friend class SVFModuleWrite;
135
135
  friend class SVFModuleRead;
136
+ friend class SVFIRWriter;
136
137
 
137
138
  private:
138
139
  /// flattened field indices of a struct (ignoring arrays)
@@ -243,6 +244,7 @@ class SVFType
243
244
  {
244
245
  friend class SVFModuleWrite;
245
246
  friend class SVFModuleRead;
247
+ friend class SVFIRWriter;
246
248
 
247
249
  public:
248
250
  typedef s64_t GNodeK;
@@ -328,6 +330,7 @@ class SVFPointerType : public SVFType
328
330
  {
329
331
  friend class SVFModuleWrite;
330
332
  friend class SVFModuleRead;
333
+ friend class SVFIRWriter;
331
334
 
332
335
  private:
333
336
  const SVFType* ptrElementType;
@@ -361,6 +364,7 @@ class SVFFunctionType : public SVFType
361
364
  {
362
365
  friend class SVFModuleWrite;
363
366
  friend class SVFModuleRead;
367
+ friend class SVFIRWriter;
364
368
 
365
369
  private:
366
370
  const SVFType* retTy;
@@ -51,6 +51,7 @@ class SVFLoopAndDomInfo
51
51
  {
52
52
  friend class SVFModuleWrite;
53
53
  friend class SVFModuleRead;
54
+ friend class SVFIRWriter;
54
55
  public:
55
56
  typedef Set<const SVFBasicBlock*> BBSet;
56
57
  typedef std::vector<const SVFBasicBlock*> BBList;
@@ -151,6 +152,7 @@ class SVFValue
151
152
  {
152
153
  friend class SVFModuleWrite;
153
154
  friend class SVFModuleRead;
155
+ friend class SVFIRWriter;
154
156
  friend class LLVMModuleSet;
155
157
 
156
158
  public:
@@ -186,9 +188,10 @@ protected:
186
188
  std::string name; ///< Short name of this value for debugging
187
189
  std::string sourceLoc; ///< Source code information of this value
188
190
  /// Constructor
189
- SVFValue(const std::string& val, const SVFType* ty, SVFValKind k): kind(k),
190
- ptrInUncalledFun(false), constDataOrAggData(SVFConstData==k), type(ty),
191
- name(val), sourceLoc("No source code Info")
191
+ SVFValue(const std::string& val, const SVFType* ty, SVFValKind k)
192
+ : kind(k), ptrInUncalledFun(false),
193
+ constDataOrAggData(SVFConstData == k), type(ty), name(val),
194
+ sourceLoc("No source code Info")
192
195
  {
193
196
  }
194
197
 
@@ -212,6 +215,7 @@ public:
212
215
  return kind;
213
216
  }
214
217
 
218
+ // TODO: (Optimization) Returns `const std::string&`?
215
219
  inline virtual const std::string getName() const
216
220
  {
217
221
  return name;
@@ -264,6 +268,7 @@ class SVFFunction : public SVFValue
264
268
  friend class LLVMModuleSet;
265
269
  friend class SVFModuleWrite;
266
270
  friend class SVFModuleRead;
271
+ friend class SVFIRWriter;
267
272
 
268
273
  public:
269
274
  typedef std::vector<const SVFBasicBlock*>::const_iterator const_iterator;
@@ -480,6 +485,7 @@ class SVFBasicBlock : public SVFValue
480
485
  friend class LLVMModuleSet;
481
486
  friend class SVFModuleWrite;
482
487
  friend class SVFModuleRead;
488
+ friend class SVFIRWriter;
483
489
 
484
490
  public:
485
491
  typedef std::vector<const SVFInstruction*>::const_iterator const_iterator;
@@ -580,6 +586,7 @@ class SVFInstruction : public SVFValue
580
586
  {
581
587
  friend class SVFModuleWrite;
582
588
  friend class SVFModuleRead;
589
+ friend class SVFIRWriter;
583
590
  public:
584
591
  typedef std::vector<const SVFInstruction*> InstVec;
585
592
 
@@ -647,6 +654,7 @@ class SVFCallInst : public SVFInstruction
647
654
  {
648
655
  friend class SVFModuleWrite;
649
656
  friend class SVFModuleRead;
657
+ friend class SVFIRWriter;
650
658
  friend class LLVMModuleSet;
651
659
 
652
660
  private:
@@ -721,6 +729,7 @@ class SVFVirtualCallInst : public SVFCallInst
721
729
  {
722
730
  friend class SVFModuleWrite;
723
731
  friend class SVFModuleRead;
732
+ friend class SVFIRWriter;
724
733
  friend class LLVMModuleSet;
725
734
 
726
735
  private:
@@ -779,6 +788,7 @@ class SVFConstant : public SVFValue
779
788
  {
780
789
  friend class SVFModuleWrite;
781
790
  friend class SVFModuleRead;
791
+ friend class SVFIRWriter;
782
792
  public:
783
793
  SVFConstant(const std::string& _const, const SVFType* ty, SVFValKind k = SVFConst): SVFValue(_const, ty, k)
784
794
  {
@@ -801,6 +811,7 @@ class SVFGlobalValue : public SVFConstant
801
811
  {
802
812
  friend class SVFModuleWrite;
803
813
  friend class SVFModuleRead;
814
+ friend class SVFIRWriter;
804
815
  friend class LLVMModuleSet;
805
816
 
806
817
  private:
@@ -839,6 +850,7 @@ class SVFArgument : public SVFValue
839
850
  {
840
851
  friend class SVFModuleWrite;
841
852
  friend class SVFModuleRead;
853
+ friend class SVFIRWriter;
842
854
  private:
843
855
  const SVFFunction* fun;
844
856
  u32_t argNo;
@@ -878,6 +890,7 @@ class SVFConstantData : public SVFConstant
878
890
  {
879
891
  friend class SVFModuleWrite;
880
892
  friend class SVFModuleRead;
893
+ friend class SVFIRWriter;
881
894
  public:
882
895
  SVFConstantData(const std::string& _const, const SVFType* ty, SVFValKind k = SVFConstData): SVFConstant(_const, ty, k)
883
896
  {
@@ -907,6 +920,7 @@ class SVFConstantInt : public SVFConstantData
907
920
  {
908
921
  friend class SVFModuleWrite;
909
922
  friend class SVFModuleRead;
923
+ friend class SVFIRWriter;
910
924
  private:
911
925
  u64_t zval;
912
926
  s64_t sval;
@@ -941,6 +955,7 @@ class SVFConstantFP : public SVFConstantData
941
955
  {
942
956
  friend class SVFModuleWrite;
943
957
  friend class SVFModuleRead;
958
+ friend class SVFIRWriter;
944
959
  private:
945
960
  float dval;
946
961
  public:
@@ -968,6 +983,7 @@ class SVFConstantNullPtr : public SVFConstantData
968
983
  {
969
984
  friend class SVFModuleWrite;
970
985
  friend class SVFModuleRead;
986
+ friend class SVFIRWriter;
971
987
 
972
988
  public:
973
989
  SVFConstantNullPtr(const std::string& _const, const SVFType* ty): SVFConstantData(_const, ty, SVFValue::SVFNullPtr)
@@ -989,6 +1005,7 @@ class SVFBlackHoleValue : public SVFConstantData
989
1005
  {
990
1006
  friend class SVFModuleWrite;
991
1007
  friend class SVFModuleRead;
1008
+ friend class SVFIRWriter;
992
1009
 
993
1010
  public:
994
1011
  SVFBlackHoleValue(const std::string& _const, const SVFType* ty): SVFConstantData(_const, ty, SVFValue::SVFBlackHole)
@@ -1010,6 +1027,7 @@ class SVFOtherValue : public SVFValue
1010
1027
  {
1011
1028
  friend class SVFModuleWrite;
1012
1029
  friend class SVFModuleRead;
1030
+ friend class SVFIRWriter;
1013
1031
  public:
1014
1032
  SVFOtherValue(const std::string& other, const SVFType* ty, SVFValKind k = SVFValue::SVFOther): SVFValue(other, ty, k)
1015
1033
  {
@@ -1029,6 +1047,7 @@ class SVFMetadataAsValue : public SVFOtherValue
1029
1047
  {
1030
1048
  friend class SVFModuleWrite;
1031
1049
  friend class SVFModuleRead;
1050
+ friend class SVFIRWriter;
1032
1051
  public:
1033
1052
  SVFMetadataAsValue(const std::string& other, const SVFType* ty): SVFOtherValue(other, ty, SVFValue::SVFMetaAsValue)
1034
1053
  {
@@ -1049,9 +1068,10 @@ public:
1049
1068
  class CallSite
1050
1069
  {
1051
1070
  private:
1052
- const SVFCallInst *CB;
1071
+ const SVFCallInst* CB;
1072
+
1053
1073
  public:
1054
- CallSite(const SVFInstruction *I) : CB(SVFUtil::dyn_cast<SVFCallInst>(I))
1074
+ CallSite(const SVFInstruction* I) : CB(SVFUtil::dyn_cast<SVFCallInst>(I))
1055
1075
  {
1056
1076
  assert(CB && "not a callsite?");
1057
1077
  }
@@ -1118,19 +1138,18 @@ public:
1118
1138
  assert(isVirtualCall() && "not a virtual call?");
1119
1139
  return SVFUtil::cast<SVFVirtualCallInst>(CB)->getFunNameOfVirtualCall();
1120
1140
  }
1121
- bool operator==(const CallSite &CS) const
1141
+ bool operator==(const CallSite& CS) const
1122
1142
  {
1123
1143
  return CB == CS.CB;
1124
1144
  }
1125
- bool operator!=(const CallSite &CS) const
1145
+ bool operator!=(const CallSite& CS) const
1126
1146
  {
1127
1147
  return CB != CS.CB;
1128
1148
  }
1129
- bool operator<(const CallSite &CS) const
1149
+ bool operator<(const CallSite& CS) const
1130
1150
  {
1131
1151
  return getInstruction() < CS.getInstruction();
1132
1152
  }
1133
-
1134
1153
  };
1135
1154
 
1136
1155
  template <typename F, typename S>
@@ -41,9 +41,10 @@ class SVFVar;
41
41
  /*
42
42
  * SVFIR program variables (PAGNodes)
43
43
  */
44
- typedef GenericNode<SVFVar,SVFStmt> GenericPAGNodeTy;
44
+ typedef GenericNode<SVFVar, SVFStmt> GenericPAGNodeTy;
45
45
  class SVFVar : public GenericPAGNodeTy
46
46
  {
47
+ friend class SVFIRWriter;
47
48
  friend class IRGraph;
48
49
  friend class SVFIR;
49
50
  friend class VFG;
@@ -82,31 +83,31 @@ public:
82
83
  /// Constructor
83
84
  SVFVar(const SVFValue* val, NodeID i, PNODEK k);
84
85
  /// Destructor
85
- virtual ~SVFVar()
86
- {
87
- }
86
+ virtual ~SVFVar() {}
88
87
 
89
88
  /// Get/has methods of the components
90
89
  //@{
91
90
  inline const SVFValue* getValue() const
92
91
  {
93
- assert((this->getNodeKind() != DummyValNode && this->getNodeKind() != DummyObjNode) && "dummy node do not have value!");
94
- assert((SymbolTableInfo::isBlkObjOrConstantObj(this->getId())==false) && "blackhole and constant obj do not have value");
95
- assert(value && "value is null (GepObjNode whose basenode is a DummyObj?)");
92
+ assert(this->getNodeKind() != DummyValNode &&
93
+ this->getNodeKind() != DummyObjNode &&
94
+ "dummy node do not have value!");
95
+ assert(!SymbolTableInfo::isBlkObjOrConstantObj(this->getId()) &&
96
+ "blackhole and constant obj do not have value");
97
+ assert(value &&
98
+ "value is null (GepObjNode whose basenode is a DummyObj?)");
96
99
  return value;
97
100
  }
98
101
 
99
102
  /// Return type of the value
100
103
  inline virtual const SVFType* getType() const
101
104
  {
102
- if (value)
103
- return value->getType();
104
- return nullptr;
105
+ return value ? value->getType() : nullptr;
105
106
  }
106
107
 
107
108
  inline bool hasValue() const
108
109
  {
109
- return value!=nullptr;
110
+ return value != nullptr;
110
111
  }
111
112
  /// Whether it is a pointer
112
113
  virtual inline bool isPointer() const
@@ -121,18 +122,19 @@ public:
121
122
  bool isIsolatedNode() const;
122
123
 
123
124
  /// Get name of the LLVM value
125
+ // TODO: (Optimization) Should it return const reference instead of value?
124
126
  virtual const std::string getValueName() const = 0;
125
127
 
126
128
  /// Return the function that this SVFVar resides in. Return nullptr if it is a global or constantexpr node
127
129
  virtual inline const SVFFunction* getFunction() const
128
130
  {
129
- if(value)
131
+ if (value)
130
132
  {
131
- if(const SVFInstruction* inst = SVFUtil::dyn_cast<SVFInstruction>(value))
133
+ if (auto inst = SVFUtil::dyn_cast<SVFInstruction>(value))
132
134
  return inst->getParent()->getParent();
133
- else if (const SVFArgument* arg = SVFUtil::dyn_cast<SVFArgument>(value))
135
+ else if (auto arg = SVFUtil::dyn_cast<SVFArgument>(value))
134
136
  return arg->getParent();
135
- else if (const SVFFunction* fun = SVFUtil::dyn_cast<SVFFunction>(value))
137
+ else if (auto fun = SVFUtil::dyn_cast<SVFFunction>(value))
136
138
  return fun;
137
139
  }
138
140
  return nullptr;
@@ -255,15 +257,16 @@ public:
255
257
  */
256
258
  class ValVar: public SVFVar
257
259
  {
260
+ friend class SVFIRWriter;
258
261
 
259
262
  public:
260
263
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
261
264
  //@{
262
- static inline bool classof(const ValVar *)
265
+ static inline bool classof(const ValVar*)
263
266
  {
264
267
  return true;
265
268
  }
266
- static inline bool classof(const SVFVar *node)
269
+ static inline bool classof(const SVFVar* node)
267
270
  {
268
271
  return node->getNodeKind() == SVFVar::ValNode ||
269
272
  node->getNodeKind() == SVFVar::GepValNode ||
@@ -271,7 +274,7 @@ public:
271
274
  node->getNodeKind() == SVFVar::VarargNode ||
272
275
  node->getNodeKind() == SVFVar::DummyValNode;
273
276
  }
274
- static inline bool classof(const GenericPAGNodeTy *node)
277
+ static inline bool classof(const GenericPAGNodeTy* node)
275
278
  {
276
279
  return node->getNodeKind() == SVFVar::ValNode ||
277
280
  node->getNodeKind() == SVFVar::GepValNode ||
@@ -282,8 +285,8 @@ public:
282
285
  //@}
283
286
 
284
287
  /// Constructor
285
- ValVar(const SVFValue* val, NodeID i, PNODEK ty = ValNode) :
286
- SVFVar(val, i, ty)
288
+ ValVar(const SVFValue* val, NodeID i, PNODEK ty = ValNode)
289
+ : SVFVar(val, i, ty)
287
290
  {
288
291
  }
289
292
  /// Return name of a LLVM value
@@ -297,12 +300,12 @@ public:
297
300
  virtual const std::string toString() const;
298
301
  };
299
302
 
300
-
301
303
  /*
302
304
  * Memory Object variable
303
305
  */
304
306
  class ObjVar: public SVFVar
305
307
  {
308
+ friend class SVFIRWriter;
306
309
 
307
310
  protected:
308
311
  const MemObj* mem; ///< memory object
@@ -314,18 +317,18 @@ protected:
314
317
  public:
315
318
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
316
319
  //@{
317
- static inline bool classof(const ObjVar *)
320
+ static inline bool classof(const ObjVar*)
318
321
  {
319
322
  return true;
320
323
  }
321
- static inline bool classof(const SVFVar *node)
324
+ static inline bool classof(const SVFVar* node)
322
325
  {
323
326
  return node->getNodeKind() == SVFVar::ObjNode ||
324
327
  node->getNodeKind() == SVFVar::GepObjNode ||
325
328
  node->getNodeKind() == SVFVar::FIObjNode ||
326
329
  node->getNodeKind() == SVFVar::DummyObjNode;
327
330
  }
328
- static inline bool classof(const GenericPAGNodeTy *node)
331
+ static inline bool classof(const GenericPAGNodeTy* node)
329
332
  {
330
333
  return node->getNodeKind() == SVFVar::ObjNode ||
331
334
  node->getNodeKind() == SVFVar::GepObjNode ||
@@ -364,6 +367,7 @@ public:
364
367
  */
365
368
  class GepValVar: public ValVar
366
369
  {
370
+ friend class SVFIRWriter;
367
371
 
368
372
  private:
369
373
  LocationSet ls; // LocationSet
@@ -391,8 +395,9 @@ public:
391
395
  //@}
392
396
 
393
397
  /// Constructor
394
- GepValVar(const SVFValue* val, NodeID i, const LocationSet& l, const SVFType* ty) :
395
- ValVar(val, i, GepValNode), ls(l), gepValType(ty)
398
+ GepValVar(const SVFValue* val, NodeID i, const LocationSet& l,
399
+ const SVFType* ty)
400
+ : ValVar(val, i, GepValNode), ls(l), gepValType(ty)
396
401
  {
397
402
  }
398
403
 
@@ -406,7 +411,8 @@ public:
406
411
  inline const std::string getValueName() const
407
412
  {
408
413
  if (value)
409
- return value->getName() + "_" + std::to_string(getConstantFieldIdx());
414
+ return value->getName() + "_" +
415
+ std::to_string(getConstantFieldIdx());
410
416
  return "offset_" + std::to_string(getConstantFieldIdx());
411
417
  }
412
418
 
@@ -425,6 +431,8 @@ public:
425
431
  */
426
432
  class GepObjVar: public ObjVar
427
433
  {
434
+ friend class SVFIRWriter;
435
+
428
436
  private:
429
437
  LocationSet ls;
430
438
  NodeID base = 0;
@@ -432,27 +440,28 @@ private:
432
440
  public:
433
441
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
434
442
  //@{
435
- static inline bool classof(const GepObjVar *)
443
+ static inline bool classof(const GepObjVar*)
436
444
  {
437
445
  return true;
438
446
  }
439
- static inline bool classof(const ObjVar * node)
447
+ static inline bool classof(const ObjVar* node)
440
448
  {
441
449
  return node->getNodeKind() == SVFVar::GepObjNode;
442
450
  }
443
- static inline bool classof(const SVFVar *node)
451
+ static inline bool classof(const SVFVar* node)
444
452
  {
445
453
  return node->getNodeKind() == SVFVar::GepObjNode;
446
454
  }
447
- static inline bool classof(const GenericPAGNodeTy *node)
455
+ static inline bool classof(const GenericPAGNodeTy* node)
448
456
  {
449
457
  return node->getNodeKind() == SVFVar::GepObjNode;
450
458
  }
451
459
  //@}
452
460
 
453
461
  /// Constructor
454
- GepObjVar(const MemObj* mem, NodeID i, const LocationSet& l, PNODEK ty = GepObjNode) :
455
- ObjVar(mem->getValue(), i, mem, ty), ls(l)
462
+ GepObjVar(const MemObj* mem, NodeID i, const LocationSet& l,
463
+ PNODEK ty = GepObjNode)
464
+ : ObjVar(mem->getValue(), i, mem, ty), ls(l)
456
465
  {
457
466
  base = mem->getId();
458
467
  }
@@ -504,31 +513,33 @@ public:
504
513
  */
505
514
  class FIObjVar: public ObjVar
506
515
  {
507
- public:
516
+ friend class SVFIRWriter;
508
517
 
518
+ public:
509
519
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
510
520
  //@{
511
- static inline bool classof(const FIObjVar *)
521
+ static inline bool classof(const FIObjVar*)
512
522
  {
513
523
  return true;
514
524
  }
515
- static inline bool classof(const ObjVar * node)
525
+ static inline bool classof(const ObjVar* node)
516
526
  {
517
527
  return node->getNodeKind() == SVFVar::FIObjNode;
518
528
  }
519
- static inline bool classof(const SVFVar *node)
529
+ static inline bool classof(const SVFVar* node)
520
530
  {
521
531
  return node->getNodeKind() == SVFVar::FIObjNode;
522
532
  }
523
- static inline bool classof(const GenericPAGNodeTy *node)
533
+ static inline bool classof(const GenericPAGNodeTy* node)
524
534
  {
525
535
  return node->getNodeKind() == SVFVar::FIObjNode;
526
536
  }
527
537
  //@}
528
538
 
529
539
  /// Constructor
530
- FIObjVar(const SVFValue* val, NodeID i, const MemObj* mem, PNODEK ty = FIObjNode) :
531
- ObjVar(val, i, mem, ty)
540
+ FIObjVar(const SVFValue* val, NodeID i, const MemObj* mem,
541
+ PNODEK ty = FIObjNode)
542
+ : ObjVar(val, i, mem, ty)
532
543
  {
533
544
  }
534
545
 
@@ -548,33 +559,30 @@ public:
548
559
  */
549
560
  class RetPN: public ValVar
550
561
  {
562
+ friend class SVFIRWriter;
551
563
 
552
564
  public:
553
-
554
565
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
555
- static inline bool classof(const RetPN *)
566
+ static inline bool classof(const RetPN*)
556
567
  {
557
568
  return true;
558
569
  }
559
- static inline bool classof(const SVFVar *node)
570
+ static inline bool classof(const SVFVar* node)
560
571
  {
561
572
  return node->getNodeKind() == SVFVar::RetNode;
562
573
  }
563
- static inline bool classof(const ValVar *node)
574
+ static inline bool classof(const ValVar* node)
564
575
  {
565
576
  return node->getNodeKind() == SVFVar::RetNode;
566
577
  }
567
- static inline bool classof(const GenericPAGNodeTy *node)
578
+ static inline bool classof(const GenericPAGNodeTy* node)
568
579
  {
569
580
  return node->getNodeKind() == SVFVar::RetNode;
570
581
  }
571
582
  //@}
572
583
 
573
584
  /// Constructor
574
- RetPN(const SVFFunction* val, NodeID i) :
575
- ValVar(val, i, RetNode)
576
- {
577
- }
585
+ RetPN(const SVFFunction* val, NodeID i) : ValVar(val, i, RetNode) {}
578
586
 
579
587
  /// Return name of a LLVM value
580
588
  const std::string getValueName() const
@@ -585,39 +593,35 @@ public:
585
593
  virtual const std::string toString() const;
586
594
  };
587
595
 
588
-
589
596
  /*
590
597
  * Unique vararg node of a procedure
591
598
  */
592
599
  class VarArgPN: public ValVar
593
600
  {
601
+ friend class SVFIRWriter;
594
602
 
595
603
  public:
596
-
597
604
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
598
- static inline bool classof(const VarArgPN *)
605
+ static inline bool classof(const VarArgPN*)
599
606
  {
600
607
  return true;
601
608
  }
602
- static inline bool classof(const SVFVar *node)
609
+ static inline bool classof(const SVFVar* node)
603
610
  {
604
611
  return node->getNodeKind() == SVFVar::VarargNode;
605
612
  }
606
- static inline bool classof(const ValVar *node)
613
+ static inline bool classof(const ValVar* node)
607
614
  {
608
615
  return node->getNodeKind() == SVFVar::VarargNode;
609
616
  }
610
- static inline bool classof(const GenericPAGNodeTy *node)
617
+ static inline bool classof(const GenericPAGNodeTy* node)
611
618
  {
612
619
  return node->getNodeKind() == SVFVar::VarargNode;
613
620
  }
614
621
  //@}
615
622
 
616
623
  /// Constructor
617
- VarArgPN(const SVFFunction* val, NodeID i) :
618
- ValVar(val, i, VarargNode)
619
- {
620
- }
624
+ VarArgPN(const SVFFunction* val, NodeID i) : ValVar(val, i, VarargNode) {}
621
625
 
622
626
  /// Return name of a LLVM value
623
627
  inline const std::string getValueName() const
@@ -628,41 +632,35 @@ public:
628
632
  virtual const std::string toString() const;
629
633
  };
630
634
 
631
-
632
-
633
-
634
635
  /*
635
636
  * Dummy variable without any LLVM value
636
637
  */
637
638
  class DummyValVar: public ValVar
638
639
  {
640
+ friend class SVFIRWriter;
639
641
 
640
642
  public:
641
-
642
643
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
643
- static inline bool classof(const DummyValVar *)
644
+ static inline bool classof(const DummyValVar*)
644
645
  {
645
646
  return true;
646
647
  }
647
- static inline bool classof(const SVFVar *node)
648
+ static inline bool classof(const SVFVar* node)
648
649
  {
649
650
  return node->getNodeKind() == SVFVar::DummyValNode;
650
651
  }
651
- static inline bool classof(const ValVar *node)
652
+ static inline bool classof(const ValVar* node)
652
653
  {
653
654
  return node->getNodeKind() == SVFVar::DummyValNode;
654
655
  }
655
- static inline bool classof(const GenericPAGNodeTy *node)
656
+ static inline bool classof(const GenericPAGNodeTy* node)
656
657
  {
657
658
  return node->getNodeKind() == SVFVar::DummyValNode;
658
659
  }
659
660
  //@}
660
661
 
661
662
  /// Constructor
662
- DummyValVar(NodeID i) : ValVar(nullptr, i, DummyValNode)
663
- {
664
- }
665
-
663
+ DummyValVar(NodeID i) : ValVar(nullptr, i, DummyValNode) {}
666
664
 
667
665
  /// Return name of this node
668
666
  inline const std::string getValueName() const
@@ -673,36 +671,35 @@ public:
673
671
  virtual const std::string toString() const;
674
672
  };
675
673
 
676
-
677
674
  /*
678
675
  * Dummy object variable
679
676
  */
680
677
  class DummyObjVar: public ObjVar
681
678
  {
679
+ friend class SVFIRWriter;
682
680
 
683
681
  public:
684
-
685
682
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
686
- static inline bool classof(const DummyObjVar *)
683
+ static inline bool classof(const DummyObjVar*)
687
684
  {
688
685
  return true;
689
686
  }
690
- static inline bool classof(const SVFVar *node)
687
+ static inline bool classof(const SVFVar* node)
691
688
  {
692
689
  return node->getNodeKind() == SVFVar::DummyObjNode;
693
690
  }
694
- static inline bool classof(const ObjVar *node)
691
+ static inline bool classof(const ObjVar* node)
695
692
  {
696
693
  return node->getNodeKind() == SVFVar::DummyObjNode;
697
694
  }
698
- static inline bool classof(const GenericPAGNodeTy *node)
695
+ static inline bool classof(const GenericPAGNodeTy* node)
699
696
  {
700
697
  return node->getNodeKind() == SVFVar::DummyObjNode;
701
698
  }
702
699
  //@}
703
700
 
704
701
  /// Constructor
705
- DummyObjVar(NodeID i,const MemObj* m, PNODEK ty = DummyObjNode)
702
+ DummyObjVar(NodeID i, const MemObj* m, PNODEK ty = DummyObjNode)
706
703
  : ObjVar(nullptr, i, m, ty)
707
704
  {
708
705
  }