svf-tools 1.0.1032 → 1.0.1033

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-tools",
3
- "version": "1.0.1032",
3
+ "version": "1.0.1033",
4
4
  "description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -141,96 +141,110 @@ public:
141
141
 
142
142
  enum GNodeK
143
143
  {
144
- // ┌── ICFGNode: Classes of inter-procedural and intra-procedural control flow graph nodes
145
- IntraBlock, // ├──Represents a node within a single procedure
146
- GlobalBlock, // ├──Represents a global-level block
147
- // │ └─ InterICFGNode: Classes of inter-procedural control flow graph nodes
148
- FunEntryBlock, // ├──Entry point of a function
149
- FunExitBlock, // ├──Exit point of a function
150
- FunCallBlock, // ├──Call site in the function
151
- FunRetBlock, // ├──Return site in the function
152
- // └────────
153
-
154
- // ┌── SVFVar: Classes of top-level variables (ValVar) and address-taken variables (ObjVar)
155
- // │ └── ValVar: Classes of top-level variable nodes
156
- ValNode, // ├──Represents a standard value variable
157
- ArgNode, // ├──Represents an argument value variable
158
- FunValNode, // ├──Represents a Function value variable
159
- GepValNode, // ├──Represents a GEP value variable
160
- RetNode, // ├──Represents a return value node
161
- VarargNode, // ├──Represents a variadic argument node
162
- GlobalValNode, // ├──Represents a global variable node
163
- ConstantAggValNode, // ├──Represents a constant aggregate value node
164
- ConstantDataValNode, // ├──Represents a constant data variable
165
- BlackHoleNode, // ├──Represents a black hole node
166
- ConstantFPValNode, // ├──Represents a constant float-point value node
167
- ConstantIntValNode, // ├── Represents a constant integer value node
168
- ConstantNullptrValNode, // ├── Represents a constant nullptr value node
169
- DummyValNode, // ├──Represents a dummy node for uninitialized values
170
- // │ └── ObjVar: Classes of object variable nodes
171
- ObjNode, // ├──Represents an object variable
172
- GepObjNode, // ├──Represents a GEP object variable
173
- // │ └── BaseObjVar: Classes of base object nodes
174
- BaseObjNode, // ├──Represents a base object node
175
- FunObjNode, // ├──Types of function object
176
- HeapObjNode, // ├──Types of heap object
177
- StackObjNode, // ├──Types of stack object
178
- GlobalObjNode, // ├──Types of global object
179
- ConstantAggObjNode, // ├──Types of constant aggregate object
180
- ConstantDataObjNode, // ├──Types of constant data object
181
- ConstantFPObjNode, // ├──Types of constant float-point object
182
- ConstantIntObjNode, // ├──Types of constant integer object
183
- ConstantNullptrObjNode, // ├──Types of constant nullptr object
184
- DummyObjNode, // ├──Dummy node for uninitialized objects
185
- // └────────
186
-
187
- // ┌── VFGNode: Classes of Value Flow Graph (VFG) node kinds with operations
188
- Cmp, // ├──Represents a comparison operation
189
- BinaryOp, // ├──Represents a binary operation
190
- UnaryOp, // ├──Represents a unary operation
191
- Branch, // ├──Represents a branch operation
192
- DummyVProp, // ├──Dummy node for value propagation
193
- NPtr, // ├──Represents a null pointer operation
194
- // │ └── ArgumentVFGNode: Classes of argument nodes in VFG
195
- FRet, // ├──Represents a function return value
196
- ARet, // ├──Represents an argument return value
197
- AParm, // ├──Represents an argument parameter
198
- FParm, // ├──Represents a function parameter
199
- // │ └── StmtVFGNode: Classes of statement nodes in VFG
200
- Addr, // ├──Represents an address operation
201
- Copy, // ├──Represents a copy operation
202
- Gep, // ├──Represents a GEP operation
203
- Store, // ├──Represents a store operation
204
- Load, // ├──Represents a load operation
205
- // │ └── PHIVFGNode: Classes of PHI nodes in VFG
206
- TPhi, // ├──Represents a type-based PHI node
207
- TIntraPhi, // ├──Represents an intra-procedural PHI node
208
- TInterPhi, // ├──Represents an inter-procedural PHI node
209
- // │ └── MRSVFGNode: Classes of Memory-related SVFG nodes
210
- FPIN, // ├──Function parameter input
211
- FPOUT, // ├──Function parameter output
212
- APIN, // ├──Argument parameter input
213
- APOUT, // ├──Argument parameter output
214
- // │ └── MSSAPHISVFGNode: Classes of Mem SSA PHI nodes for SVFG
215
- MPhi, // ├──Memory PHI node
216
- MIntraPhi, // ├──Intra-procedural memory PHI node
217
- MInterPhi, // ├──Inter-procedural memory PHI node
218
- // └────────
219
-
220
- // Additional specific graph node types
221
- CallNodeKd, // Callgraph node
222
- CDNodeKd, // Control dependence graph node
223
- CFLNodeKd, // CFL graph node
224
- CHNodeKd, // Class hierarchy graph node
144
+ // ┌─────────────────────────────────────────────────────────────────────────┐
145
+ // ICFGNode: Classes of inter-procedural and intra-procedural control flow │
146
+ // graph nodes (Parent class: ICFGNode) │
147
+ // └─────────────────────────────────────────────────────────────────────────┘
148
+ IntraBlock, // ├── Represents a node within a single procedure
149
+ GlobalBlock, // ├── Represents a global-level block
150
+ // │ └─ Subclass: InterICFGNode
151
+ FunEntryBlock, // ├── Entry point of a function
152
+ FunExitBlock, // │ ├── Exit point of a function
153
+ FunCallBlock, // │ ├── Call site in the function
154
+ FunRetBlock, // │ └── Return site in the function
155
+
156
+ // ┌─────────────────────────────────────────────────────────────────────────┐
157
+ // SVFVar: Classes of variable nodes (Parent class: SVFVar) │
158
+ // │ Includes two main subclasses: ValVar and ObjVar │
159
+ // └─────────────────────────────────────────────────────────────────────────┘
160
+ // └─ Subclass: ValVar (Top-level variable nodes)
161
+ ValNode, // ├── Represents a standard value variable
162
+ ArgValNode, // ├── Represents an argument value variable
163
+ FunValNode, // ├── Represents a function value variable
164
+ GepValNode, // ├── Represents a GEP value variable
165
+ RetValNode, // ├── Represents a return value node
166
+ VarargValNode, // ├── Represents a variadic argument node
167
+ GlobalValNode, // ├── Represents a global variable node
168
+ ConstAggValNode, // ├── Represents a constant aggregate value node
169
+ // │ └─ Subclass: ConstDataValVar
170
+ ConstDataValNode, // │ ├── Represents a constant data variable
171
+ BlackHoleValNode, // ├── Represents a black hole node
172
+ ConstFPValNode, // ├── Represents a constant floating-point value node
173
+ ConstIntValNode, // │ ├── Represents a constant integer value node
174
+ ConstNullptrValNode, // │ └── Represents a constant nullptr value node
175
+ // │ └─ Subclass: DummyValVar
176
+ DummyValNode, // │ └── Dummy node for uninitialized values
177
+
178
+ // └─ Subclass: ObjVar (Object variable nodes)
179
+ ObjNode, // ├── Represents an object variable
180
+ // │ └─ Subclass: GepObjVar
181
+ GepObjNode, // ├── Represents a GEP object variable
182
+ // │ └─ Subclass: BaseObjVar
183
+ BaseObjNode, // ├── Represents a base object node
184
+ FunObjNode, // ├── Represents a function object
185
+ HeapObjNode, // │ ├── Represents a heap object
186
+ StackObjNode, // │ ├── Represents a stack object
187
+ GlobalObjNode, // │ ├── Represents a global object
188
+ ConstAggObjNode, // ├── Represents a constant aggregate object
189
+ // │ └─ Subclass: ConstDataObjVar
190
+ ConstDataObjNode, // ├── Represents a constant data object
191
+ ConstFPObjNode, // ├── Represents a constant floating-point object
192
+ ConstIntObjNode, // ├── Represents a constant integer object
193
+ ConstNullptrObjNode, // │ └── Represents a constant nullptr object
194
+ // │ └─ Subclass: DummyObjVar
195
+ DummyObjNode, // │ └── Dummy node for uninitialized objects
196
+
197
+ // ┌─────────────────────────────────────────────────────────────────────────┐
198
+ // VFGNode: Classes of Value Flow Graph (VFG) node kinds (Parent class: │
199
+ // │ VFGNode) │
200
+ // │ Includes operation nodes and specialized subclasses │
201
+ // └─────────────────────────────────────────────────────────────────────────┘
202
+ Cmp, // ├── Represents a comparison operation
203
+ BinaryOp, // ├── Represents a binary operation
204
+ UnaryOp, // ├── Represents a unary operation
205
+ Branch, // ├── Represents a branch operation
206
+ DummyVProp, // ├── Dummy node for value propagation
207
+ NPtr, // ├── Represents a null pointer operation
208
+ // │ └─ Subclass: ArgumentVFGNode
209
+ FRet, // │ ├── Represents a function return value
210
+ ARet, // ├── Represents an argument return value
211
+ AParm, // ├── Represents an argument parameter
212
+ FParm, // │ └── Represents a function parameter
213
+ // │ └─ Subclass: StmtVFGNode
214
+ Addr, // │ ├── Represents an address operation
215
+ Copy, // ├── Represents a copy operation
216
+ Gep, // ├── Represents a GEP operation
217
+ Store, // ├── Represents a store operation
218
+ Load, // │ └── Represents a load operation
219
+ // │ └─ Subclass: PHIVFGNode
220
+ TPhi, // │ ├── Represents a type-based PHI node
221
+ TIntraPhi, // │ ├── Represents an intra-procedural PHI node
222
+ TInterPhi, // │ └── Represents an inter-procedural PHI node
223
+ // │ └─ Subclass: MRSVFGNode
224
+ FPIN, // │ ├── Function parameter input
225
+ FPOUT, // │ ├── Function parameter output
226
+ APIN, // │ ├── Argument parameter input
227
+ APOUT, // │ └── Argument parameter output
228
+ // │ └─ Subclass: MSSAPHISVFGNode
229
+ MPhi, // │ ├── Memory PHI node
230
+ MIntraPhi, // │ ├── Intra-procedural memory PHI node
231
+ MInterPhi, // │ └── Inter-procedural memory PHI node
232
+
233
+ // ┌─────────────────────────────────────────────────────────────────────────┐
234
+ // │ Additional specific graph node types │
235
+ // └─────────────────────────────────────────────────────────────────────────┘
236
+ CallNodeKd, // Callgraph node
237
+ CDNodeKd, // Control dependence graph node
238
+ CFLNodeKd, // CFL graph node
239
+ CHNodeKd, // Class hierarchy graph node
225
240
  ConstraintNodeKd, // Constraint graph node
226
- TCTNodeKd, // Thread creation tree node
227
- DCHNodeKd, // DCHG node
228
- OtherKd // Other node kind
241
+ TCTNodeKd, // Thread creation tree node
242
+ DCHNodeKd, // DCHG node
243
+ OtherKd // Other node kind
229
244
  };
230
245
 
231
246
 
232
-
233
- SVFBaseNode(NodeID i, GNodeK k, SVFType* ty = nullptr): id(i),nodeKind(k), type(ty)
247
+ SVFBaseNode(NodeID i, GNodeK k, const SVFType* ty = nullptr): id(i),nodeKind(k), type(ty)
234
248
  {
235
249
 
236
250
  }
@@ -326,10 +340,10 @@ protected:
326
340
 
327
341
  static inline bool isConstantDataValVar(GNodeK n)
328
342
  {
329
- static_assert(ConstantNullptrValNode - ConstantDataValNode == 4,
343
+ static_assert(ConstNullptrValNode - ConstDataValNode == 4,
330
344
  "The number of ConstantDataValVarKinds has changed, make "
331
345
  "sure the range is correct");
332
- return n <= ConstantNullptrValNode && n >= ConstantDataValNode;
346
+ return n <= ConstNullptrValNode && n >= ConstDataValNode;
333
347
  }
334
348
 
335
349
  static inline bool isObjVarKinds(GNodeK n)
@@ -350,10 +364,10 @@ protected:
350
364
 
351
365
  static inline bool isConstantDataObjVarKinds(GNodeK n)
352
366
  {
353
- static_assert(ConstantNullptrObjNode - ConstantDataObjNode == 3,
367
+ static_assert(ConstNullptrObjNode - ConstDataObjNode == 3,
354
368
  "The number of ConstantDataObjVarKinds has changed, make "
355
369
  "sure the range is correct");
356
- return n <= ConstantNullptrObjNode && n >= ConstantDataObjNode;
370
+ return n <= ConstNullptrObjNode && n >= ConstDataObjNode;
357
371
  }
358
372
 
359
373
  static inline bool isVFGNodeKinds(GNodeK n)
@@ -433,7 +447,7 @@ private:
433
447
 
434
448
  public:
435
449
  /// Constructor
436
- GenericNode(NodeID i, GNodeK k): SVFBaseNode(i, k)
450
+ GenericNode(NodeID i, GNodeK k, const SVFType* svfType = nullptr): SVFBaseNode(i, k, svfType)
437
451
  {
438
452
 
439
453
  }
@@ -473,7 +473,7 @@ public:
473
473
  //@}
474
474
  inline NodeID addDummyValNode()
475
475
  {
476
- return addDummyValNode(NodeIDAllocator::get()->allocateValueId());
476
+ return addDummyValNode(NodeIDAllocator::get()->allocateValueId(), nullptr);
477
477
  }
478
478
  inline NodeID addDummyObjNode(const SVFType* type)
479
479
  {
@@ -544,165 +544,164 @@ private:
544
544
  /// add node into SVFIR
545
545
  //@{
546
546
  /// Add a value (pointer) node
547
- inline NodeID addValNode(const SVFValue* val, NodeID i, const ICFGNode* icfgNode)
547
+ inline NodeID addValNode(NodeID i, const SVFType* type, const ICFGNode* icfgNode)
548
548
  {
549
- SVFVar *node = new ValVar(val,i, ValVar::ValNode, icfgNode);
550
- return addValNode(val, node);
549
+ SVFVar *node = new ValVar(i, type, icfgNode, ValVar::ValNode);
550
+ return addValNode(node);
551
551
  }
552
552
 
553
- NodeID addFunValNode(NodeID i, const ICFGNode* icfgNode, const CallGraphNode* callGraphNode)
553
+ NodeID addFunValNode(NodeID i, const ICFGNode* icfgNode, const CallGraphNode* callGraphNode, const SVFType* type)
554
554
  {
555
- FunValVar* node = new FunValVar(i, icfgNode, callGraphNode);
556
- return addValNode(nullptr, node);
555
+ FunValVar* node = new FunValVar(i, icfgNode, callGraphNode, type);
556
+ return addValNode(node);
557
557
  }
558
558
 
559
- NodeID addArgValNode(NodeID i, u32_t argNo, const ICFGNode* icfgNode, const CallGraphNode* callGraphNode, bool isUncalled = false)
559
+ NodeID addArgValNode(NodeID i, u32_t argNo, const ICFGNode* icfgNode, const CallGraphNode* callGraphNode, const SVFType* type, bool isUncalled = false)
560
560
  {
561
561
  ArgValVar* node =
562
- new ArgValVar(i, argNo, icfgNode, callGraphNode, isUncalled);
563
- return addValNode(nullptr, node);
562
+ new ArgValVar(i, argNo, icfgNode, callGraphNode, type, isUncalled);
563
+ return addValNode(node);
564
564
  }
565
565
 
566
- inline NodeID addConstantFPValNode(const SVFValue* curInst, const NodeID i, double dval,
567
- const ICFGNode* icfgNode)
566
+ inline NodeID addConstantFPValNode(const NodeID i, double dval,
567
+ const ICFGNode* icfgNode, const SVFType* type)
568
568
  {
569
- SVFVar* node = new ConstantFPValVar(curInst, i, dval, icfgNode);
569
+ SVFVar* node = new ConstFPValVar(i, dval, icfgNode, type);
570
570
  return addNode(node);
571
571
  }
572
572
 
573
- inline NodeID addConstantIntValNode(const SVFValue* curInst, NodeID i, const std::pair<s64_t, u64_t>& intValue,
574
- const ICFGNode* icfgNode)
573
+ inline NodeID addConstantIntValNode(NodeID i, const std::pair<s64_t, u64_t>& intValue,
574
+ const ICFGNode* icfgNode, const SVFType* type)
575
575
  {
576
- SVFVar* node = new ConstantIntValVar(curInst, i, intValue.first, intValue.second, icfgNode);
576
+ SVFVar* node = new ConstIntValVar(i, intValue.first, intValue.second, icfgNode, type);
577
577
  return addNode(node);
578
578
  }
579
579
 
580
- inline NodeID addConstantNullPtrValNode(const SVFValue* curInst, const NodeID i, const ICFGNode* icfgNode)
580
+ inline NodeID addConstantNullPtrValNode(const NodeID i, const ICFGNode* icfgNode, const SVFType* type)
581
581
  {
582
- SVFVar* node = new ConstantNullPtrValVar(curInst, i, icfgNode);
582
+ SVFVar* node = new ConstNullPtrValVar(i, icfgNode, type);
583
583
  return addNode(node);
584
584
  }
585
585
 
586
- inline NodeID addGlobalValueValNode(const SVFValue* curInst, const NodeID i, const ICFGNode* icfgNode)
586
+ inline NodeID addGlobalValNode(const NodeID i, const ICFGNode* icfgNode, const SVFType* svfType)
587
587
  {
588
- SVFVar* node = new GlobalValVar(curInst, i, icfgNode);
588
+ SVFVar* node = new GlobalValVar(i, icfgNode, svfType);
589
589
  return addNode(node);
590
590
  }
591
591
 
592
- inline NodeID addConstantAggValNode(const SVFValue* curInst, const NodeID i, const ICFGNode* icfgNode)
592
+ inline NodeID addConstantAggValNode(const NodeID i, const ICFGNode* icfgNode, const SVFType* svfType)
593
593
  {
594
- SVFVar* node = new ConstantAggValVar(curInst, i, icfgNode);
594
+ SVFVar* node = new ConstAggValVar(i, icfgNode, svfType);
595
595
  return addNode(node);
596
596
  }
597
597
 
598
- inline NodeID addConstantDataValNode(const SVFValue* curInst, const NodeID i, const ICFGNode* icfgNode)
598
+ inline NodeID addConstantDataValNode(const NodeID i, const ICFGNode* icfgNode, const SVFType* type)
599
599
  {
600
- SVFVar* node = new ConstantDataValVar(curInst, i, icfgNode);
600
+ SVFVar* node = new ConstDataValVar(i, icfgNode, type);
601
601
  return addNode(node);
602
602
  }
603
603
 
604
604
 
605
605
  /// Add a memory obj node
606
- inline NodeID addObjNode(const SVFValue* val, NodeID i, ObjTypeInfo* ti)
606
+ inline NodeID addObjNode(NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
607
607
  {
608
- return addFIObjNode(val, i, ti);
608
+ return addFIObjNode( i, ti, type, node);
609
609
  }
610
610
 
611
611
  /**
612
612
  * Creates and adds a heap object node to the SVFIR
613
613
  */
614
- inline NodeID addHeapObjNode(const SVFValue* val, NodeID i, ObjTypeInfo* ti, const SVFFunction* f)
614
+ inline NodeID addHeapObjNode(NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
615
615
  {
616
616
  memToFieldsMap[i].set(i);
617
- HeapObjVar *heapObj = new HeapObjVar(val, i, ti, f);
618
- return addObjNode(val, heapObj);
617
+ HeapObjVar *heapObj = new HeapObjVar(i, ti, type, node);
618
+ return addObjNode(heapObj);
619
619
  }
620
620
 
621
621
  /**
622
622
  * Creates and adds a stack object node to the SVFIR
623
623
  */
624
- inline NodeID addStackObjNode(const SVFValue* val, NodeID i, ObjTypeInfo* ti, const SVFFunction* f)
624
+ inline NodeID addStackObjNode(NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
625
625
  {
626
626
  memToFieldsMap[i].set(i);
627
- StackObjVar *stackObj = new StackObjVar(val, i, ti, f);
628
- return addObjNode(val, stackObj);
627
+ StackObjVar *stackObj = new StackObjVar(i, ti, type, node);
628
+ return addObjNode(stackObj);
629
629
  }
630
630
 
631
- NodeID addFunObjNode(const SVFValue* val, NodeID id, ObjTypeInfo* ti, const CallGraphNode* callGraphNode)
631
+ NodeID addFunObjNode(NodeID id, ObjTypeInfo* ti, const CallGraphNode* callGraphNode, const SVFType* type, const ICFGNode* node)
632
632
  {
633
633
  memToFieldsMap[id].set(id);
634
- FunObjVar* funObj = new FunObjVar(val, id, ti, callGraphNode);
635
- return addObjNode(val, funObj);
634
+ FunObjVar* funObj = new FunObjVar(id, ti, callGraphNode, type, node);
635
+ return addObjNode(funObj);
636
636
  }
637
637
 
638
638
 
639
- inline NodeID addConstantFPObjNode(const SVFValue* curInst, NodeID i, ObjTypeInfo* ti, double dval)
639
+ inline NodeID addConstantFPObjNode(NodeID i, ObjTypeInfo* ti, double dval, const SVFType* type, const ICFGNode* node)
640
640
  {
641
641
  memToFieldsMap[i].set(i);
642
- ConstantFPObjVar* conObj = new ConstantFPObjVar(curInst, i, dval, ti);
643
- return addObjNode(curInst, conObj);
642
+ ConstFPObjVar* conObj = new ConstFPObjVar(i, dval, ti, type, node);
643
+ return addObjNode(conObj);
644
644
  }
645
645
 
646
646
 
647
- inline NodeID addConstantIntObjNode(const SVFValue* curInst, NodeID i, ObjTypeInfo* ti, const std::pair<s64_t, u64_t>& intValue)
647
+ inline NodeID addConstantIntObjNode(NodeID i, ObjTypeInfo* ti, const std::pair<s64_t, u64_t>& intValue, const SVFType* type, const ICFGNode* node)
648
648
  {
649
649
  memToFieldsMap[i].set(i);
650
- ConstantIntObjVar* conObj =
651
- new ConstantIntObjVar(curInst, i, intValue.first, intValue.second, ti);
652
- return addObjNode(curInst, conObj);
650
+ ConstIntObjVar* conObj =
651
+ new ConstIntObjVar(i, intValue.first, intValue.second, ti, type, node);
652
+ return addObjNode(conObj);
653
653
  }
654
654
 
655
655
 
656
- inline NodeID addConstantNullPtrObjNode(const SVFValue* curInst, const NodeID i, ObjTypeInfo* ti)
656
+ inline NodeID addConstantNullPtrObjNode(const NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
657
657
  {
658
658
  memToFieldsMap[i].set(i);
659
- ConstantNullPtrObjVar* conObj = new ConstantNullPtrObjVar(curInst, i, ti);
660
- return addObjNode(curInst, conObj);
659
+ ConstNullPtrObjVar* conObj = new ConstNullPtrObjVar(i, ti, type, node);
660
+ return addObjNode(conObj);
661
661
  }
662
662
 
663
- inline NodeID addGlobalValueObjNode(const SVFValue* curInst, const NodeID i, ObjTypeInfo* ti)
663
+ inline NodeID addGlobalObjNode(const NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
664
664
  {
665
665
  memToFieldsMap[i].set(i);
666
- GlobalObjVar* gObj = new GlobalObjVar(curInst, i, ti);
667
- return addObjNode(curInst, gObj);
666
+ GlobalObjVar* gObj = new GlobalObjVar(i, ti, type, node);
667
+ return addObjNode(gObj);
668
668
  }
669
- inline NodeID addConstantAggObjNode(const SVFValue* curInst,
670
- const NodeID i, ObjTypeInfo* ti)
669
+ inline NodeID addConstantAggObjNode(const NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
671
670
  {
672
671
  memToFieldsMap[i].set(i);
673
- ConstantAggObjVar* conObj = new ConstantAggObjVar(curInst, i, ti);
674
- return addObjNode(curInst, conObj);
672
+ ConstAggObjVar* conObj = new ConstAggObjVar(i, ti, type, node);
673
+ return addObjNode(conObj);
675
674
  }
676
- inline NodeID addConstantDataObjNode(const SVFValue* curInst, const NodeID i, ObjTypeInfo* ti)
675
+ inline NodeID addConstantDataObjNode(const NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
677
676
  {
678
677
  memToFieldsMap[i].set(i);
679
- ConstantDataObjVar* conObj = new ConstantDataObjVar(curInst, i, ti);
680
- return addObjNode(curInst, conObj);
678
+ ConstDataObjVar* conObj = new ConstDataObjVar(i, ti, type, node);
679
+ return addObjNode(conObj);
681
680
  }
682
681
 
683
682
  /// Add a unique return node for a procedure
684
- inline NodeID addRetNode(NodeID i, const CallGraphNode* callGraphNode)
683
+ inline NodeID addRetNode(NodeID i, const CallGraphNode* callGraphNode, const SVFType* type, const ICFGNode* icn)
685
684
  {
686
- SVFVar *node = new RetPN(i, callGraphNode);
685
+ SVFVar *node = new RetValPN(i, callGraphNode, type, icn);
687
686
  return addRetNode(callGraphNode, node);
688
687
  }
689
688
  /// Add a unique vararg node for a procedure
690
- inline NodeID addVarargNode(NodeID i, const CallGraphNode* val)
689
+ inline NodeID addVarargNode(NodeID i, const CallGraphNode* val, const SVFType* type, const ICFGNode* n)
691
690
  {
692
- SVFVar *node = new VarArgPN(i, val);
691
+ SVFVar *node = new VarArgValPN(i, val, type, n);
693
692
  return addNode(node);
694
693
  }
695
694
 
696
695
  /// Add a temp field value node, this method can only invoked by getGepValVar
697
- NodeID addGepValNode(const SVFValue* curInst,const SVFValue* val, const AccessPath& ap, NodeID i, const SVFType* type);
696
+ NodeID addGepValNode(const SVFValue* curInst,const SVFValue* val, const AccessPath& ap, NodeID i, const SVFType* type, const ICFGNode* node);
698
697
  /// Add a field obj node, this method can only invoked by getGepObjVar
699
698
  NodeID addGepObjNode(const BaseObjVar* baseObj, const APOffset& apOffset, const NodeID gepId);
700
699
  /// Add a field-insensitive node, this method can only invoked by getFIGepObjNode
701
- NodeID addFIObjNode(const SVFValue* val, NodeID i, ObjTypeInfo* ti)
700
+ NodeID addFIObjNode(NodeID i, ObjTypeInfo* ti, const SVFType* type, const ICFGNode* node)
702
701
  {
703
702
  memToFieldsMap[i].set(i);
704
- BaseObjVar* baseObj = new BaseObjVar(val, i, ti);
705
- return addObjNode(val, baseObj);
703
+ BaseObjVar* baseObj = new BaseObjVar(i, ti, type, node);
704
+ return addObjNode(baseObj);
706
705
  }
707
706
 
708
707
 
@@ -710,9 +709,9 @@ private:
710
709
 
711
710
  /// Add a dummy value/object node according to node ID (llvm value is null)
712
711
  //@{
713
- inline NodeID addDummyValNode(NodeID i)
712
+ inline NodeID addDummyValNode(NodeID i, const ICFGNode* node)
714
713
  {
715
- return addValNode(nullptr, new DummyValVar(i));
714
+ return addValNode(new DummyValVar(i, node));
716
715
  }
717
716
  inline NodeID addDummyObjNode(NodeID i, const SVFType* type)
718
717
  {
@@ -720,31 +719,30 @@ private:
720
719
  {
721
720
  ObjTypeInfo* ti = symInfo->createObjTypeInfo(type);
722
721
  symInfo->idToObjTypeInfoMap()[i] = ti;
723
- return addObjNode(nullptr, new DummyObjVar(i, ti));
722
+ return addObjNode(new DummyObjVar(i, ti, nullptr, type));
724
723
  }
725
724
  else
726
725
  {
727
- return addObjNode(nullptr, new DummyObjVar(i, symInfo->getObjTypeInfo(i)));
726
+ return addObjNode(new DummyObjVar(i, symInfo->getObjTypeInfo(i), nullptr, type));
728
727
  }
729
728
  }
730
729
 
731
730
  inline NodeID addBlackholeObjNode()
732
731
  {
733
- return addObjNode(
734
- nullptr, new DummyObjVar(getBlackHoleNode(), symInfo->getObjTypeInfo(getBlackHoleNode())));
732
+ return addObjNode(new DummyObjVar(getBlackHoleNode(), symInfo->getObjTypeInfo(getBlackHoleNode()), nullptr));
735
733
  }
736
734
  inline NodeID addConstantObjNode()
737
735
  {
738
- return addObjNode(nullptr, new DummyObjVar(getConstantNode(), symInfo->getObjTypeInfo(getConstantNode())));
736
+ return addObjNode(new DummyObjVar(getConstantNode(), symInfo->getObjTypeInfo(getConstantNode()), nullptr));
739
737
  }
740
738
  inline NodeID addBlackholePtrNode()
741
739
  {
742
- return addDummyValNode(getBlkPtr());
740
+ return addDummyValNode(getBlkPtr(), nullptr);
743
741
  }
744
742
  //@}
745
743
 
746
744
  /// Add a value (pointer) node
747
- inline NodeID addValNode(const SVFValue*, SVFVar *node)
745
+ inline NodeID addValNode(SVFVar *node)
748
746
  {
749
747
  assert(node && "node cannot be nullptr.");
750
748
  assert(hasGNode(node->getId()) == false &&
@@ -753,7 +751,7 @@ private:
753
751
  return addNode(node);
754
752
  }
755
753
  /// Add a memory obj node
756
- inline NodeID addObjNode(const SVFValue*, SVFVar *node)
754
+ inline NodeID addObjNode(SVFVar *node)
757
755
  {
758
756
  assert(node && "node cannot be nullptr.");
759
757
  assert(hasGNode(node->getId()) == false &&