svf-lib 1.0.741 → 1.0.745
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/SVF-linux/Release-build/lib/libSvf.a +0 -0
- package/SVF-linux/include/Graphs/ICFGNode.h +1 -1
- package/SVF-linux/include/Graphs/VFG.h +9 -9
- package/SVF-linux/include/Graphs/VFGNode.h +6 -6
- package/SVF-linux/include/MSSA/MSSAMuChi.h +6 -6
- package/SVF-linux/include/MSSA/MemRegion.h +8 -8
- package/SVF-linux/include/MSSA/MemSSA.h +10 -10
- package/SVF-linux/include/MemoryModel/PointerAnalysis.h +1 -1
- package/SVF-linux/include/MemoryModel/PointerAnalysisImpl.h +2 -2
- package/SVF-linux/include/MemoryModel/SVFIR.h +28 -28
- package/SVF-linux/include/MemoryModel/SVFStatements.h +68 -68
- package/SVF-linux/include/MemoryModel/SVFVariables.h +39 -39
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +22 -22
- package/SVF-osx/Release-build/lib/CUDD/libCudd.a +0 -0
- package/SVF-osx/Release-build/lib/libSvf.a +0 -0
- package/SVF-osx/include/DDA/ContextDDA.h +1 -1
- package/SVF-osx/include/DDA/FlowDDA.h +1 -1
- package/SVF-osx/include/Graphs/CHG.h +2 -2
- package/SVF-osx/include/Graphs/ConsG.h +8 -8
- package/SVF-osx/include/Graphs/ICFGNode.h +4 -4
- package/SVF-osx/include/Graphs/IRGraph.h +7 -7
- package/SVF-osx/include/Graphs/VFG.h +13 -13
- package/SVF-osx/include/Graphs/VFGNode.h +6 -6
- package/SVF-osx/include/MSSA/MSSAMuChi.h +6 -6
- package/SVF-osx/include/MSSA/MemRegion.h +11 -11
- package/SVF-osx/include/MSSA/MemSSA.h +11 -11
- package/SVF-osx/include/MemoryModel/PointerAnalysis.h +7 -7
- package/SVF-osx/include/MemoryModel/PointerAnalysisImpl.h +3 -3
- package/SVF-osx/include/MemoryModel/SVFIR.h +80 -81
- package/SVF-osx/include/MemoryModel/SVFStatements.h +72 -71
- package/SVF-osx/include/MemoryModel/SVFVariables.h +54 -54
- package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +24 -24
- package/SVF-osx/include/Util/IRAnnotator.h +1 -1
- package/SVF-osx/include/Util/TypeBasedHeapCloning.h +2 -2
- package/package.json +1 -1
|
@@ -76,8 +76,8 @@ public:
|
|
|
76
76
|
|
|
77
77
|
protected:
|
|
78
78
|
const Value* value; ///< value of this SVFIR node
|
|
79
|
-
SVFStmt::
|
|
80
|
-
SVFStmt::
|
|
79
|
+
SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap;
|
|
80
|
+
SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap;
|
|
81
81
|
bool isTLPointer; /// top-level pointer
|
|
82
82
|
bool isATPointer; /// address-taken pointer
|
|
83
83
|
|
|
@@ -158,13 +158,13 @@ public:
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
/// Get incoming SVFIR edges
|
|
161
|
-
inline SVFStmt::
|
|
161
|
+
inline SVFStmt::SVFStmtSetTy& getIncomingEdges(SVFStmt::PEDGEK kind)
|
|
162
162
|
{
|
|
163
163
|
return InEdgeKindToSetMap[kind];
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
/// Get outgoing SVFIR edges
|
|
167
|
-
inline SVFStmt::
|
|
167
|
+
inline SVFStmt::SVFStmtSetTy& getOutgoingEdges(SVFStmt::PEDGEK kind)
|
|
168
168
|
{
|
|
169
169
|
return OutEdgeKindToSetMap[kind];
|
|
170
170
|
}
|
|
@@ -172,7 +172,7 @@ public:
|
|
|
172
172
|
/// Has incoming SVFIR edges
|
|
173
173
|
inline bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
|
|
174
174
|
{
|
|
175
|
-
SVFStmt::
|
|
175
|
+
SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
|
|
176
176
|
if (it != InEdgeKindToSetMap.end())
|
|
177
177
|
return (!it->second.empty());
|
|
178
178
|
else
|
|
@@ -182,7 +182,7 @@ public:
|
|
|
182
182
|
/// Has incoming VariantGepEdges
|
|
183
183
|
inline bool hasIncomingVariantGepEdge() const
|
|
184
184
|
{
|
|
185
|
-
SVFStmt::
|
|
185
|
+
SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::VariantGep);
|
|
186
186
|
if (it != InEdgeKindToSetMap.end())
|
|
187
187
|
{
|
|
188
188
|
return (!it->second.empty());
|
|
@@ -191,17 +191,17 @@ public:
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
/// Get incoming SVFStmt iterator
|
|
194
|
-
inline SVFStmt::
|
|
194
|
+
inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
|
|
195
195
|
{
|
|
196
|
-
SVFStmt::
|
|
196
|
+
SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
|
|
197
197
|
assert(it!=InEdgeKindToSetMap.end() && "The node does not have such kind of edge");
|
|
198
198
|
return it->second.begin();
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
/// Get incoming SVFStmt iterator
|
|
202
|
-
inline SVFStmt::
|
|
202
|
+
inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
|
|
203
203
|
{
|
|
204
|
-
SVFStmt::
|
|
204
|
+
SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
|
|
205
205
|
assert(it!=InEdgeKindToSetMap.end() && "The node does not have such kind of edge");
|
|
206
206
|
return it->second.end();
|
|
207
207
|
}
|
|
@@ -209,7 +209,7 @@ public:
|
|
|
209
209
|
/// Has outgoing SVFIR edges
|
|
210
210
|
inline bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
|
|
211
211
|
{
|
|
212
|
-
SVFStmt::
|
|
212
|
+
SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
|
|
213
213
|
if (it != OutEdgeKindToSetMap.end())
|
|
214
214
|
return (!it->second.empty());
|
|
215
215
|
else
|
|
@@ -217,17 +217,17 @@ public:
|
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
/// Get outgoing SVFStmt iterator
|
|
220
|
-
inline SVFStmt::
|
|
220
|
+
inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
|
|
221
221
|
{
|
|
222
|
-
SVFStmt::
|
|
222
|
+
SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
|
|
223
223
|
assert(it!=OutEdgeKindToSetMap.end() && "The node does not have such kind of edge");
|
|
224
224
|
return it->second.begin();
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
/// Get outgoing SVFStmt iterator
|
|
228
|
-
inline SVFStmt::
|
|
228
|
+
inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
|
|
229
229
|
{
|
|
230
|
-
SVFStmt::
|
|
230
|
+
SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
|
|
231
231
|
assert(it!=OutEdgeKindToSetMap.end() && "The node does not have such kind of edge");
|
|
232
232
|
return it->second.end();
|
|
233
233
|
}
|
|
@@ -270,13 +270,13 @@ public:
|
|
|
270
270
|
/*
|
|
271
271
|
* Value(Pointer) node
|
|
272
272
|
*/
|
|
273
|
-
class
|
|
273
|
+
class ValVar: public SVFVar
|
|
274
274
|
{
|
|
275
275
|
|
|
276
276
|
public:
|
|
277
277
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
278
278
|
//@{
|
|
279
|
-
static inline bool classof(const
|
|
279
|
+
static inline bool classof(const ValVar *)
|
|
280
280
|
{
|
|
281
281
|
return true;
|
|
282
282
|
}
|
|
@@ -295,7 +295,7 @@ public:
|
|
|
295
295
|
//@}
|
|
296
296
|
|
|
297
297
|
/// Constructor
|
|
298
|
-
|
|
298
|
+
ValVar(const Value* val, NodeID i, PNODEK ty = ValNode) :
|
|
299
299
|
SVFVar(val, i, ty)
|
|
300
300
|
{
|
|
301
301
|
}
|
|
@@ -314,20 +314,20 @@ public:
|
|
|
314
314
|
/*
|
|
315
315
|
* Memory Object node
|
|
316
316
|
*/
|
|
317
|
-
class
|
|
317
|
+
class ObjVar: public SVFVar
|
|
318
318
|
{
|
|
319
319
|
|
|
320
320
|
protected:
|
|
321
321
|
const MemObj* mem; ///< memory object
|
|
322
322
|
/// Constructor
|
|
323
|
-
|
|
323
|
+
ObjVar(const Value* val, NodeID i, const MemObj* m, PNODEK ty = ObjNode) :
|
|
324
324
|
SVFVar(val, i, ty), mem(m)
|
|
325
325
|
{
|
|
326
326
|
}
|
|
327
327
|
public:
|
|
328
328
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
329
329
|
//@{
|
|
330
|
-
static inline bool classof(const
|
|
330
|
+
static inline bool classof(const ObjVar *)
|
|
331
331
|
{
|
|
332
332
|
return true;
|
|
333
333
|
}
|
|
@@ -381,7 +381,7 @@ public:
|
|
|
381
381
|
* e.g. memcpy, temp gep value node needs to be created
|
|
382
382
|
* Each Gep Value node is connected to base value node via gep edge
|
|
383
383
|
*/
|
|
384
|
-
class
|
|
384
|
+
class GepValVar: public ValVar
|
|
385
385
|
{
|
|
386
386
|
|
|
387
387
|
private:
|
|
@@ -392,11 +392,11 @@ private:
|
|
|
392
392
|
public:
|
|
393
393
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
394
394
|
//@{
|
|
395
|
-
static inline bool classof(const
|
|
395
|
+
static inline bool classof(const GepValVar *)
|
|
396
396
|
{
|
|
397
397
|
return true;
|
|
398
398
|
}
|
|
399
|
-
static inline bool classof(const
|
|
399
|
+
static inline bool classof(const ValVar * node)
|
|
400
400
|
{
|
|
401
401
|
return node->getNodeKind() == SVFVar::GepValNode;
|
|
402
402
|
}
|
|
@@ -411,8 +411,8 @@ public:
|
|
|
411
411
|
//@}
|
|
412
412
|
|
|
413
413
|
/// Constructor
|
|
414
|
-
|
|
415
|
-
|
|
414
|
+
GepValVar(const Value* val, NodeID i, const LocationSet& l, const Type *ty, u32_t idx) :
|
|
415
|
+
ValVar(val, i, GepValNode), ls(l), gepValType(ty), fieldIdx(idx)
|
|
416
416
|
{
|
|
417
417
|
}
|
|
418
418
|
|
|
@@ -448,7 +448,7 @@ public:
|
|
|
448
448
|
* Gep Obj node, this is dynamic generated for field sensitive analysis
|
|
449
449
|
* Each gep obj node is one field of a MemObj (base)
|
|
450
450
|
*/
|
|
451
|
-
class GepObjPN: public
|
|
451
|
+
class GepObjPN: public ObjVar
|
|
452
452
|
{
|
|
453
453
|
private:
|
|
454
454
|
LocationSet ls;
|
|
@@ -461,7 +461,7 @@ public:
|
|
|
461
461
|
{
|
|
462
462
|
return true;
|
|
463
463
|
}
|
|
464
|
-
static inline bool classof(const
|
|
464
|
+
static inline bool classof(const ObjVar * node)
|
|
465
465
|
{
|
|
466
466
|
return node->getNodeKind() == SVFVar::GepObjNode
|
|
467
467
|
|| node->getNodeKind() == SVFVar::CloneGepObjNode;
|
|
@@ -480,7 +480,7 @@ public:
|
|
|
480
480
|
|
|
481
481
|
/// Constructor
|
|
482
482
|
GepObjPN(const MemObj* mem, NodeID i, const LocationSet& l, PNODEK ty = GepObjNode) :
|
|
483
|
-
|
|
483
|
+
ObjVar(mem->getValue(), i, mem, ty), ls(l)
|
|
484
484
|
{
|
|
485
485
|
base = mem->getId();
|
|
486
486
|
}
|
|
@@ -524,17 +524,17 @@ public:
|
|
|
524
524
|
* Field-insensitive Gep Obj node, this is dynamic generated for field sensitive analysis
|
|
525
525
|
* Each field-insensitive gep obj node represents all fields of a MemObj (base)
|
|
526
526
|
*/
|
|
527
|
-
class
|
|
527
|
+
class FIObjVar: public ObjVar
|
|
528
528
|
{
|
|
529
529
|
public:
|
|
530
530
|
|
|
531
531
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
532
532
|
//@{
|
|
533
|
-
static inline bool classof(const
|
|
533
|
+
static inline bool classof(const FIObjVar *)
|
|
534
534
|
{
|
|
535
535
|
return true;
|
|
536
536
|
}
|
|
537
|
-
static inline bool classof(const
|
|
537
|
+
static inline bool classof(const ObjVar * node)
|
|
538
538
|
{
|
|
539
539
|
return node->getNodeKind() == SVFVar::FIObjNode
|
|
540
540
|
|| node->getNodeKind() == SVFVar::CloneFIObjNode;
|
|
@@ -552,8 +552,8 @@ public:
|
|
|
552
552
|
//@}
|
|
553
553
|
|
|
554
554
|
/// Constructor
|
|
555
|
-
|
|
556
|
-
|
|
555
|
+
FIObjVar(const Value* val, NodeID i, const MemObj* mem, PNODEK ty = FIObjNode) :
|
|
556
|
+
ObjVar(val, i, mem, ty)
|
|
557
557
|
{
|
|
558
558
|
}
|
|
559
559
|
|
|
@@ -651,13 +651,13 @@ public:
|
|
|
651
651
|
/*
|
|
652
652
|
* Dummy node
|
|
653
653
|
*/
|
|
654
|
-
class
|
|
654
|
+
class DummyValVar: public ValVar
|
|
655
655
|
{
|
|
656
656
|
|
|
657
657
|
public:
|
|
658
658
|
|
|
659
659
|
//@{ Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
660
|
-
static inline bool classof(const
|
|
660
|
+
static inline bool classof(const DummyValVar *)
|
|
661
661
|
{
|
|
662
662
|
return true;
|
|
663
663
|
}
|
|
@@ -672,7 +672,7 @@ public:
|
|
|
672
672
|
//@}
|
|
673
673
|
|
|
674
674
|
/// Constructor
|
|
675
|
-
|
|
675
|
+
DummyValVar(NodeID i) : ValVar(nullptr, i, DummyValNode)
|
|
676
676
|
{
|
|
677
677
|
}
|
|
678
678
|
|
|
@@ -690,13 +690,13 @@ public:
|
|
|
690
690
|
/*
|
|
691
691
|
* Dummy node
|
|
692
692
|
*/
|
|
693
|
-
class
|
|
693
|
+
class DummyObjVar: public ObjVar
|
|
694
694
|
{
|
|
695
695
|
|
|
696
696
|
public:
|
|
697
697
|
|
|
698
698
|
//@{ Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
699
|
-
static inline bool classof(const
|
|
699
|
+
static inline bool classof(const DummyObjVar *)
|
|
700
700
|
{
|
|
701
701
|
return true;
|
|
702
702
|
}
|
|
@@ -713,8 +713,8 @@ public:
|
|
|
713
713
|
//@}
|
|
714
714
|
|
|
715
715
|
/// Constructor
|
|
716
|
-
|
|
717
|
-
:
|
|
716
|
+
DummyObjVar(NodeID i,const MemObj* m, PNODEK ty = DummyObjNode)
|
|
717
|
+
: ObjVar(nullptr, i, m, ty)
|
|
718
718
|
{
|
|
719
719
|
}
|
|
720
720
|
|
|
@@ -730,11 +730,11 @@ public:
|
|
|
730
730
|
/*
|
|
731
731
|
* Clone object node for dummy objects.
|
|
732
732
|
*/
|
|
733
|
-
class
|
|
733
|
+
class CloneDummyObjVar: public DummyObjVar
|
|
734
734
|
{
|
|
735
735
|
public:
|
|
736
736
|
//@{ Methods to support type inquiry through isa, cast, and dyn_cast:
|
|
737
|
-
static inline bool classof(const
|
|
737
|
+
static inline bool classof(const CloneDummyObjVar *)
|
|
738
738
|
{
|
|
739
739
|
return true;
|
|
740
740
|
}
|
|
@@ -749,15 +749,15 @@ public:
|
|
|
749
749
|
//@}
|
|
750
750
|
|
|
751
751
|
/// Constructor
|
|
752
|
-
|
|
753
|
-
:
|
|
752
|
+
CloneDummyObjVar(NodeID i, const MemObj* m, PNODEK ty = CloneDummyObjNode)
|
|
753
|
+
: DummyObjVar(i, m, ty)
|
|
754
754
|
{
|
|
755
755
|
}
|
|
756
756
|
|
|
757
757
|
/// Return name of this node
|
|
758
758
|
inline const std::string getValueName() const
|
|
759
759
|
{
|
|
760
|
-
return "clone of " +
|
|
760
|
+
return "clone of " + ObjVar::getValueName();
|
|
761
761
|
}
|
|
762
762
|
|
|
763
763
|
virtual const std::string toString() const;
|
|
@@ -766,11 +766,11 @@ public:
|
|
|
766
766
|
/*
|
|
767
767
|
* Clone object for GEP objects.
|
|
768
768
|
*/
|
|
769
|
-
class
|
|
769
|
+
class CloneGepObjVar : public GepObjPN
|
|
770
770
|
{
|
|
771
771
|
public:
|
|
772
772
|
//@{ Methods to support type inquiry through isa, cast, and dyn_cast:
|
|
773
|
-
static inline bool classof(const
|
|
773
|
+
static inline bool classof(const CloneGepObjVar *)
|
|
774
774
|
{
|
|
775
775
|
return true;
|
|
776
776
|
}
|
|
@@ -785,7 +785,7 @@ public:
|
|
|
785
785
|
//@}
|
|
786
786
|
|
|
787
787
|
/// Constructor
|
|
788
|
-
|
|
788
|
+
CloneGepObjVar(const MemObj* mem, NodeID i, const LocationSet& l, PNODEK ty = CloneGepObjNode) :
|
|
789
789
|
GepObjPN(mem, i, l, ty)
|
|
790
790
|
{
|
|
791
791
|
}
|
|
@@ -802,11 +802,11 @@ public:
|
|
|
802
802
|
/*
|
|
803
803
|
* Clone object for FI objects.
|
|
804
804
|
*/
|
|
805
|
-
class
|
|
805
|
+
class CloneFIObjVar : public FIObjVar
|
|
806
806
|
{
|
|
807
807
|
public:
|
|
808
808
|
//@{ Methods to support type inquiry through isa, cast, and dyn_cast:
|
|
809
|
-
static inline bool classof(const
|
|
809
|
+
static inline bool classof(const CloneFIObjVar *)
|
|
810
810
|
{
|
|
811
811
|
return true;
|
|
812
812
|
}
|
|
@@ -821,15 +821,15 @@ public:
|
|
|
821
821
|
//@}
|
|
822
822
|
|
|
823
823
|
/// Constructor
|
|
824
|
-
|
|
825
|
-
|
|
824
|
+
CloneFIObjVar(const Value* val, NodeID i, const MemObj* mem, PNODEK ty = CloneFIObjNode) :
|
|
825
|
+
FIObjVar(val, i, mem, ty)
|
|
826
826
|
{
|
|
827
827
|
}
|
|
828
828
|
|
|
829
829
|
/// Return name of this node
|
|
830
830
|
inline const std::string getValueName() const
|
|
831
831
|
{
|
|
832
|
-
return "clone (FI) of " +
|
|
832
|
+
return "clone (FI) of " + FIObjVar::getValueName();
|
|
833
833
|
}
|
|
834
834
|
|
|
835
835
|
virtual const std::string toString() const;
|
|
@@ -269,56 +269,56 @@ public:
|
|
|
269
269
|
|
|
270
270
|
public:
|
|
271
271
|
|
|
272
|
-
NodeID
|
|
272
|
+
NodeID getGepValVar(const Value* val, const LocationSet& ls, const Type *baseType, u32_t fieldidx);
|
|
273
273
|
|
|
274
274
|
void setCurrentBBAndValueForPAGEdge(PAGEdge* edge);
|
|
275
275
|
|
|
276
276
|
inline PAGEdge* addBlackHoleAddrEdge(NodeID node)
|
|
277
277
|
{
|
|
278
|
-
PAGEdge *edge = pag->
|
|
278
|
+
PAGEdge *edge = pag->addBlackHoleAddrStmt(node);
|
|
279
279
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
280
280
|
return edge;
|
|
281
281
|
}
|
|
282
282
|
|
|
283
283
|
/// Add Address edge
|
|
284
|
-
inline
|
|
284
|
+
inline AddrStmt* addAddrEdge(NodeID src, NodeID dst)
|
|
285
285
|
{
|
|
286
|
-
|
|
286
|
+
AddrStmt *edge = pag->addAddrStmt(src, dst);
|
|
287
287
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
288
288
|
return edge;
|
|
289
289
|
}
|
|
290
290
|
/// Add Copy edge
|
|
291
|
-
inline
|
|
291
|
+
inline CopyStmt* addCopyEdge(NodeID src, NodeID dst)
|
|
292
292
|
{
|
|
293
|
-
|
|
293
|
+
CopyStmt *edge = pag->addCopyStmt(src, dst);
|
|
294
294
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
295
295
|
return edge;
|
|
296
296
|
}
|
|
297
297
|
/// Add Copy edge
|
|
298
|
-
inline
|
|
298
|
+
inline PhiStmt* addPhiStmt(NodeID res, NodeID opnd)
|
|
299
299
|
{
|
|
300
|
-
|
|
300
|
+
PhiStmt *edge = pag->addPhiStmt(res,opnd);
|
|
301
301
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
302
302
|
return edge;
|
|
303
303
|
}
|
|
304
304
|
/// Add Copy edge
|
|
305
|
-
inline
|
|
305
|
+
inline CmpStmt* addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
|
|
306
306
|
{
|
|
307
|
-
|
|
307
|
+
CmpStmt *edge = pag->addCmpStmt(op1, op2, dst, opcode);
|
|
308
308
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
309
309
|
return edge;
|
|
310
310
|
}
|
|
311
311
|
/// Add Copy edge
|
|
312
|
-
inline
|
|
312
|
+
inline BinaryOPStmt* addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
|
|
313
313
|
{
|
|
314
|
-
|
|
314
|
+
BinaryOPStmt *edge = pag->addBinaryOPStmt(op1, op2, dst, opcode);
|
|
315
315
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
316
316
|
return edge;
|
|
317
317
|
}
|
|
318
318
|
/// Add Unary edge
|
|
319
|
-
inline
|
|
319
|
+
inline UnaryOPStmt* addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
|
|
320
320
|
{
|
|
321
|
-
|
|
321
|
+
UnaryOPStmt *edge = pag->addUnaryOPStmt(src, dst, opcode);
|
|
322
322
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
323
323
|
return edge;
|
|
324
324
|
}
|
|
@@ -329,21 +329,21 @@ public:
|
|
|
329
329
|
return edge;
|
|
330
330
|
}
|
|
331
331
|
/// Add Load edge
|
|
332
|
-
inline
|
|
332
|
+
inline LoadStmt* addLoadEdge(NodeID src, NodeID dst)
|
|
333
333
|
{
|
|
334
|
-
|
|
334
|
+
LoadStmt *edge = pag->addLoadStmt(src, dst);
|
|
335
335
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
336
336
|
return edge;
|
|
337
337
|
}
|
|
338
338
|
/// Add Store edge
|
|
339
|
-
inline
|
|
339
|
+
inline StoreStmt* addStoreEdge(NodeID src, NodeID dst)
|
|
340
340
|
{
|
|
341
341
|
IntraBlockNode* node;
|
|
342
342
|
if(const Instruction* inst = SVFUtil::dyn_cast<Instruction>(curVal))
|
|
343
343
|
node = pag->getICFG()->getIntraBlockNode(inst);
|
|
344
344
|
else
|
|
345
345
|
node = nullptr;
|
|
346
|
-
|
|
346
|
+
StoreStmt *edge = pag->addStoreStmt(src, dst, node);
|
|
347
347
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
348
348
|
return edge;
|
|
349
349
|
}
|
|
@@ -362,23 +362,23 @@ public:
|
|
|
362
362
|
return edge;
|
|
363
363
|
}
|
|
364
364
|
/// Add Gep edge
|
|
365
|
-
inline
|
|
365
|
+
inline GepStmt* addGepEdge(NodeID src, NodeID dst, const LocationSet& ls, bool constGep)
|
|
366
366
|
{
|
|
367
|
-
|
|
367
|
+
GepStmt *edge = pag->addGepStmt(src, dst, ls, constGep);
|
|
368
368
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
369
369
|
return edge;
|
|
370
370
|
}
|
|
371
371
|
/// Add Offset(Gep) edge
|
|
372
|
-
inline
|
|
372
|
+
inline NormalGepStmt* addNormalGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
|
|
373
373
|
{
|
|
374
|
-
|
|
374
|
+
NormalGepStmt *edge = pag->addNormalGepStmt(src, dst, ls);
|
|
375
375
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
376
376
|
return edge;
|
|
377
377
|
}
|
|
378
378
|
/// Add Variant(Gep) edge
|
|
379
|
-
inline
|
|
379
|
+
inline VariantGepStmt* addVariantGepEdge(NodeID src, NodeID dst)
|
|
380
380
|
{
|
|
381
|
-
|
|
381
|
+
VariantGepStmt *edge = pag->addVariantGepStmt(src, dst);
|
|
382
382
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
383
383
|
return edge;
|
|
384
384
|
}
|
|
@@ -99,7 +99,7 @@ private:
|
|
|
99
99
|
SVF::Size_t locationSetOffset = std::stoi(llvm::cast<llvm::MDString>(mdNode->getOperand(1))->getString().str());
|
|
100
100
|
|
|
101
101
|
LocationSet locationSet = LocationSet(locationSetOffset);
|
|
102
|
-
SVF::NodeID gepnodeId = pag->
|
|
102
|
+
SVF::NodeID gepnodeId = pag->getGepObjVar(baseNodeId, locationSet);
|
|
103
103
|
|
|
104
104
|
assert(nodeId == gepnodeId && "nodeId != gepnodeId");
|
|
105
105
|
}
|
|
@@ -97,8 +97,8 @@ protected:
|
|
|
97
97
|
const NodeBS &getGepObjs(NodeID base);
|
|
98
98
|
|
|
99
99
|
/// Returns the GEP object node(s) of base for ls. This may include clones.
|
|
100
|
-
/// If there are no GEP objects, then
|
|
101
|
-
/// (through base's
|
|
100
|
+
/// If there are no GEP objects, then getGepObjVar is called on the SVFIR
|
|
101
|
+
/// (through base's getGepObjVar) which will create one.
|
|
102
102
|
const NodeBS getGepObjClones(NodeID base, unsigned offset);
|
|
103
103
|
|
|
104
104
|
/// Initialise the pointees of p at loc (which is type tildet *). reuse indicates
|