svf-lib 1.0.2190 → 1.0.2191

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.
@@ -39,7 +39,8 @@ namespace SVF
39
39
 
40
40
  class SVFVar;
41
41
  /*
42
- * SVFIR program variables (PAGNodes)
42
+ * Program variables in SVFIR (based on PAG nodes)
43
+ * These represent variables in the program analysis graph
43
44
  */
44
45
  typedef GenericNode<SVFVar, SVFStmt> GenericPAGNodeTy;
45
46
  class SVFVar : public GenericPAGNodeTy
@@ -52,110 +53,71 @@ class SVFVar : public GenericPAGNodeTy
52
53
  friend class VFG;
53
54
 
54
55
  public:
55
- /// Nine kinds of SVFIR variables
56
- /// ValNode: llvm pointer value
57
- /// ObjNode: memory object
58
- /// RetNode: unique return node
59
- /// Vararg: unique node for vararg parameter
60
- /// GepValNode: temporary gep value node for field sensitivity
61
- /// GepValNode: temporary gep obj node for field sensitivity
62
- /// BaseObjNode: for field insensitive analysis
63
- /// DummyValNode and DummyObjNode: for non-llvm-value node
56
+ /// Node kinds for SVFIR variables:
57
+ /// ValNode - LLVM pointer value
58
+ /// ObjNode - Memory object
59
+ /// RetValNode - Function return value
60
+ /// VarargNode - Variable argument parameter
61
+ /// GepValNode - Temporary value for field-sensitive analysis
62
+ /// GepObjNode - Temporary object for field-sensitive analysis
63
+ /// BaseObjNode - Base object for field-insensitive analysis
64
+ /// DummyValNode/DummyObjNode - Nodes for non-LLVM values
64
65
  typedef GNodeK PNODEK;
65
66
  typedef s64_t GEdgeKind;
66
67
 
67
68
  protected:
68
- const SVFValue* value; ///< value of this SVFIR node
69
+ /// Maps tracking incoming and outgoing edges by kind
69
70
  SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap;
70
71
  SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap;
71
- bool isPtr; /// whether it is a pointer (top-level or address-taken)
72
72
 
73
- const SVFFunction* func; /// function containing this variable
74
-
75
- /// Constructor to create an empty object (for deserialization)
76
- SVFVar(NodeID i, PNODEK k) : GenericPAGNodeTy(i, k), value{} {}
73
+ /// Empty constructor for deserialization
74
+ SVFVar(NodeID i, PNODEK k) : GenericPAGNodeTy(i, k) {}
77
75
 
78
76
 
79
77
  public:
80
- /// Constructor
81
- SVFVar(const SVFValue* val, NodeID i, PNODEK k);
82
- /// Destructor
83
- virtual ~SVFVar() {}
84
-
85
- /// Get/has methods of the components
86
- //@{
87
- inline const SVFValue* getValue() const
88
- {
89
- assert(this->getNodeKind() != DummyValNode &&
90
- this->getNodeKind() != DummyObjNode &&
91
- "dummy node do not have value!");
92
- assert(!SymbolTableInfo::isBlkObjOrConstantObj(this->getId()) &&
93
- "blackhole and constant obj do not have value");
94
- assert(value && "value is null (GepObjNode whose basenode is a DummyObj?)");
95
- return value;
96
- }
78
+ /// Standard constructor with ID, type and kind
79
+ SVFVar(NodeID i, const SVFType* svfType, PNODEK k);
97
80
 
98
- /// Return type of the value
99
- inline virtual const SVFType* getType() const
100
- {
101
- return value ? value->getType() : nullptr;
102
- }
81
+ /// Virtual destructor
82
+ virtual ~SVFVar() {}
103
83
 
104
- inline bool hasValue() const
105
- {
106
- return value != nullptr;
107
- }
108
- /// Whether it is a pointer
84
+ /// Check if this variable represents a pointer
109
85
  virtual inline bool isPointer() const
110
86
  {
111
- return isPtr;
87
+ assert(type && "type is null?");
88
+ return type->isPointerTy();
112
89
  }
113
- /// Whether it is constant data, i.e., "0", "1.001", "str"
114
- /// or llvm's metadata, i.e., metadata !4087
90
+
91
+ /// Check if this variable represents constant data/metadata but not null pointer
115
92
  virtual bool isConstDataOrAggDataButNotNullPtr() const
116
93
  {
117
94
  return false;
118
95
  }
119
96
 
120
- /// Whether this is an isolated node on the SVFIR graph
97
+ /// Check if this node is isolated (no edges) in the SVFIR graph
121
98
  virtual bool isIsolatedNode() const;
122
99
 
123
- /// Get name of the LLVM value
124
- // TODO: (Optimization) Should it return const reference instead of value?
100
+ /// Get string name of the represented LLVM value
125
101
  virtual const std::string getValueName() const = 0;
126
102
 
127
- /// Return the function containing this SVFVar
128
- /// @return The SVFFunction containing this variable, or nullptr if it's a global/constant expression
103
+ /// Get containing function, or null for globals/constants
129
104
  virtual inline const SVFFunction* getFunction() const
130
105
  {
131
- // Return cached function if available
132
- if(func) return func;
133
-
134
- // If we have an associated LLVM value, check its parent function
135
- if (value)
136
- {
137
- // For instructions, return the function containing the parent basic block
138
- if (auto inst = SVFUtil::dyn_cast<SVFInstruction>(value))
139
- {
140
- return inst->getParent()->getParent();
141
- }
142
- }
143
-
144
- // Return nullptr for globals/constants with no parent function
145
106
  return nullptr;
146
107
  }
147
108
 
148
- /// Get incoming SVFIR statements (edges)
109
+ /// Edge accessors and checkers
110
+ //@{
149
111
  inline SVFStmt::SVFStmtSetTy& getIncomingEdges(SVFStmt::PEDGEK kind)
150
112
  {
151
113
  return InEdgeKindToSetMap[kind];
152
114
  }
153
- /// Get outgoing SVFIR statements (edges)
115
+
154
116
  inline SVFStmt::SVFStmtSetTy& getOutgoingEdges(SVFStmt::PEDGEK kind)
155
117
  {
156
118
  return OutEdgeKindToSetMap[kind];
157
119
  }
158
- /// Has incoming SVFIR statements (edges)
120
+
159
121
  inline bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
160
122
  {
161
123
  SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
@@ -164,7 +126,7 @@ public:
164
126
  else
165
127
  return false;
166
128
  }
167
- /// Has outgoing SVFIR statements (edges)
129
+
168
130
  inline bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
169
131
  {
170
132
  SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
@@ -174,39 +136,37 @@ public:
174
136
  return false;
175
137
  }
176
138
 
177
- /// Get incoming SVFStmt iterator
139
+ /// Edge iterators
178
140
  inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
179
141
  {
180
142
  SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
181
- assert(it!=InEdgeKindToSetMap.end() && "The node does not have such kind of edge");
143
+ assert(it!=InEdgeKindToSetMap.end() && "Edge kind not found");
182
144
  return it->second.begin();
183
145
  }
184
146
 
185
- /// Get incoming SVFStmt iterator
186
147
  inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
187
148
  {
188
149
  SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
189
- assert(it!=InEdgeKindToSetMap.end() && "The node does not have such kind of edge");
150
+ assert(it!=InEdgeKindToSetMap.end() && "Edge kind not found");
190
151
  return it->second.end();
191
152
  }
192
153
 
193
- /// Get outgoing SVFStmt iterator
194
154
  inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
195
155
  {
196
156
  SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
197
- assert(it!=OutEdgeKindToSetMap.end() && "The node does not have such kind of edge");
157
+ assert(it!=OutEdgeKindToSetMap.end() && "Edge kind not found");
198
158
  return it->second.begin();
199
159
  }
200
160
 
201
- /// Get outgoing SVFStmt iterator
202
161
  inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
203
162
  {
204
163
  SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
205
- assert(it!=OutEdgeKindToSetMap.end() && "The node does not have such kind of edge");
164
+ assert(it!=OutEdgeKindToSetMap.end() && "Edge kind not found");
206
165
  return it->second.end();
207
166
  }
208
167
  //@}
209
168
 
169
+ /// Type checking support for LLVM-style RTTI
210
170
  static inline bool classof(const SVFVar *)
211
171
  {
212
172
  return true;
@@ -222,6 +182,7 @@ public:
222
182
  return isSVFVarKind(node->getNodeKind());
223
183
  }
224
184
 
185
+ /// Check if this pointer is in an uncalled function
225
186
  inline virtual bool ptrInUncalledFunction() const
226
187
  {
227
188
  if (const SVFFunction* fun = getFunction())
@@ -234,6 +195,7 @@ public:
234
195
  }
235
196
  }
236
197
 
198
+ /// Check if this variable represents constant/aggregate data
237
199
  virtual bool isConstDataOrAggData() const
238
200
  {
239
201
  return false;
@@ -241,7 +203,7 @@ public:
241
203
 
242
204
 
243
205
  private:
244
- /// add methods of the components
206
+ /// Edge management methods
245
207
  //@{
246
208
  inline void addInEdge(SVFStmt* inEdge)
247
209
  {
@@ -256,7 +218,8 @@ private:
256
218
  OutEdgeKindToSetMap[kind].insert(outEdge);
257
219
  addOutgoingEdge(outEdge);
258
220
  }
259
- /// Has incoming VariantGepEdges
221
+
222
+ /// Check for incoming variable field GEP edges
260
223
  inline bool hasIncomingVariantGepEdge() const
261
224
  {
262
225
  SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::Gep);
@@ -272,20 +235,18 @@ private:
272
235
  }
273
236
 
274
237
  public:
238
+ /// Get string representation
275
239
  virtual const std::string toString() const;
276
240
 
277
- /// Dump to console for debugging
241
+ /// Debug dump to console
278
242
  void dump() const;
279
243
 
280
- //@}
281
- /// Overloading operator << for dumping SVFVar value
282
- //@{
244
+ /// Stream operator overload for output
283
245
  friend OutStream& operator<< (OutStream &o, const SVFVar &node)
284
246
  {
285
247
  o << node.toString();
286
248
  return o;
287
249
  }
288
- //@}
289
250
  };
290
251
 
291
252
 
@@ -326,16 +287,14 @@ public:
326
287
  //@}
327
288
 
328
289
  /// Constructor
329
- ValVar(const SVFValue* val, NodeID i, PNODEK ty = ValNode, const ICFGNode* node = nullptr)
330
- : SVFVar(val, i, ty), icfgNode(node)
290
+ ValVar(NodeID i, const SVFType* svfType, const ICFGNode* node, PNODEK ty = ValNode)
291
+ : SVFVar(i, svfType, ty), icfgNode(node)
331
292
  {
332
293
  }
333
294
  /// Return name of a LLVM value
334
295
  inline const std::string getValueName() const
335
296
  {
336
- if (value)
337
- return value->getName();
338
- return "";
297
+ return getName();
339
298
  }
340
299
 
341
300
  const ICFGNode* getICFGNode() const
@@ -343,6 +302,8 @@ public:
343
302
  return icfgNode;
344
303
  }
345
304
 
305
+ virtual const SVFFunction* getFunction() const;
306
+
346
307
  virtual const std::string toString() const;
347
308
  };
348
309
 
@@ -358,8 +319,8 @@ protected:
358
319
  /// Constructor to create an empty ObjVar (for SVFIRReader/deserialization)
359
320
  ObjVar(NodeID i, PNODEK ty = ObjNode) : SVFVar(i, ty) {}
360
321
  /// Constructor
361
- ObjVar(const SVFValue* val, NodeID i, PNODEK ty = ObjNode) :
362
- SVFVar(val, i, ty)
322
+ ObjVar(NodeID i, const SVFType* svfType, PNODEK ty = ObjNode) :
323
+ SVFVar(i, svfType, ty)
363
324
  {
364
325
  }
365
326
  public:
@@ -386,14 +347,7 @@ public:
386
347
  /// Return name of a LLVM value
387
348
  virtual const std::string getValueName() const
388
349
  {
389
- if (value)
390
- return value->getName();
391
- return "";
392
- }
393
- /// Return type of the value
394
- inline virtual const SVFType* getType() const
395
- {
396
- return value->getType();
350
+ return getName();
397
351
  }
398
352
 
399
353
  virtual const std::string toString() const;
@@ -418,7 +372,7 @@ private:
418
372
 
419
373
  protected:
420
374
  /// Constructor to create function argument (for SVFIRReader/deserialization)
421
- ArgValVar(NodeID i, PNODEK ty = ArgNode) : ValVar(i, ty) {}
375
+ ArgValVar(NodeID i, PNODEK ty = ArgValNode) : ValVar(i, ty) {}
422
376
 
423
377
  public:
424
378
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -429,32 +383,30 @@ public:
429
383
  }
430
384
  static inline bool classof(const ValVar* node)
431
385
  {
432
- return node->getNodeKind() == ArgNode;
386
+ return node->getNodeKind() == ArgValNode;
433
387
  }
434
388
  static inline bool classof(const SVFVar* node)
435
389
  {
436
- return node->getNodeKind() == ArgNode;
390
+ return node->getNodeKind() == ArgValNode;
437
391
  }
438
392
  static inline bool classof(const GenericPAGNodeTy* node)
439
393
  {
440
- return node->getNodeKind() == ArgNode;
394
+ return node->getNodeKind() == ArgValNode;
441
395
  }
442
396
  static inline bool classof(const SVFBaseNode* node)
443
397
  {
444
- return node->getNodeKind() == ArgNode;
398
+ return node->getNodeKind() == ArgValNode;
445
399
  }
446
400
  //@}
447
401
 
448
402
  /// Constructor
449
403
  ArgValVar(NodeID i, u32_t argNo, const ICFGNode* icn, const CallGraphNode* callGraphNode,
450
- bool isUncalled = false, PNODEK ty = ArgNode);
404
+ const SVFType* svfType, bool isUncalled = false);
451
405
 
452
406
  /// Return name of a LLVM value
453
407
  inline const std::string getValueName() const
454
408
  {
455
- if (value)
456
- return value->getName() + " (argument valvar)";
457
- return " (argument valvar)";
409
+ return getName() + " (argument valvar)";
458
410
  }
459
411
 
460
412
  virtual const SVFFunction* getFunction() const;
@@ -473,6 +425,8 @@ public:
473
425
  return uncalled;
474
426
  }
475
427
 
428
+ virtual bool isPointer() const;
429
+
476
430
  virtual const std::string toString() const;
477
431
  };
478
432
 
@@ -521,8 +475,8 @@ public:
521
475
  //@}
522
476
 
523
477
  /// Constructor
524
- GepValVar(ValVar* baseNode, const SVFValue* val, NodeID i, const AccessPath& ap,
525
- const SVFType* ty);
478
+ GepValVar(ValVar* baseNode, NodeID i, const AccessPath& ap,
479
+ const SVFType* ty, const ICFGNode* node);
526
480
 
527
481
  /// offset of the base value variable
528
482
  inline APOffset getConstantFieldIdx() const
@@ -539,10 +493,13 @@ public:
539
493
  /// Return name of a LLVM value
540
494
  inline const std::string getValueName() const
541
495
  {
542
- if (value)
543
- return value->getName() + "_" +
544
- std::to_string(getConstantFieldIdx());
545
- return "offset_" + std::to_string(getConstantFieldIdx());
496
+ return getName() + "_" +
497
+ std::to_string(getConstantFieldIdx());
498
+ }
499
+
500
+ virtual bool isPointer() const
501
+ {
502
+ return base->isPointer();
546
503
  }
547
504
 
548
505
  inline const SVFType* getType() const
@@ -550,6 +507,11 @@ public:
550
507
  return gepValType;
551
508
  }
552
509
 
510
+ virtual const SVFFunction* getFunction() const
511
+ {
512
+ return base->getFunction();
513
+ }
514
+
553
515
  virtual const std::string toString() const;
554
516
 
555
517
  virtual bool isConstDataOrAggDataButNotNullPtr() const
@@ -582,7 +544,7 @@ private:
582
544
 
583
545
  protected:
584
546
  /// Constructor to create empty ObjVar (for SVFIRReader/deserialization)
585
- BaseObjVar(NodeID i, PNODEK ty = BaseObjNode) : ObjVar(i, ty) {}
547
+ BaseObjVar(NodeID i, const ICFGNode* node, PNODEK ty = BaseObjNode) : ObjVar(i, ty), icfgNode(node) {}
586
548
 
587
549
  public:
588
550
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -610,8 +572,9 @@ public:
610
572
  //@}
611
573
 
612
574
  /// Constructor
613
- BaseObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti, PNODEK ty = BaseObjNode)
614
- : ObjVar(val, i, ty), typeInfo(ti)
575
+ BaseObjVar(NodeID i, ObjTypeInfo* ti,
576
+ const SVFType* svfType, const ICFGNode* node, PNODEK ty = BaseObjNode)
577
+ : ObjVar(i, svfType, ty), typeInfo(ti), icfgNode(node)
615
578
  {
616
579
  }
617
580
 
@@ -629,9 +592,7 @@ public:
629
592
  /// Return name of a LLVM value
630
593
  inline const std::string getValueName() const
631
594
  {
632
- if (value)
633
- return value->getName() + " (base object)";
634
- return " (base object)";
595
+ return getName() + " (base object)";
635
596
  }
636
597
 
637
598
  virtual const std::string toString() const;
@@ -768,6 +729,7 @@ public:
768
729
  typeInfo = nullptr;
769
730
  }
770
731
 
732
+ virtual const SVFFunction* getFunction() const;
771
733
 
772
734
  };
773
735
 
@@ -818,7 +780,7 @@ public:
818
780
  /// Constructor
819
781
  GepObjVar(const BaseObjVar* baseObj, NodeID i,
820
782
  const APOffset& apOffset, PNODEK ty = GepObjNode)
821
- : ObjVar(baseObj->hasValue()? baseObj->getValue(): nullptr, i, ty), apOffset(apOffset), base(baseObj)
783
+ : ObjVar(i, baseObj->getType(), ty), apOffset(apOffset), base(baseObj)
822
784
  {
823
785
  }
824
786
 
@@ -842,15 +804,18 @@ public:
842
804
  /// Return the type of this gep object
843
805
  inline virtual const SVFType* getType() const
844
806
  {
845
- return SymbolTableInfo::SymbolInfo()->getFlatternedElemType(value->getType(), apOffset);
807
+ return SymbolTableInfo::SymbolInfo()->getFlatternedElemType(type, apOffset);
846
808
  }
847
809
 
848
810
  /// Return name of a LLVM value
849
811
  inline const std::string getValueName() const
850
812
  {
851
- if (value)
852
- return value->getName() + "_" + std::to_string(apOffset);
853
- return "offset_" + std::to_string(apOffset);
813
+ return getName() + "_" + std::to_string(apOffset);
814
+ }
815
+
816
+ virtual const SVFFunction* getFunction() const
817
+ {
818
+ return base->getFunction();
854
819
  }
855
820
 
856
821
  virtual const std::string toString() const;
@@ -869,6 +834,11 @@ public:
869
834
  {
870
835
  return base->isConstDataOrAggDataButNotNullPtr();
871
836
  }
837
+
838
+ virtual bool isPointer() const
839
+ {
840
+ return base->isPointer();
841
+ }
872
842
  };
873
843
 
874
844
 
@@ -887,7 +857,7 @@ class HeapObjVar: public BaseObjVar
887
857
 
888
858
  protected:
889
859
  /// Constructor to create heap object var
890
- HeapObjVar(NodeID i, PNODEK ty = HeapObjNode) : BaseObjVar(i, ty) {}
860
+ HeapObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, HeapObjNode) {}
891
861
 
892
862
  public:
893
863
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -919,12 +889,9 @@ public:
919
889
  //@}
920
890
 
921
891
  /// Constructor
922
- HeapObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti,
923
- const SVFFunction* f, PNODEK ty = HeapObjNode):
924
- BaseObjVar(val, i, ti, ty)
892
+ HeapObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node):
893
+ BaseObjVar(i, ti, svfType, node, HeapObjNode)
925
894
  {
926
- isPtr = val->getType()->isPointerTy();
927
- func = f;
928
895
  }
929
896
 
930
897
  /// Return name of a LLVM value
@@ -953,7 +920,7 @@ class StackObjVar: public BaseObjVar
953
920
 
954
921
  protected:
955
922
  /// Constructor to create stack object var
956
- StackObjVar(NodeID i, PNODEK ty = StackObjNode) : BaseObjVar(i, ty) {}
923
+ StackObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, StackObjNode) {}
957
924
 
958
925
  public:
959
926
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -985,12 +952,9 @@ public:
985
952
  //@}
986
953
 
987
954
  /// Constructor
988
- StackObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti,
989
- const SVFFunction* fun, PNODEK ty = StackObjNode):
990
- BaseObjVar(val, i, ti, ty)
955
+ StackObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node):
956
+ BaseObjVar(i, ti, svfType, node, StackObjNode)
991
957
  {
992
- isPtr = val->getType()->isPointerTy();
993
- func = fun;
994
958
  }
995
959
 
996
960
  /// Return name of a LLVM value
@@ -1043,8 +1007,13 @@ public:
1043
1007
  }
1044
1008
 
1045
1009
  /// Constructor
1046
- FunValVar(NodeID i, const ICFGNode* icn, const CallGraphNode* cgn,
1047
- PNODEK ty = FunValNode);
1010
+ FunValVar(NodeID i, const ICFGNode* icn, const CallGraphNode* cgn, const SVFType* svfType);
1011
+
1012
+
1013
+ virtual bool isPointer() const
1014
+ {
1015
+ return true;
1016
+ }
1048
1017
 
1049
1018
  virtual const std::string toString() const;
1050
1019
  };
@@ -1059,7 +1028,7 @@ private:
1059
1028
 
1060
1029
  private:
1061
1030
  /// Constructor to create empty ObjVar (for SVFIRReader/deserialization)
1062
- FunObjVar(NodeID i, PNODEK ty = FunObjNode) : BaseObjVar(i, ty) {}
1031
+ FunObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i,node, FunObjNode) {}
1063
1032
 
1064
1033
  public:
1065
1034
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -1091,8 +1060,7 @@ public:
1091
1060
  //@}
1092
1061
 
1093
1062
  /// Constructor
1094
- FunObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti, const CallGraphNode* cgNode,
1095
- PNODEK ty = FunObjNode);
1063
+ FunObjVar(NodeID i, ObjTypeInfo* ti, const CallGraphNode* cgNode, const SVFType* svfType, const ICFGNode* node);
1096
1064
 
1097
1065
  inline const CallGraphNode* getCallGraphNode() const
1098
1066
  {
@@ -1101,6 +1069,8 @@ public:
1101
1069
 
1102
1070
  virtual const SVFFunction* getFunction() const;
1103
1071
 
1072
+ virtual bool isPointer() const;
1073
+
1104
1074
  virtual bool isIsolatedNode() const;
1105
1075
 
1106
1076
  virtual const std::string toString() const;
@@ -1137,16 +1107,17 @@ public:
1137
1107
  //@}
1138
1108
 
1139
1109
  /// Constructor
1140
- GlobalValVar(const SVFValue* val, NodeID i, const ICFGNode* icn,
1141
- PNODEK ty = GlobalValNode)
1142
- : ValVar(val, i, ty, icn)
1110
+ GlobalValVar(NodeID i, const ICFGNode* icn, const SVFType* svfType)
1111
+ : ValVar(i, svfType, icn, GlobalValNode)
1143
1112
  {
1113
+ type = svfType;
1144
1114
  }
1145
1115
 
1116
+
1146
1117
  virtual const std::string toString() const;
1147
1118
  };
1148
1119
 
1149
- class ConstantAggValVar: public ValVar
1120
+ class ConstAggValVar: public ValVar
1150
1121
  {
1151
1122
  friend class SVFIRWriter;
1152
1123
  friend class SVFIRReader;
@@ -1154,36 +1125,36 @@ class ConstantAggValVar: public ValVar
1154
1125
  public:
1155
1126
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
1156
1127
  //@{
1157
- static inline bool classof(const ConstantAggValVar*)
1128
+ static inline bool classof(const ConstAggValVar*)
1158
1129
  {
1159
1130
  return true;
1160
1131
  }
1161
1132
  static inline bool classof(const ValVar* node)
1162
1133
  {
1163
- return node->getNodeKind() == ConstantAggValNode;
1134
+ return node->getNodeKind() == ConstAggValNode;
1164
1135
  }
1165
1136
  static inline bool classof(const SVFVar* node)
1166
1137
  {
1167
- return node->getNodeKind() == ConstantAggValNode;
1138
+ return node->getNodeKind() == ConstAggValNode;
1168
1139
  }
1169
1140
  static inline bool classof(const GenericPAGNodeTy* node)
1170
1141
  {
1171
- return node->getNodeKind() == ConstantAggValNode;
1142
+ return node->getNodeKind() == ConstAggValNode;
1172
1143
  }
1173
1144
  static inline bool classof(const SVFBaseNode* node)
1174
1145
  {
1175
- return node->getNodeKind() == ConstantAggValNode;
1146
+ return node->getNodeKind() == ConstAggValNode;
1176
1147
  }
1177
1148
  //@}
1178
1149
 
1179
1150
  /// Constructor
1180
- ConstantAggValVar(const SVFValue* val, NodeID i, const ICFGNode* icn,
1181
- PNODEK ty = ConstantAggValNode)
1182
- : ValVar(val, i, ty, icn)
1151
+ ConstAggValVar(NodeID i, const ICFGNode* icn, const SVFType* svfTy)
1152
+ : ValVar(i, svfTy, icn, ConstAggValNode)
1183
1153
  {
1184
-
1154
+ type = svfTy;
1185
1155
  }
1186
1156
 
1157
+
1187
1158
  virtual bool isConstDataOrAggData() const
1188
1159
  {
1189
1160
  return true;
@@ -1198,7 +1169,7 @@ public:
1198
1169
  };
1199
1170
 
1200
1171
 
1201
- class ConstantDataValVar: public ValVar
1172
+ class ConstDataValVar : public ValVar
1202
1173
  {
1203
1174
  friend class SVFIRWriter;
1204
1175
  friend class SVFIRReader;
@@ -1206,7 +1177,7 @@ class ConstantDataValVar: public ValVar
1206
1177
  public:
1207
1178
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
1208
1179
  //@{
1209
- static inline bool classof(const ConstantDataValVar*)
1180
+ static inline bool classof(const ConstDataValVar*)
1210
1181
  {
1211
1182
  return true;
1212
1183
  }
@@ -1229,9 +1200,9 @@ public:
1229
1200
  //@}
1230
1201
 
1231
1202
  /// Constructor
1232
- ConstantDataValVar(const SVFValue* val, NodeID i, const ICFGNode* icn,
1233
- PNODEK ty = ConstantDataValNode)
1234
- : ValVar(val, i, ty, icn)
1203
+ ConstDataValVar(NodeID i, const ICFGNode* icn, const SVFType* svfType,
1204
+ PNODEK ty = ConstDataValNode)
1205
+ : ValVar(i, svfType, icn, ty)
1235
1206
  {
1236
1207
 
1237
1208
  }
@@ -1249,7 +1220,7 @@ public:
1249
1220
  virtual const std::string toString() const;
1250
1221
  };
1251
1222
 
1252
- class BlackHoleVar: public ConstantDataValVar
1223
+ class BlackHoleValVar : public ConstDataValVar
1253
1224
  {
1254
1225
  friend class SVFIRWriter;
1255
1226
  friend class SVFIRReader;
@@ -1257,35 +1228,35 @@ class BlackHoleVar: public ConstantDataValVar
1257
1228
  public:
1258
1229
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
1259
1230
  //@{
1260
- static inline bool classof(const BlackHoleVar*)
1231
+ static inline bool classof(const BlackHoleValVar*)
1261
1232
  {
1262
1233
  return true;
1263
1234
  }
1264
- static inline bool classof(const ConstantDataValVar* node)
1235
+ static inline bool classof(const ConstDataValVar* node)
1265
1236
  {
1266
- return node->getNodeKind() == BlackHoleNode;
1237
+ return node->getNodeKind() == BlackHoleValNode;
1267
1238
  }
1268
1239
  static inline bool classof(const ValVar* node)
1269
1240
  {
1270
- return node->getNodeKind() == BlackHoleNode;
1241
+ return node->getNodeKind() == BlackHoleValNode;
1271
1242
  }
1272
1243
  static inline bool classof(const SVFVar* node)
1273
1244
  {
1274
- return node->getNodeKind() == BlackHoleNode;
1245
+ return node->getNodeKind() == BlackHoleValNode;
1275
1246
  }
1276
1247
  static inline bool classof(const GenericPAGNodeTy* node)
1277
1248
  {
1278
- return node->getNodeKind() == BlackHoleNode;
1249
+ return node->getNodeKind() == BlackHoleValNode;
1279
1250
  }
1280
1251
  static inline bool classof(const SVFBaseNode* node)
1281
1252
  {
1282
- return node->getNodeKind() == BlackHoleNode;
1253
+ return node->getNodeKind() == BlackHoleValNode;
1283
1254
  }
1284
1255
  //@}
1285
1256
 
1286
1257
  /// Constructor
1287
- BlackHoleVar(NodeID i, PNODEK ty = BlackHoleNode)
1288
- : ConstantDataValVar(nullptr, i, nullptr, ty)
1258
+ BlackHoleValVar(NodeID i, const SVFType* svfType, PNODEK ty = BlackHoleValNode)
1259
+ : ConstDataValVar(i, nullptr, svfType, ty)
1289
1260
  {
1290
1261
 
1291
1262
  }
@@ -1297,11 +1268,11 @@ public:
1297
1268
 
1298
1269
  virtual const std::string toString() const
1299
1270
  {
1300
- return "BlackHoleVar";
1271
+ return "BlackHoleValVar";
1301
1272
  }
1302
1273
  };
1303
1274
 
1304
- class ConstantFPValVar: public ConstantDataValVar
1275
+ class ConstFPValVar : public ConstDataValVar
1305
1276
  {
1306
1277
  friend class SVFIRWriter;
1307
1278
  friend class SVFIRReader;
@@ -1311,29 +1282,29 @@ private:
1311
1282
  public:
1312
1283
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
1313
1284
  //@{
1314
- static inline bool classof(const ConstantFPValVar*)
1285
+ static inline bool classof(const ConstFPValVar*)
1315
1286
  {
1316
1287
  return true;
1317
1288
  }
1318
- static inline bool classof(const ConstantDataValVar* node)
1289
+ static inline bool classof(const ConstDataValVar* node)
1319
1290
  {
1320
- return node->getNodeKind() == ConstantFPValNode;
1291
+ return node->getNodeKind() == ConstFPValNode;
1321
1292
  }
1322
1293
  static inline bool classof(const ValVar* node)
1323
1294
  {
1324
- return node->getNodeKind() == ConstantFPValNode;
1295
+ return node->getNodeKind() == ConstFPValNode;
1325
1296
  }
1326
1297
  static inline bool classof(const SVFVar* node)
1327
1298
  {
1328
- return node->getNodeKind() == ConstantFPValNode;
1299
+ return node->getNodeKind() == ConstFPValNode;
1329
1300
  }
1330
1301
  static inline bool classof(const GenericPAGNodeTy* node)
1331
1302
  {
1332
- return node->getNodeKind() == ConstantFPValNode;
1303
+ return node->getNodeKind() == ConstFPValNode;
1333
1304
  }
1334
1305
  static inline bool classof(const SVFBaseNode* node)
1335
1306
  {
1336
- return node->getNodeKind() == ConstantFPValNode;
1307
+ return node->getNodeKind() == ConstFPValNode;
1337
1308
  }
1338
1309
  //@}
1339
1310
 
@@ -1343,17 +1314,16 @@ public:
1343
1314
  }
1344
1315
 
1345
1316
  /// Constructor
1346
- ConstantFPValVar(const SVFValue* val, NodeID i, double dv, const ICFGNode* icn,
1347
- PNODEK ty = ConstantFPValNode)
1348
- : ConstantDataValVar(val, i, icn, ty), dval(dv)
1317
+ ConstFPValVar(NodeID i, double dv,
1318
+ const ICFGNode* icn, const SVFType* svfType)
1319
+ : ConstDataValVar(i, icn, svfType, ConstFPValNode), dval(dv)
1349
1320
  {
1350
-
1351
1321
  }
1352
1322
 
1353
1323
  virtual const std::string toString() const;
1354
1324
  };
1355
1325
 
1356
- class ConstantIntValVar: public ConstantDataValVar
1326
+ class ConstIntValVar : public ConstDataValVar
1357
1327
  {
1358
1328
  friend class SVFIRWriter;
1359
1329
  friend class SVFIRReader;
@@ -1364,29 +1334,29 @@ private:
1364
1334
  public:
1365
1335
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
1366
1336
  //@{
1367
- static inline bool classof(const ConstantIntValVar*)
1337
+ static inline bool classof(const ConstIntValVar*)
1368
1338
  {
1369
1339
  return true;
1370
1340
  }
1371
- static inline bool classof(const ConstantDataValVar* node)
1341
+ static inline bool classof(const ConstDataValVar* node)
1372
1342
  {
1373
- return node->getNodeKind() == ConstantIntValNode;
1343
+ return node->getNodeKind() == ConstIntValNode;
1374
1344
  }
1375
1345
  static inline bool classof(const ValVar* node)
1376
1346
  {
1377
- return node->getNodeKind() == ConstantIntValNode;
1347
+ return node->getNodeKind() == ConstIntValNode;
1378
1348
  }
1379
1349
  static inline bool classof(const SVFVar* node)
1380
1350
  {
1381
- return node->getNodeKind() == ConstantIntValNode;
1351
+ return node->getNodeKind() == ConstIntValNode;
1382
1352
  }
1383
1353
  static inline bool classof(const GenericPAGNodeTy* node)
1384
1354
  {
1385
- return node->getNodeKind() == ConstantIntValNode;
1355
+ return node->getNodeKind() == ConstIntValNode;
1386
1356
  }
1387
1357
  static inline bool classof(const SVFBaseNode* node)
1388
1358
  {
1389
- return node->getNodeKind() == ConstantIntValNode;
1359
+ return node->getNodeKind() == ConstIntValNode;
1390
1360
  }
1391
1361
  //@}
1392
1362
 
@@ -1402,16 +1372,15 @@ public:
1402
1372
  }
1403
1373
 
1404
1374
  /// Constructor
1405
- ConstantIntValVar(const SVFValue* val, NodeID i, s64_t sv, u64_t zv, const ICFGNode* icn,
1406
- PNODEK ty = ConstantIntValNode)
1407
- : ConstantDataValVar(val, i, icn, ty), zval(zv), sval(sv)
1375
+ ConstIntValVar(NodeID i, s64_t sv, u64_t zv, const ICFGNode* icn, const SVFType* svfType)
1376
+ : ConstDataValVar(i, icn, svfType, ConstIntValNode), zval(zv), sval(sv)
1408
1377
  {
1409
1378
 
1410
1379
  }
1411
1380
  virtual const std::string toString() const;
1412
1381
  };
1413
1382
 
1414
- class ConstantNullPtrValVar: public ConstantDataValVar
1383
+ class ConstNullPtrValVar : public ConstDataValVar
1415
1384
  {
1416
1385
  friend class SVFIRWriter;
1417
1386
  friend class SVFIRReader;
@@ -1419,36 +1388,35 @@ class ConstantNullPtrValVar: public ConstantDataValVar
1419
1388
  public:
1420
1389
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
1421
1390
  //@{
1422
- static inline bool classof(const ConstantNullPtrValVar*)
1391
+ static inline bool classof(const ConstNullPtrValVar*)
1423
1392
  {
1424
1393
  return true;
1425
1394
  }
1426
- static inline bool classof(const ConstantDataValVar* node)
1395
+ static inline bool classof(const ConstDataValVar* node)
1427
1396
  {
1428
- return node->getNodeKind() == ConstantNullptrValNode;
1397
+ return node->getNodeKind() == ConstNullptrValNode;
1429
1398
  }
1430
1399
  static inline bool classof(const ValVar* node)
1431
1400
  {
1432
- return node->getNodeKind() == ConstantNullptrValNode;
1401
+ return node->getNodeKind() == ConstNullptrValNode;
1433
1402
  }
1434
1403
  static inline bool classof(const SVFVar* node)
1435
1404
  {
1436
- return node->getNodeKind() == ConstantNullptrValNode;
1405
+ return node->getNodeKind() == ConstNullptrValNode;
1437
1406
  }
1438
1407
  static inline bool classof(const GenericPAGNodeTy* node)
1439
1408
  {
1440
- return node->getNodeKind() == ConstantNullptrValNode;
1409
+ return node->getNodeKind() == ConstNullptrValNode;
1441
1410
  }
1442
1411
  static inline bool classof(const SVFBaseNode* node)
1443
1412
  {
1444
- return node->getNodeKind() == ConstantNullptrValNode;
1413
+ return node->getNodeKind() == ConstNullptrValNode;
1445
1414
  }
1446
1415
  //@}
1447
1416
 
1448
1417
  /// Constructor
1449
- ConstantNullPtrValVar(const SVFValue* val, NodeID i, const ICFGNode* icn,
1450
- PNODEK ty = ConstantNullptrValNode)
1451
- : ConstantDataValVar(val, i, icn, ty)
1418
+ ConstNullPtrValVar(NodeID i, const ICFGNode* icn, const SVFType* svfType)
1419
+ : ConstDataValVar(i, icn, svfType, ConstNullptrValNode)
1452
1420
  {
1453
1421
 
1454
1422
  }
@@ -1468,7 +1436,7 @@ class GlobalObjVar : public BaseObjVar
1468
1436
 
1469
1437
  private:
1470
1438
  /// Constructor to create empty ObjVar (for SVFIRReader/deserialization)
1471
- GlobalObjVar(NodeID i, PNODEK ty = GlobalObjNode) : BaseObjVar(i, ty) {}
1439
+ GlobalObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, GlobalObjNode) {}
1472
1440
 
1473
1441
  public:
1474
1442
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -1500,8 +1468,8 @@ public:
1500
1468
  //@}
1501
1469
 
1502
1470
  /// Constructor
1503
- GlobalObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti,
1504
- PNODEK ty = GlobalObjNode): BaseObjVar(val, i, ti, ty)
1471
+ GlobalObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node,
1472
+ PNODEK ty = GlobalObjNode): BaseObjVar(i, ti, svfType, node, ty)
1505
1473
  {
1506
1474
 
1507
1475
  }
@@ -1510,7 +1478,7 @@ public:
1510
1478
  virtual const std::string toString() const;
1511
1479
  };
1512
1480
 
1513
- class ConstantAggObjVar: public BaseObjVar
1481
+ class ConstAggObjVar : public BaseObjVar
1514
1482
  {
1515
1483
  friend class SVFIRWriter;
1516
1484
  friend class SVFIRReader;
@@ -1518,37 +1486,36 @@ class ConstantAggObjVar: public BaseObjVar
1518
1486
  public:
1519
1487
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
1520
1488
  //@{
1521
- static inline bool classof(const ConstantAggObjVar*)
1489
+ static inline bool classof(const ConstAggObjVar*)
1522
1490
  {
1523
1491
  return true;
1524
1492
  }
1525
1493
  static inline bool classof(const BaseObjVar* node)
1526
1494
  {
1527
- return node->getNodeKind() == ConstantAggObjNode;
1495
+ return node->getNodeKind() == ConstAggObjNode;
1528
1496
  }
1529
1497
 
1530
1498
  static inline bool classof(const ObjVar* node)
1531
1499
  {
1532
- return node->getNodeKind() == ConstantAggObjNode;
1500
+ return node->getNodeKind() == ConstAggObjNode;
1533
1501
  }
1534
1502
  static inline bool classof(const SVFVar* node)
1535
1503
  {
1536
- return node->getNodeKind() == ConstantAggObjNode;
1504
+ return node->getNodeKind() == ConstAggObjNode;
1537
1505
  }
1538
1506
  static inline bool classof(const GenericPAGNodeTy* node)
1539
1507
  {
1540
- return node->getNodeKind() == ConstantAggObjNode;
1508
+ return node->getNodeKind() == ConstAggObjNode;
1541
1509
  }
1542
1510
  static inline bool classof(const SVFBaseNode* node)
1543
1511
  {
1544
- return node->getNodeKind() == ConstantAggObjNode;
1512
+ return node->getNodeKind() == ConstAggObjNode;
1545
1513
  }
1546
1514
  //@}
1547
1515
 
1548
1516
  /// Constructor
1549
- ConstantAggObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti,
1550
- PNODEK ty = ConstantAggObjNode)
1551
- : BaseObjVar(val, i, ti, ty)
1517
+ ConstAggObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1518
+ : BaseObjVar(i, ti, svfType, node, ConstAggObjNode)
1552
1519
  {
1553
1520
 
1554
1521
  }
@@ -1566,18 +1533,18 @@ public:
1566
1533
  virtual const std::string toString() const;
1567
1534
  };
1568
1535
 
1569
- class ConstantDataObjVar: public BaseObjVar
1536
+ class ConstDataObjVar : public BaseObjVar
1570
1537
  {
1571
1538
  friend class SVFIRWriter;
1572
1539
  friend class SVFIRReader;
1573
1540
 
1574
1541
  protected:
1575
1542
  /// Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
1576
- ConstantDataObjVar(NodeID i) : BaseObjVar(i, ConstantDataObjNode) {}
1543
+ ConstDataObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, ConstDataObjNode) {}
1577
1544
 
1578
1545
  public:
1579
1546
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
1580
- static inline bool classof(const ConstantDataObjVar*)
1547
+ static inline bool classof(const ConstDataObjVar*)
1581
1548
  {
1582
1549
  return true;
1583
1550
  }
@@ -1605,8 +1572,8 @@ public:
1605
1572
  //@}
1606
1573
 
1607
1574
  /// Constructor
1608
- ConstantDataObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti, PNODEK ty = ConstantDataObjNode)
1609
- : BaseObjVar(val, i, ti, ty)
1575
+ ConstDataObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node, PNODEK ty = ConstDataObjNode)
1576
+ : BaseObjVar(i, ti, svfType, node, ty)
1610
1577
  {
1611
1578
  }
1612
1579
 
@@ -1623,57 +1590,57 @@ public:
1623
1590
  virtual const std::string toString() const;
1624
1591
  };
1625
1592
 
1626
- class ConstantFPObjVar: public ConstantDataObjVar
1593
+ class ConstFPObjVar : public ConstDataObjVar
1627
1594
  {
1628
1595
  friend class SVFIRWriter;
1629
1596
  friend class SVFIRReader;
1630
1597
 
1631
1598
  private:
1632
1599
  /// Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
1633
- ConstantFPObjVar(NodeID i) : ConstantDataObjVar(i) {}
1600
+ ConstFPObjVar(NodeID i, const ICFGNode* node) : ConstDataObjVar(i, node) {}
1634
1601
 
1635
1602
  private:
1636
1603
  float dval;
1637
1604
 
1638
1605
  public:
1639
1606
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
1640
- static inline bool classof(const ConstantFPObjVar*)
1607
+ static inline bool classof(const ConstFPObjVar*)
1641
1608
  {
1642
1609
  return true;
1643
1610
  }
1644
- static inline bool classof(const ConstantDataObjVar* node)
1611
+ static inline bool classof(const ConstDataObjVar* node)
1645
1612
  {
1646
- return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1613
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1647
1614
  }
1648
1615
  static inline bool classof(const BaseObjVar* node)
1649
1616
  {
1650
- return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1617
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1651
1618
  }
1652
1619
 
1653
1620
  static inline bool classof(const SVFVar* node)
1654
1621
  {
1655
- return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1622
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1656
1623
  }
1657
1624
 
1658
1625
  static inline bool classof(const ObjVar* node)
1659
1626
  {
1660
- return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1627
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1661
1628
  }
1662
1629
 
1663
1630
  static inline bool classof(const GenericPAGNodeTy* node)
1664
1631
  {
1665
- return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1632
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1666
1633
  }
1667
1634
 
1668
1635
  static inline bool classof(const SVFBaseNode* node)
1669
1636
  {
1670
- return node->getNodeKind() == SVFVar::ConstantFPObjNode;
1637
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1671
1638
  }
1672
1639
  //@}
1673
1640
 
1674
1641
  /// Constructor
1675
- ConstantFPObjVar(const SVFValue* val, NodeID i, double dv, ObjTypeInfo* ti, PNODEK ty = ConstantFPObjNode)
1676
- : ConstantDataObjVar(val, i, ti, ty), dval(dv)
1642
+ ConstFPObjVar(NodeID i, double dv, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1643
+ : ConstDataObjVar(i, ti, svfType, node, ConstFPObjNode), dval(dv)
1677
1644
  {
1678
1645
  }
1679
1646
 
@@ -1686,14 +1653,14 @@ public:
1686
1653
  virtual const std::string toString() const;
1687
1654
  };
1688
1655
 
1689
- class ConstantIntObjVar: public ConstantDataObjVar
1656
+ class ConstIntObjVar : public ConstDataObjVar
1690
1657
  {
1691
1658
  friend class SVFIRWriter;
1692
1659
  friend class SVFIRReader;
1693
1660
 
1694
1661
  private:
1695
1662
  /// Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
1696
- ConstantIntObjVar(NodeID i) : ConstantDataObjVar(i) {}
1663
+ ConstIntObjVar(NodeID i, const ICFGNode* node) : ConstDataObjVar(i, node) {}
1697
1664
 
1698
1665
  private:
1699
1666
  u64_t zval;
@@ -1701,37 +1668,37 @@ private:
1701
1668
 
1702
1669
  public:
1703
1670
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
1704
- static inline bool classof(const ConstantIntObjVar*)
1671
+ static inline bool classof(const ConstIntObjVar*)
1705
1672
  {
1706
1673
  return true;
1707
1674
  }
1708
1675
 
1709
- static inline bool classof(const ConstantDataObjVar* node)
1676
+ static inline bool classof(const ConstDataObjVar* node)
1710
1677
  {
1711
- return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1678
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1712
1679
  }
1713
1680
 
1714
1681
  static inline bool classof(const BaseObjVar* node)
1715
1682
  {
1716
- return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1683
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1717
1684
  }
1718
1685
 
1719
1686
  static inline bool classof(const SVFVar* node)
1720
1687
  {
1721
- return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1688
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1722
1689
  }
1723
1690
  static inline bool classof(const ObjVar* node)
1724
1691
  {
1725
- return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1692
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1726
1693
  }
1727
1694
  static inline bool classof(const GenericPAGNodeTy* node)
1728
1695
  {
1729
- return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1696
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1730
1697
  }
1731
1698
 
1732
1699
  static inline bool classof(const SVFBaseNode* node)
1733
1700
  {
1734
- return node->getNodeKind() == SVFVar::ConstantIntObjNode;
1701
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1735
1702
  }
1736
1703
 
1737
1704
  s64_t getSExtValue() const
@@ -1747,8 +1714,8 @@ public:
1747
1714
  //@}
1748
1715
 
1749
1716
  /// Constructor
1750
- ConstantIntObjVar(const SVFValue* val, NodeID i, s64_t sv, u64_t zv, ObjTypeInfo* ti, PNODEK ty = ConstantIntObjNode)
1751
- : ConstantDataObjVar(val, i, ti, ty), zval(zv), sval(sv)
1717
+ ConstIntObjVar(NodeID i, s64_t sv, u64_t zv, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1718
+ : ConstDataObjVar(i, ti, svfType, node, ConstIntObjNode), zval(zv), sval(sv)
1752
1719
  {
1753
1720
  }
1754
1721
 
@@ -1756,68 +1723,66 @@ public:
1756
1723
  virtual const std::string toString() const;
1757
1724
  };
1758
1725
 
1759
- class ConstantNullPtrObjVar: public ConstantDataObjVar
1726
+ class ConstNullPtrObjVar : public ConstDataObjVar
1760
1727
  {
1761
1728
  friend class SVFIRWriter;
1762
1729
  friend class SVFIRReader;
1763
1730
 
1764
1731
  private:
1765
1732
  /// Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
1766
- ConstantNullPtrObjVar(NodeID i) : ConstantDataObjVar(i) {}
1733
+ ConstNullPtrObjVar(NodeID i, const ICFGNode* node) : ConstDataObjVar(i, node) {}
1767
1734
 
1768
1735
  public:
1769
1736
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
1770
- static inline bool classof(const ConstantNullPtrObjVar*)
1737
+ static inline bool classof(const ConstNullPtrObjVar*)
1771
1738
  {
1772
1739
  return true;
1773
1740
  }
1774
1741
 
1775
- static inline bool classof(const ConstantDataObjVar* node)
1742
+ static inline bool classof(const ConstDataObjVar* node)
1776
1743
  {
1777
- return node->getNodeKind() == SVFVar::ConstantNullptrObjNode;
1744
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1778
1745
  }
1779
1746
 
1780
1747
  static inline bool classof(const BaseObjVar* node)
1781
1748
  {
1782
- return node->getNodeKind() == SVFVar::ConstantNullptrObjNode;
1749
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1783
1750
  }
1784
1751
 
1785
1752
  static inline bool classof(const SVFVar* node)
1786
1753
  {
1787
- return node->getNodeKind() == SVFVar::ConstantNullptrObjNode;
1754
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1788
1755
  }
1789
1756
  static inline bool classof(const ObjVar* node)
1790
1757
  {
1791
- return node->getNodeKind() == SVFVar::ConstantNullptrObjNode;
1758
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1792
1759
  }
1793
1760
  static inline bool classof(const GenericPAGNodeTy* node)
1794
1761
  {
1795
- return node->getNodeKind() == SVFVar::ConstantNullptrObjNode;
1762
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1796
1763
  }
1797
1764
 
1798
1765
  static inline bool classof(const SVFBaseNode* node)
1799
1766
  {
1800
- return node->getNodeKind() == SVFVar::ConstantNullptrObjNode;
1767
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1801
1768
  }
1802
1769
  //@}
1803
1770
 
1804
1771
  /// Constructor
1805
- ConstantNullPtrObjVar(const SVFValue* val, NodeID i, ObjTypeInfo* ti, PNODEK ty = ConstantNullptrObjNode)
1806
- : ConstantDataObjVar(val, i, ti, ty)
1772
+ ConstNullPtrObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1773
+ : ConstDataObjVar(i, ti, svfType, node, ConstNullptrObjNode)
1807
1774
  {
1808
1775
  }
1809
-
1810
1776
  virtual bool isConstDataOrAggDataButNotNullPtr() const
1811
1777
  {
1812
1778
  return false;
1813
1779
  }
1814
-
1815
1780
  virtual const std::string toString() const;
1816
1781
  };
1817
1782
  /*
1818
1783
  * Unique Return node of a procedure
1819
1784
  */
1820
- class RetPN: public ValVar
1785
+ class RetValPN : public ValVar
1821
1786
  {
1822
1787
  friend class SVFIRWriter;
1823
1788
  friend class SVFIRReader;
@@ -1825,36 +1790,36 @@ class RetPN: public ValVar
1825
1790
  private:
1826
1791
  const CallGraphNode* callGraphNode;
1827
1792
  private:
1828
- /// Constructor to create empty RetPN (for SVFIRReader/deserialization)
1829
- RetPN(NodeID i) : ValVar(i, RetNode) {}
1793
+ /// Constructor to create empty RetValPN (for SVFIRReader/deserialization)
1794
+ RetValPN(NodeID i) : ValVar(i, RetValNode) {}
1830
1795
 
1831
1796
  public:
1832
1797
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
1833
- static inline bool classof(const RetPN*)
1798
+ static inline bool classof(const RetValPN*)
1834
1799
  {
1835
1800
  return true;
1836
1801
  }
1837
1802
  static inline bool classof(const SVFVar* node)
1838
1803
  {
1839
- return node->getNodeKind() == SVFVar::RetNode;
1804
+ return node->getNodeKind() == SVFVar::RetValNode;
1840
1805
  }
1841
1806
  static inline bool classof(const ValVar* node)
1842
1807
  {
1843
- return node->getNodeKind() == SVFVar::RetNode;
1808
+ return node->getNodeKind() == SVFVar::RetValNode;
1844
1809
  }
1845
1810
  static inline bool classof(const GenericPAGNodeTy* node)
1846
1811
  {
1847
- return node->getNodeKind() == SVFVar::RetNode;
1812
+ return node->getNodeKind() == SVFVar::RetValNode;
1848
1813
  }
1849
1814
  static inline bool classof(const SVFBaseNode* node)
1850
1815
  {
1851
- return node->getNodeKind() == SVFVar::RetNode;
1816
+ return node->getNodeKind() == SVFVar::RetValNode;
1852
1817
  }
1853
1818
  //@}
1854
1819
 
1855
1820
 
1856
1821
  /// Constructor
1857
- RetPN(NodeID i, const CallGraphNode* node);
1822
+ RetValPN(NodeID i, const CallGraphNode* node, const SVFType* svfType, const ICFGNode* icn);
1858
1823
 
1859
1824
  inline const CallGraphNode* getCallGraphNode() const
1860
1825
  {
@@ -1863,6 +1828,8 @@ public:
1863
1828
 
1864
1829
  virtual const SVFFunction* getFunction() const;
1865
1830
 
1831
+ virtual bool isPointer() const;
1832
+
1866
1833
  /// Return name of a LLVM value
1867
1834
  const std::string getValueName() const;
1868
1835
 
@@ -1872,7 +1839,7 @@ public:
1872
1839
  /*
1873
1840
  * Unique vararg node of a procedure
1874
1841
  */
1875
- class VarArgPN: public ValVar
1842
+ class VarArgValPN : public ValVar
1876
1843
  {
1877
1844
  friend class SVFIRWriter;
1878
1845
  friend class SVFIRReader;
@@ -1880,41 +1847,48 @@ private:
1880
1847
  const CallGraphNode* callGraphNode;
1881
1848
 
1882
1849
  private:
1883
- /// Constructor to create empty VarArgPN (for SVFIRReader/deserialization)
1884
- VarArgPN(NodeID i) : ValVar(i, VarargNode) {}
1850
+ /// Constructor to create empty VarArgValPN (for SVFIRReader/deserialization)
1851
+ VarArgValPN(NodeID i) : ValVar(i, VarargValNode) {}
1885
1852
 
1886
1853
  public:
1887
1854
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
1888
- static inline bool classof(const VarArgPN*)
1855
+ static inline bool classof(const VarArgValPN*)
1889
1856
  {
1890
1857
  return true;
1891
1858
  }
1892
1859
  static inline bool classof(const SVFVar* node)
1893
1860
  {
1894
- return node->getNodeKind() == SVFVar::VarargNode;
1861
+ return node->getNodeKind() == SVFVar::VarargValNode;
1895
1862
  }
1896
1863
  static inline bool classof(const ValVar* node)
1897
1864
  {
1898
- return node->getNodeKind() == SVFVar::VarargNode;
1865
+ return node->getNodeKind() == SVFVar::VarargValNode;
1899
1866
  }
1900
1867
  static inline bool classof(const GenericPAGNodeTy* node)
1901
1868
  {
1902
- return node->getNodeKind() == SVFVar::VarargNode;
1869
+ return node->getNodeKind() == SVFVar::VarargValNode;
1903
1870
  }
1904
1871
  static inline bool classof(const SVFBaseNode* node)
1905
1872
  {
1906
- return node->getNodeKind() == SVFVar::VarargNode;
1873
+ return node->getNodeKind() == SVFVar::VarargValNode;
1907
1874
  }
1908
1875
  //@}
1909
1876
 
1910
1877
  /// Constructor
1911
- VarArgPN(NodeID i, const CallGraphNode* node) : ValVar(nullptr, i, VarargNode), callGraphNode(node) {}
1878
+ VarArgValPN(NodeID i, const CallGraphNode* node, const SVFType* svfType, const ICFGNode* icn)
1879
+ : ValVar(i, svfType, icn, VarargValNode), callGraphNode(node)
1880
+ {
1881
+ }
1912
1882
 
1913
1883
  virtual const SVFFunction* getFunction() const;
1914
1884
 
1915
1885
  /// Return name of a LLVM value
1916
1886
  const std::string getValueName() const;
1917
1887
 
1888
+ virtual bool isPointer() const
1889
+ {
1890
+ return true;
1891
+ }
1918
1892
  virtual const std::string toString() const;
1919
1893
  };
1920
1894
 
@@ -1951,7 +1925,10 @@ public:
1951
1925
  //@}
1952
1926
 
1953
1927
  /// Constructor
1954
- DummyValVar(NodeID i) : ValVar(nullptr, i, DummyValNode) {}
1928
+ DummyValVar(NodeID i, const ICFGNode* node, const SVFType* svfType = SVFType::getSVFPtrType())
1929
+ : ValVar(i, svfType, node, DummyValNode)
1930
+ {
1931
+ }
1955
1932
 
1956
1933
  /// Return name of this node
1957
1934
  inline const std::string getValueName() const
@@ -1959,6 +1936,11 @@ public:
1959
1936
  return "dummyVal";
1960
1937
  }
1961
1938
 
1939
+ virtual bool isPointer() const
1940
+ {
1941
+ return true;
1942
+ }
1943
+
1962
1944
  virtual const std::string toString() const;
1963
1945
  };
1964
1946
 
@@ -1972,7 +1954,7 @@ class DummyObjVar: public BaseObjVar
1972
1954
 
1973
1955
  private:
1974
1956
  /// Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
1975
- DummyObjVar(NodeID i) : BaseObjVar(i, DummyObjNode) {}
1957
+ DummyObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, DummyObjNode) {}
1976
1958
 
1977
1959
  public:
1978
1960
  //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -2004,8 +1986,8 @@ public:
2004
1986
  //@}
2005
1987
 
2006
1988
  /// Constructor
2007
- DummyObjVar(NodeID i, ObjTypeInfo* ti, PNODEK ty = DummyObjNode)
2008
- : BaseObjVar(nullptr, i, ti, ty)
1989
+ DummyObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node, const SVFType* svfType = SVFType::getSVFPtrType())
1990
+ : BaseObjVar(i, ti, svfType, node, DummyObjNode)
2009
1991
  {
2010
1992
  }
2011
1993
 
@@ -2015,6 +1997,11 @@ public:
2015
1997
  return "dummyObj";
2016
1998
  }
2017
1999
 
2000
+ virtual bool isPointer() const
2001
+ {
2002
+ return true;
2003
+ }
2004
+
2018
2005
  virtual const std::string toString() const;
2019
2006
  };
2020
2007