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
|
Binary file
|
|
@@ -47,7 +47,7 @@ class VFGNode;
|
|
|
47
47
|
|
|
48
48
|
/*!
|
|
49
49
|
* Interprocedural control-flow graph node, representing different kinds of program statements
|
|
50
|
-
* including top-level pointers (
|
|
50
|
+
* including top-level pointers (ValVar) and address-taken objects (ObjVar)
|
|
51
51
|
*/
|
|
52
52
|
typedef GenericNode<ICFGNode, ICFGEdge> GenericICFGNodeTy;
|
|
53
53
|
|
|
@@ -483,28 +483,28 @@ protected:
|
|
|
483
483
|
setDef(pagNode,sNode);
|
|
484
484
|
}
|
|
485
485
|
/// Add an Address VFG node
|
|
486
|
-
inline void addAddrVFGNode(const
|
|
486
|
+
inline void addAddrVFGNode(const AddrStmt* addr)
|
|
487
487
|
{
|
|
488
488
|
AddrVFGNode* sNode = new AddrVFGNode(totalVFGNode++,addr);
|
|
489
489
|
addStmtVFGNode(sNode, addr);
|
|
490
490
|
setDef(addr->getDstNode(),sNode);
|
|
491
491
|
}
|
|
492
492
|
/// Add a Copy VFG node
|
|
493
|
-
inline void addCopyVFGNode(const
|
|
493
|
+
inline void addCopyVFGNode(const CopyStmt* copy)
|
|
494
494
|
{
|
|
495
495
|
CopyVFGNode* sNode = new CopyVFGNode(totalVFGNode++,copy);
|
|
496
496
|
addStmtVFGNode(sNode, copy);
|
|
497
497
|
setDef(copy->getDstNode(),sNode);
|
|
498
498
|
}
|
|
499
499
|
/// Add a Gep VFG node
|
|
500
|
-
inline void addGepVFGNode(const
|
|
500
|
+
inline void addGepVFGNode(const GepStmt* gep)
|
|
501
501
|
{
|
|
502
502
|
GepVFGNode* sNode = new GepVFGNode(totalVFGNode++,gep);
|
|
503
503
|
addStmtVFGNode(sNode, gep);
|
|
504
504
|
setDef(gep->getDstNode(),sNode);
|
|
505
505
|
}
|
|
506
506
|
/// Add a Load VFG node
|
|
507
|
-
void addLoadVFGNode(const
|
|
507
|
+
void addLoadVFGNode(const LoadStmt* load)
|
|
508
508
|
{
|
|
509
509
|
LoadVFGNode* sNode = new LoadVFGNode(totalVFGNode++,load);
|
|
510
510
|
addStmtVFGNode(sNode, load);
|
|
@@ -512,7 +512,7 @@ protected:
|
|
|
512
512
|
}
|
|
513
513
|
/// Add a Store VFG node,
|
|
514
514
|
/// To be noted store does not create a new pointer, we do not set def for any SVFIR node
|
|
515
|
-
void addStoreVFGNode(const
|
|
515
|
+
void addStoreVFGNode(const StoreStmt* store)
|
|
516
516
|
{
|
|
517
517
|
StoreVFGNode* sNode = new StoreVFGNode(totalVFGNode++,store);
|
|
518
518
|
addStmtVFGNode(sNode, store);
|
|
@@ -569,7 +569,7 @@ protected:
|
|
|
569
569
|
PAGNodeToActualRetMap[ret] = sNode;
|
|
570
570
|
}
|
|
571
571
|
/// Add an llvm PHI VFG node
|
|
572
|
-
inline void addIntraPHIVFGNode(const
|
|
572
|
+
inline void addIntraPHIVFGNode(const PhiStmt* edge)
|
|
573
573
|
{
|
|
574
574
|
IntraPHIVFGNode* sNode = new IntraPHIVFGNode(totalVFGNode++,edge->getRes());
|
|
575
575
|
u32_t pos = 0;
|
|
@@ -583,7 +583,7 @@ protected:
|
|
|
583
583
|
PAGNodeToIntraPHIVFGNodeMap[edge->getRes()] = sNode;
|
|
584
584
|
}
|
|
585
585
|
/// Add a Compare VFG node
|
|
586
|
-
inline void addCmpVFGNode(const
|
|
586
|
+
inline void addCmpVFGNode(const CmpStmt* edge)
|
|
587
587
|
{
|
|
588
588
|
CmpVFGNode* sNode = new CmpVFGNode(totalVFGNode++, edge->getRes());
|
|
589
589
|
u32_t pos = 0;
|
|
@@ -597,7 +597,7 @@ protected:
|
|
|
597
597
|
PAGNodeToCmpVFGNodeMap[edge->getRes()] = sNode;
|
|
598
598
|
}
|
|
599
599
|
/// Add a BinaryOperator VFG node
|
|
600
|
-
inline void addBinaryOPVFGNode(const
|
|
600
|
+
inline void addBinaryOPVFGNode(const BinaryOPStmt* edge)
|
|
601
601
|
{
|
|
602
602
|
BinaryOPVFGNode* sNode = new BinaryOPVFGNode(totalVFGNode++, edge->getRes());
|
|
603
603
|
u32_t pos = 0;
|
|
@@ -611,7 +611,7 @@ protected:
|
|
|
611
611
|
PAGNodeToBinaryOPVFGNodeMap[edge->getRes()] = sNode;
|
|
612
612
|
}
|
|
613
613
|
/// Add a UnaryOperator VFG node
|
|
614
|
-
inline void addUnaryOPVFGNode(const
|
|
614
|
+
inline void addUnaryOPVFGNode(const UnaryOPStmt* edge)
|
|
615
615
|
{
|
|
616
616
|
UnaryOPVFGNode* sNode = new UnaryOPVFGNode(totalVFGNode++, edge->getRes());
|
|
617
617
|
sNode->setOpVer(0, edge->getOpVar());
|
|
@@ -40,7 +40,7 @@ namespace SVF
|
|
|
40
40
|
|
|
41
41
|
/*!
|
|
42
42
|
* Interprocedural control-flow graph node, representing different kinds of program statements
|
|
43
|
-
* including top-level pointers (
|
|
43
|
+
* including top-level pointers (ValVar) and address-taken objects (ObjVar)
|
|
44
44
|
*/
|
|
45
45
|
typedef GenericNode<VFGNode,VFGEdge> GenericVFGNodeTy;
|
|
46
46
|
class VFGNode : public GenericVFGNodeTy
|
|
@@ -202,7 +202,7 @@ private:
|
|
|
202
202
|
|
|
203
203
|
public:
|
|
204
204
|
/// Constructor
|
|
205
|
-
LoadVFGNode(NodeID id, const
|
|
205
|
+
LoadVFGNode(NodeID id, const LoadStmt* edge): StmtVFGNode(id, edge,Load)
|
|
206
206
|
{
|
|
207
207
|
|
|
208
208
|
}
|
|
@@ -241,7 +241,7 @@ private:
|
|
|
241
241
|
|
|
242
242
|
public:
|
|
243
243
|
/// Constructor
|
|
244
|
-
StoreVFGNode(NodeID id,const
|
|
244
|
+
StoreVFGNode(NodeID id,const StoreStmt* edge): StmtVFGNode(id,edge,Store)
|
|
245
245
|
{
|
|
246
246
|
|
|
247
247
|
}
|
|
@@ -280,7 +280,7 @@ private:
|
|
|
280
280
|
|
|
281
281
|
public:
|
|
282
282
|
/// Constructor
|
|
283
|
-
CopyVFGNode(NodeID id,const
|
|
283
|
+
CopyVFGNode(NodeID id,const CopyStmt* copy): StmtVFGNode(id,copy,Copy)
|
|
284
284
|
{
|
|
285
285
|
|
|
286
286
|
}
|
|
@@ -591,7 +591,7 @@ private:
|
|
|
591
591
|
|
|
592
592
|
public:
|
|
593
593
|
/// Constructor
|
|
594
|
-
GepVFGNode(NodeID id,const
|
|
594
|
+
GepVFGNode(NodeID id,const GepStmt* edge): StmtVFGNode(id,edge,Gep)
|
|
595
595
|
{
|
|
596
596
|
|
|
597
597
|
}
|
|
@@ -753,7 +753,7 @@ private:
|
|
|
753
753
|
|
|
754
754
|
public:
|
|
755
755
|
/// Constructor
|
|
756
|
-
AddrVFGNode(NodeID id, const
|
|
756
|
+
AddrVFGNode(NodeID id, const AddrStmt* edge): StmtVFGNode(id, edge,Addr)
|
|
757
757
|
{
|
|
758
758
|
|
|
759
759
|
}
|
|
@@ -166,13 +166,13 @@ class LoadMU : public MSSAMU<Cond>
|
|
|
166
166
|
{
|
|
167
167
|
|
|
168
168
|
private:
|
|
169
|
-
const
|
|
169
|
+
const LoadStmt* inst;
|
|
170
170
|
const BasicBlock* bb;
|
|
171
171
|
|
|
172
172
|
public:
|
|
173
173
|
/// Constructor/Destructor for MU
|
|
174
174
|
//@{
|
|
175
|
-
LoadMU(const BasicBlock* b,const
|
|
175
|
+
LoadMU(const BasicBlock* b,const LoadStmt* i, const MemRegion* m, Cond c = true) :
|
|
176
176
|
MSSAMU<Cond>(MSSAMU<Cond>::LoadMSSAMU,m,c), inst(i), bb(b)
|
|
177
177
|
{
|
|
178
178
|
}
|
|
@@ -183,7 +183,7 @@ public:
|
|
|
183
183
|
//@}
|
|
184
184
|
|
|
185
185
|
/// Return load instruction
|
|
186
|
-
inline const
|
|
186
|
+
inline const LoadStmt* getLoadInst() const
|
|
187
187
|
{
|
|
188
188
|
return inst;
|
|
189
189
|
}
|
|
@@ -462,11 +462,11 @@ class StoreCHI : public MSSACHI<Cond>
|
|
|
462
462
|
{
|
|
463
463
|
private:
|
|
464
464
|
const BasicBlock* bb;
|
|
465
|
-
const
|
|
465
|
+
const StoreStmt* inst;
|
|
466
466
|
public:
|
|
467
467
|
/// Constructors for StoreCHI
|
|
468
468
|
//@{
|
|
469
|
-
StoreCHI(const BasicBlock* b, const
|
|
469
|
+
StoreCHI(const BasicBlock* b, const StoreStmt* i, const MemRegion* m, Cond c = true) :
|
|
470
470
|
MSSACHI<Cond>(MSSADEF::StoreMSSACHI,m,c), bb(b), inst(i)
|
|
471
471
|
{
|
|
472
472
|
}
|
|
@@ -482,7 +482,7 @@ public:
|
|
|
482
482
|
}
|
|
483
483
|
|
|
484
484
|
/// Get store instruction
|
|
485
|
-
inline const
|
|
485
|
+
inline const StoreStmt* getStoreInst() const
|
|
486
486
|
{
|
|
487
487
|
return inst;
|
|
488
488
|
}
|
|
@@ -146,15 +146,15 @@ public:
|
|
|
146
146
|
/// Map loads/stores to its mem regions,
|
|
147
147
|
/// TODO:visitAtomicCmpXchgInst, visitAtomicRMWInst??
|
|
148
148
|
//@{
|
|
149
|
-
typedef Map<const
|
|
150
|
-
typedef Map<const
|
|
149
|
+
typedef Map<const LoadStmt*, MRSet> LoadsToMRsMap;
|
|
150
|
+
typedef Map<const StoreStmt*, MRSet> StoresToMRsMap;
|
|
151
151
|
typedef Map<const CallBlockNode*, MRSet> CallSiteToMRsMap;
|
|
152
152
|
//@}
|
|
153
153
|
|
|
154
154
|
/// Map loads/stores/callsites to their cpts set
|
|
155
155
|
//@{
|
|
156
|
-
typedef Map<const
|
|
157
|
-
typedef Map<const
|
|
156
|
+
typedef Map<const LoadStmt*, NodeBS> LoadsToPointsToMap;
|
|
157
|
+
typedef Map<const StoreStmt*, NodeBS> StoresToPointsToMap;
|
|
158
158
|
typedef Map<const CallBlockNode*, NodeBS> CallSiteToPointsToMap;
|
|
159
159
|
//@}
|
|
160
160
|
|
|
@@ -334,13 +334,13 @@ protected:
|
|
|
334
334
|
|
|
335
335
|
/// Add cpts to store/load
|
|
336
336
|
//@{
|
|
337
|
-
inline void addCPtsToStore(NodeBS& cpts, const
|
|
337
|
+
inline void addCPtsToStore(NodeBS& cpts, const StoreStmt *st, const SVFFunction* fun)
|
|
338
338
|
{
|
|
339
339
|
storesToPointsToMap[st] = cpts;
|
|
340
340
|
funToPointsToMap[fun].insert(cpts);
|
|
341
341
|
addModSideEffectOfFunction(fun,cpts);
|
|
342
342
|
}
|
|
343
|
-
inline void addCPtsToLoad(NodeBS& cpts, const
|
|
343
|
+
inline void addCPtsToLoad(NodeBS& cpts, const LoadStmt *ld, const SVFFunction* fun)
|
|
344
344
|
{
|
|
345
345
|
loadsToPointsToMap[ld] = cpts;
|
|
346
346
|
funToPointsToMap[fun].insert(cpts);
|
|
@@ -440,11 +440,11 @@ public:
|
|
|
440
440
|
{
|
|
441
441
|
return funToMRsMap[fun];
|
|
442
442
|
}
|
|
443
|
-
inline MRSet& getLoadMRSet(const
|
|
443
|
+
inline MRSet& getLoadMRSet(const LoadStmt* load)
|
|
444
444
|
{
|
|
445
445
|
return loadsToMRsMap[load];
|
|
446
446
|
}
|
|
447
|
-
inline MRSet& getStoreMRSet(const
|
|
447
|
+
inline MRSet& getStoreMRSet(const StoreStmt* store)
|
|
448
448
|
{
|
|
449
449
|
return storesToMRsMap[store];
|
|
450
450
|
}
|
|
@@ -71,8 +71,8 @@ public:
|
|
|
71
71
|
/// Map loads/stores to its mem regions,
|
|
72
72
|
/// TODO:visitAtomicCmpXchgInst, visitAtomicRMWInst??
|
|
73
73
|
//@{
|
|
74
|
-
typedef Map<const
|
|
75
|
-
typedef Map<const
|
|
74
|
+
typedef Map<const LoadStmt*, MUSet> LoadToMUSetMap;
|
|
75
|
+
typedef Map<const StoreStmt*, CHISet> StoreToChiSetMap;
|
|
76
76
|
typedef Map<const CallBlockNode*, MUSet> CallSiteToMUSetMap;
|
|
77
77
|
typedef Map<const CallBlockNode*, CHISet> CallSiteToCHISetMap;
|
|
78
78
|
typedef Map<const BasicBlock*, PHISet> BBToPhiSetMap;
|
|
@@ -180,12 +180,12 @@ private:
|
|
|
180
180
|
|
|
181
181
|
/// Add methods for mus/chis/phis
|
|
182
182
|
//@{
|
|
183
|
-
inline void AddLoadMU(const BasicBlock* bb, const
|
|
183
|
+
inline void AddLoadMU(const BasicBlock* bb, const LoadStmt* load, const MRSet& mrSet)
|
|
184
184
|
{
|
|
185
185
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
186
186
|
AddLoadMU(bb,load,*iter);
|
|
187
187
|
}
|
|
188
|
-
inline void AddStoreCHI(const BasicBlock* bb, const
|
|
188
|
+
inline void AddStoreCHI(const BasicBlock* bb, const StoreStmt* store, const MRSet& mrSet)
|
|
189
189
|
{
|
|
190
190
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
191
191
|
AddStoreCHI(bb,store,*iter);
|
|
@@ -205,13 +205,13 @@ private:
|
|
|
205
205
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
206
206
|
AddMSSAPHI(bb,*iter);
|
|
207
207
|
}
|
|
208
|
-
inline void AddLoadMU(const BasicBlock* bb, const
|
|
208
|
+
inline void AddLoadMU(const BasicBlock* bb, const LoadStmt* load, const MemRegion* mr)
|
|
209
209
|
{
|
|
210
210
|
LOADMU* mu = new LOADMU(bb,load, mr);
|
|
211
211
|
load2MuSetMap[load].insert(mu);
|
|
212
212
|
collectRegUses(mr);
|
|
213
213
|
}
|
|
214
|
-
inline void AddStoreCHI(const BasicBlock* bb, const
|
|
214
|
+
inline void AddStoreCHI(const BasicBlock* bb, const StoreStmt* store, const MemRegion* mr)
|
|
215
215
|
{
|
|
216
216
|
STORECHI* chi = new STORECHI(bb,store, mr);
|
|
217
217
|
store2ChiSetMap[store].insert(chi);
|
|
@@ -331,7 +331,7 @@ public:
|
|
|
331
331
|
//@{
|
|
332
332
|
inline bool hasMU(const PAGEdge* inst) const
|
|
333
333
|
{
|
|
334
|
-
if (const
|
|
334
|
+
if (const LoadStmt* load = SVFUtil::dyn_cast<LoadStmt>(inst))
|
|
335
335
|
{
|
|
336
336
|
assert(0 != load2MuSetMap.count(load)
|
|
337
337
|
&& "not associated with mem region!");
|
|
@@ -342,7 +342,7 @@ public:
|
|
|
342
342
|
}
|
|
343
343
|
inline bool hasCHI(const PAGEdge* inst) const
|
|
344
344
|
{
|
|
345
|
-
if (const
|
|
345
|
+
if (const StoreStmt* store = SVFUtil::dyn_cast<StoreStmt>(
|
|
346
346
|
inst))
|
|
347
347
|
{
|
|
348
348
|
assert(0 != store2ChiSetMap.count(store)
|
|
@@ -385,11 +385,11 @@ public:
|
|
|
385
385
|
|
|
386
386
|
/// Get methods of mu/chi/phi
|
|
387
387
|
//@{
|
|
388
|
-
inline MUSet& getMUSet(const
|
|
388
|
+
inline MUSet& getMUSet(const LoadStmt* ld)
|
|
389
389
|
{
|
|
390
390
|
return load2MuSetMap[ld];
|
|
391
391
|
}
|
|
392
|
-
inline CHISet& getCHISet(const
|
|
392
|
+
inline CHISet& getCHISet(const StoreStmt* st)
|
|
393
393
|
{
|
|
394
394
|
return store2ChiSetMap[st];
|
|
395
395
|
}
|
|
@@ -577,11 +577,11 @@ public:
|
|
|
577
577
|
const PAGNode* node = this->getPAG()->getGNode(*nIter);
|
|
578
578
|
if (this->getPAG()->isValidTopLevelPtr(node))
|
|
579
579
|
{
|
|
580
|
-
if (SVFUtil::isa<
|
|
580
|
+
if (SVFUtil::isa<DummyObjVar>(node))
|
|
581
581
|
{
|
|
582
582
|
SVFUtil::outs() << "##<Blackhole or constant> id:" << node->getId();
|
|
583
583
|
}
|
|
584
|
-
else if (!SVFUtil::isa<
|
|
584
|
+
else if (!SVFUtil::isa<DummyValVar>(node))
|
|
585
585
|
{
|
|
586
586
|
SVFUtil::outs() << "##<" << node->getValue()->getName() << "> ";
|
|
587
587
|
//SVFUtil::outs() << "Source Loc: " << SVFUtil::getSourceLoc(node->getValue());
|
|
@@ -55,8 +55,8 @@ public:
|
|
|
55
55
|
typedef Map<NodeID,NodeBS> MemObjToFieldsMap;
|
|
56
56
|
typedef std::vector<const SVFStmt*> PAGEdgeList;
|
|
57
57
|
typedef std::vector<const SVFVar*> PAGNodeList;
|
|
58
|
-
typedef std::vector<const
|
|
59
|
-
typedef Map<const SVFVar*,
|
|
58
|
+
typedef std::vector<const CopyStmt*> CopyPEList;
|
|
59
|
+
typedef Map<const SVFVar*,PhiStmt*> PHINodeMap;
|
|
60
60
|
typedef Map<const SVFFunction*,PAGNodeList> FunToArgsListMap;
|
|
61
61
|
typedef Map<const CallBlockNode*,PAGNodeList> CSToArgsListMap;
|
|
62
62
|
typedef Map<const RetBlockNode*,const SVFVar*> CSToRetMap;
|
|
@@ -292,7 +292,7 @@ public:
|
|
|
292
292
|
}
|
|
293
293
|
//@}
|
|
294
294
|
|
|
295
|
-
/// Due to constaint expression, curInst is used to distinguish different instructions (e.g., memorycpy) when creating
|
|
295
|
+
/// Due to constaint expression, curInst is used to distinguish different instructions (e.g., memorycpy) when creating GepValVar.
|
|
296
296
|
inline NodeID getGepValNode(const Value* curInst, NodeID base, const LocationSet& ls) const
|
|
297
297
|
{
|
|
298
298
|
GepValPNMap::const_iterator iter = GepValNodeMap.find(curInst);
|
|
@@ -353,17 +353,17 @@ public:
|
|
|
353
353
|
|
|
354
354
|
/// Get memory object - Return memory object according to pag node id
|
|
355
355
|
/// return whole allocated memory object if this node is a gep obj node
|
|
356
|
-
/// return nullptr is this node is not a
|
|
356
|
+
/// return nullptr is this node is not a ObjVar type
|
|
357
357
|
//@{
|
|
358
358
|
inline const MemObj*getObject(NodeID id) const
|
|
359
359
|
{
|
|
360
360
|
const SVFVar* node = getGNode(id);
|
|
361
|
-
if(const
|
|
361
|
+
if(const ObjVar* objPN = SVFUtil::dyn_cast<ObjVar>(node))
|
|
362
362
|
return getObject(objPN);
|
|
363
363
|
else
|
|
364
364
|
return nullptr;
|
|
365
365
|
}
|
|
366
|
-
inline const MemObj*getObject(const
|
|
366
|
+
inline const MemObj*getObject(const ObjVar* node) const
|
|
367
367
|
{
|
|
368
368
|
return node->getMemObj();
|
|
369
369
|
}
|
|
@@ -382,8 +382,8 @@ public:
|
|
|
382
382
|
inline NodeID getFIObjNode(NodeID id) const
|
|
383
383
|
{
|
|
384
384
|
SVFVar* node = pag->getGNode(id);
|
|
385
|
-
assert(SVFUtil::isa<
|
|
386
|
-
|
|
385
|
+
assert(SVFUtil::isa<ObjVar>(node) && "need an object node");
|
|
386
|
+
ObjVar* obj = SVFUtil::cast<ObjVar>(node);
|
|
387
387
|
return getFIObjNode(obj->getMemObj());
|
|
388
388
|
}
|
|
389
389
|
//@}
|
|
@@ -415,7 +415,7 @@ public:
|
|
|
415
415
|
inline bool isNonPointerObj(NodeID id) const
|
|
416
416
|
{
|
|
417
417
|
SVFVar* node = getGNode(id);
|
|
418
|
-
if (
|
|
418
|
+
if (FIObjVar* fiNode = SVFUtil::dyn_cast<FIObjVar>(node))
|
|
419
419
|
{
|
|
420
420
|
return (fiNode->getMemObj()->hasPtrObj() == false);
|
|
421
421
|
}
|
|
@@ -423,7 +423,7 @@ public:
|
|
|
423
423
|
{
|
|
424
424
|
return (gepNode->getMemObj()->isNonPtrFieldObj(gepNode->getLocationSet()));
|
|
425
425
|
}
|
|
426
|
-
else if (SVFUtil::isa<
|
|
426
|
+
else if (SVFUtil::isa<DummyObjVar>(node))
|
|
427
427
|
{
|
|
428
428
|
return false;
|
|
429
429
|
}
|
|
@@ -447,8 +447,8 @@ public:
|
|
|
447
447
|
inline const MemObj* getBaseObj(NodeID id) const
|
|
448
448
|
{
|
|
449
449
|
const SVFVar* node = pag->getGNode(id);
|
|
450
|
-
assert(SVFUtil::isa<
|
|
451
|
-
const
|
|
450
|
+
assert(SVFUtil::isa<ObjVar>(node) && "need an object node");
|
|
451
|
+
const ObjVar* obj = SVFUtil::cast<ObjVar>(node);
|
|
452
452
|
return obj->getMemObj();
|
|
453
453
|
}
|
|
454
454
|
//@}
|
|
@@ -530,7 +530,7 @@ private:
|
|
|
530
530
|
/// Add a value (pointer) node
|
|
531
531
|
inline NodeID addValNode(const Value* val, NodeID i)
|
|
532
532
|
{
|
|
533
|
-
SVFVar *node = new
|
|
533
|
+
SVFVar *node = new ValVar(val,i);
|
|
534
534
|
return addValNode(val, node, i);
|
|
535
535
|
}
|
|
536
536
|
/// Add a memory obj node
|
|
@@ -565,12 +565,12 @@ private:
|
|
|
565
565
|
//@{
|
|
566
566
|
inline NodeID addDummyValNode(NodeID i)
|
|
567
567
|
{
|
|
568
|
-
return addValNode(nullptr, new
|
|
568
|
+
return addValNode(nullptr, new DummyValVar(i), i);
|
|
569
569
|
}
|
|
570
570
|
inline NodeID addDummyObjNode(NodeID i, const Type* type)
|
|
571
571
|
{
|
|
572
572
|
const MemObj* mem = addDummyMemObj(i, type);
|
|
573
|
-
return addObjNode(nullptr, new
|
|
573
|
+
return addObjNode(nullptr, new DummyObjVar(i,mem), i);
|
|
574
574
|
}
|
|
575
575
|
inline const MemObj* addDummyMemObj(NodeID i, const Type* type)
|
|
576
576
|
{
|
|
@@ -578,11 +578,11 @@ private:
|
|
|
578
578
|
}
|
|
579
579
|
inline NodeID addBlackholeObjNode()
|
|
580
580
|
{
|
|
581
|
-
return addObjNode(nullptr, new
|
|
581
|
+
return addObjNode(nullptr, new DummyObjVar(getBlackHoleNode(),getBlackHoleObj()), getBlackHoleNode());
|
|
582
582
|
}
|
|
583
583
|
inline NodeID addConstantObjNode()
|
|
584
584
|
{
|
|
585
|
-
return addObjNode(nullptr, new
|
|
585
|
+
return addObjNode(nullptr, new DummyObjVar(getConstantNode(),getConstantObj()), getConstantNode());
|
|
586
586
|
}
|
|
587
587
|
inline NodeID addBlackholePtrNode()
|
|
588
588
|
{
|
|
@@ -626,33 +626,33 @@ private:
|
|
|
626
626
|
/// Add an edge into SVFIR
|
|
627
627
|
//@{
|
|
628
628
|
/// Add Address edge
|
|
629
|
-
|
|
629
|
+
AddrStmt* addAddrPE(NodeID src, NodeID dst);
|
|
630
630
|
/// Add Copy edge
|
|
631
|
-
|
|
631
|
+
CopyStmt* addCopyPE(NodeID src, NodeID dst);
|
|
632
632
|
/// Add phi node information
|
|
633
|
-
|
|
633
|
+
PhiStmt* addPhiNode(NodeID res, NodeID opnd);
|
|
634
634
|
/// Add Copy edge
|
|
635
|
-
|
|
635
|
+
CmpStmt* addCmpPE(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
|
|
636
636
|
/// Add Copy edge
|
|
637
|
-
|
|
637
|
+
BinaryOPStmt* addBinaryOPPE(NodeID op1, NodeID op2, NodeID dst, u32_t opcode);
|
|
638
638
|
/// Add Unary edge
|
|
639
|
-
|
|
639
|
+
UnaryOPStmt* addUnaryOPPE(NodeID src, NodeID dst, u32_t opcode);
|
|
640
640
|
/// Add BranchStmt
|
|
641
641
|
BranchStmt* addBranchStmt(NodeID br, NodeID cond, std::vector<const ICFGNode*> succs);
|
|
642
642
|
/// Add Load edge
|
|
643
|
-
|
|
643
|
+
LoadStmt* addLoadPE(NodeID src, NodeID dst);
|
|
644
644
|
/// Add Store edge
|
|
645
|
-
|
|
645
|
+
StoreStmt* addStorePE(NodeID src, NodeID dst, const IntraBlockNode* val);
|
|
646
646
|
/// Add Call edge
|
|
647
647
|
CallPE* addCallPE(NodeID src, NodeID dst, const CallBlockNode* cs);
|
|
648
648
|
/// Add Return edge
|
|
649
649
|
RetPE* addRetPE(NodeID src, NodeID dst, const CallBlockNode* cs);
|
|
650
650
|
/// Add Gep edge
|
|
651
|
-
|
|
651
|
+
GepStmt* addGepPE(NodeID src, NodeID dst, const LocationSet& ls, bool constGep);
|
|
652
652
|
/// Add Offset(Gep) edge
|
|
653
|
-
|
|
653
|
+
NormalGepStmt* addNormalGepPE(NodeID src, NodeID dst, const LocationSet& ls);
|
|
654
654
|
/// Add Variant(Gep) edge
|
|
655
|
-
|
|
655
|
+
VariantGepStmt* addVariantGepPE(NodeID src, NodeID dst);
|
|
656
656
|
/// Add Thread fork edge for parameter passing
|
|
657
657
|
TDForkPE* addThreadForkPE(NodeID src, NodeID dst, const CallBlockNode* cs);
|
|
658
658
|
/// Add Thread join edge for parameter passing
|