svf-lib 1.0.742 → 1.0.746
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/DDA/ContextDDA.h +1 -1
- package/SVF-linux/include/DDA/FlowDDA.h +1 -1
- package/SVF-linux/include/Graphs/ConsG.h +8 -8
- package/SVF-linux/include/Graphs/ICFGNode.h +4 -4
- package/SVF-linux/include/Graphs/IRGraph.h +7 -7
- package/SVF-linux/include/Graphs/VFG.h +13 -13
- 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 +11 -11
- package/SVF-linux/include/MSSA/MemSSA.h +11 -11
- package/SVF-linux/include/MemoryModel/PointerAnalysis.h +7 -7
- package/SVF-linux/include/MemoryModel/PointerAnalysisImpl.h +3 -3
- package/SVF-linux/include/MemoryModel/SVFIR.h +80 -81
- package/SVF-linux/include/MemoryModel/SVFStatements.h +72 -71
- package/SVF-linux/include/MemoryModel/SVFVariables.h +54 -54
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +24 -24
- package/SVF-linux/include/Util/IRAnnotator.h +1 -1
- package/SVF-linux/include/Util/TypeBasedHeapCloning.h +2 -2
- 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/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
|
|
@@ -151,7 +151,7 @@ public:
|
|
|
151
151
|
NodeID srcID = addr->getPAGSrcNodeID();
|
|
152
152
|
/// whether this object is set field-insensitive during pre-analysis
|
|
153
153
|
if (isFieldInsensitive(srcID))
|
|
154
|
-
srcID =
|
|
154
|
+
srcID = getFIObjVar(srcID);
|
|
155
155
|
|
|
156
156
|
CxtVar var(dpm.getCond(),srcID);
|
|
157
157
|
addDDAPts(pts,var);
|
|
@@ -93,7 +93,7 @@ public:
|
|
|
93
93
|
NodeID srcID = addr->getPAGSrcNodeID();
|
|
94
94
|
/// whether this object is set field-insensitive during pre-analysis
|
|
95
95
|
if (isFieldInsensitive(srcID))
|
|
96
|
-
srcID =
|
|
96
|
+
srcID = getFIObjVar(srcID);
|
|
97
97
|
|
|
98
98
|
addDDAPts(pts,srcID);
|
|
99
99
|
DBOUT(DDDA, SVFUtil::outs() << "\t add points-to target " << srcID << " to dpm ");
|
|
@@ -67,9 +67,9 @@ protected:
|
|
|
67
67
|
|
|
68
68
|
void destroy();
|
|
69
69
|
|
|
70
|
-
PAGEdge::
|
|
70
|
+
PAGEdge::SVFStmtSetTy& getPAGEdgeSet(PAGEdge::PEDGEK kind)
|
|
71
71
|
{
|
|
72
|
-
return pag->
|
|
72
|
+
return pag->getPTASVFStmtSet(kind);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/// Wappers used internally, not expose to Andernsen Pass
|
|
@@ -314,9 +314,9 @@ public:
|
|
|
314
314
|
{
|
|
315
315
|
return pag->getAllFieldsObjNode(id);
|
|
316
316
|
}
|
|
317
|
-
inline NodeID
|
|
317
|
+
inline NodeID getBaseObjVar(NodeID id)
|
|
318
318
|
{
|
|
319
|
-
return pag->
|
|
319
|
+
return pag->getBaseObjVar(id);
|
|
320
320
|
}
|
|
321
321
|
inline bool isSingleFieldObj(NodeID id) const
|
|
322
322
|
{
|
|
@@ -324,18 +324,18 @@ public:
|
|
|
324
324
|
return (mem->getMaxFieldOffsetLimit() == 1);
|
|
325
325
|
}
|
|
326
326
|
/// Get a field of a memory object
|
|
327
|
-
inline NodeID
|
|
327
|
+
inline NodeID getGepObjVar(NodeID id, const LocationSet& ls)
|
|
328
328
|
{
|
|
329
|
-
NodeID gep = pag->
|
|
329
|
+
NodeID gep = pag->getGepObjVar(id,ls);
|
|
330
330
|
/// Create a node when it is (1) not exist on graph and (2) not merged
|
|
331
331
|
if(sccRepNode(gep)==gep && hasConstraintNode(gep)==false)
|
|
332
332
|
addConstraintNode(new ConstraintNode(gep),gep);
|
|
333
333
|
return gep;
|
|
334
334
|
}
|
|
335
335
|
/// Get a field-insensitive node of a memory object
|
|
336
|
-
inline NodeID
|
|
336
|
+
inline NodeID getFIObjVar(NodeID id)
|
|
337
337
|
{
|
|
338
|
-
NodeID fi = pag->
|
|
338
|
+
NodeID fi = pag->getFIObjVar(id);
|
|
339
339
|
/// Create a node when it is (1) not exist on graph and (2) not merged
|
|
340
340
|
if (sccRepNode(fi) == fi && hasConstraintNode(fi)==false)
|
|
341
341
|
addConstraintNode(new ConstraintNode(fi),fi);
|
|
@@ -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
|
|
|
@@ -67,7 +67,7 @@ public:
|
|
|
67
67
|
typedef Set<const CallPE *> CallPESet;
|
|
68
68
|
typedef Set<const RetPE *> RetPESet;
|
|
69
69
|
typedef std::list<const VFGNode*> VFGNodeList;
|
|
70
|
-
typedef std::list<const SVFStmt*>
|
|
70
|
+
typedef std::list<const SVFStmt*> SVFStmtList;
|
|
71
71
|
|
|
72
72
|
public:
|
|
73
73
|
/// Constructor
|
|
@@ -118,7 +118,7 @@ public:
|
|
|
118
118
|
pagEdges.push_back(edge);
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
inline const
|
|
121
|
+
inline const SVFStmtList& getPAGEdges() const
|
|
122
122
|
{
|
|
123
123
|
return pagEdges;
|
|
124
124
|
}
|
|
@@ -132,7 +132,7 @@ protected:
|
|
|
132
132
|
const SVFFunction* fun;
|
|
133
133
|
const BasicBlock* bb;
|
|
134
134
|
VFGNodeList VFGNodes; //< a list of VFGNodes
|
|
135
|
-
|
|
135
|
+
SVFStmtList pagEdges; //< a list of PAGEdges
|
|
136
136
|
|
|
137
137
|
};
|
|
138
138
|
|
|
@@ -48,12 +48,12 @@ typedef SVFStmt PAGEdge;
|
|
|
48
48
|
class IRGraph : public GenericGraph<SVFVar,SVFStmt>
|
|
49
49
|
{
|
|
50
50
|
public:
|
|
51
|
-
typedef Set<const SVFStmt*>
|
|
52
|
-
typedef Map<const Value*,
|
|
51
|
+
typedef Set<const SVFStmt*> SVFStmtSet;
|
|
52
|
+
typedef Map<const Value*,SVFStmtSet> ValueToEdgeMap;
|
|
53
53
|
|
|
54
54
|
protected:
|
|
55
|
-
SVFStmt::
|
|
56
|
-
SVFStmt::
|
|
55
|
+
SVFStmt::KindToSVFStmtMapTy KindToSVFStmtSetMap; // < SVFIR edge map containing all PAGEdges
|
|
56
|
+
SVFStmt::KindToSVFStmtMapTy KindToPTASVFStmtSetMap; // < SVFIR edge map containing only pointer-related edges, i.e, both RHS and RHS are of pointer type
|
|
57
57
|
bool fromFile; ///< Whether the SVFIR is built according to user specified data from a txt file
|
|
58
58
|
NodeID nodeNumAfterPAGBuild; // initial node number after building SVFIR, excluding later added nodes, e.g., gepobj nodes
|
|
59
59
|
u32_t totalPTAPAGEdge;
|
|
@@ -80,7 +80,7 @@ protected:
|
|
|
80
80
|
/// Map a value to a set of edges
|
|
81
81
|
inline void mapValueToEdge(const Value *V, SVFStmt *edge)
|
|
82
82
|
{
|
|
83
|
-
auto inserted = valueToEdgeMap.emplace(V,
|
|
83
|
+
auto inserted = valueToEdgeMap.emplace(V, SVFStmtSet{edge});
|
|
84
84
|
if (!inserted.second) {
|
|
85
85
|
inserted.first->second.emplace(edge);
|
|
86
86
|
}
|
|
@@ -94,7 +94,7 @@ public:
|
|
|
94
94
|
IRGraph(bool buildFromFile): fromFile(buildFromFile), nodeNumAfterPAGBuild(0), totalPTAPAGEdge(0){
|
|
95
95
|
symInfo = SymbolTableInfo::SymbolInfo();
|
|
96
96
|
// insert dummy value if a correct value cannot be found
|
|
97
|
-
valueToEdgeMap[nullptr] =
|
|
97
|
+
valueToEdgeMap[nullptr] = SVFStmtSet();
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
virtual ~IRGraph();
|
|
@@ -105,7 +105,7 @@ public:
|
|
|
105
105
|
return fromFile;
|
|
106
106
|
}
|
|
107
107
|
/// Get all SVFIR Edges that corresponds to an LLVM value
|
|
108
|
-
inline const
|
|
108
|
+
inline const SVFStmtSet& getValueEdges(const Value *V)
|
|
109
109
|
{
|
|
110
110
|
auto it = valueToEdgeMap.find(V);
|
|
111
111
|
if (it == valueToEdgeMap.end()) {
|
|
@@ -79,7 +79,7 @@ public:
|
|
|
79
79
|
typedef VFGEdge::VFGEdgeSetTy::iterator VFGNodeIter;
|
|
80
80
|
typedef VFGNodeIDToNodeMapTy::iterator iterator;
|
|
81
81
|
typedef VFGNodeIDToNodeMapTy::const_iterator const_iterator;
|
|
82
|
-
typedef SVFIR::
|
|
82
|
+
typedef SVFIR::SVFStmtSet SVFStmtSet;
|
|
83
83
|
typedef Set<const VFGNode*> GlobalVFGNodeSet;
|
|
84
84
|
typedef Set<const PAGNode*> PAGNodeSet;
|
|
85
85
|
|
|
@@ -427,12 +427,12 @@ protected:
|
|
|
427
427
|
void addVFGNodes();
|
|
428
428
|
|
|
429
429
|
/// Get PAGEdge set
|
|
430
|
-
virtual inline PAGEdge::
|
|
430
|
+
virtual inline PAGEdge::SVFStmtSetTy& getPAGEdgeSet(PAGEdge::PEDGEK kind)
|
|
431
431
|
{
|
|
432
432
|
if (isPtrOnlySVFG())
|
|
433
|
-
return pag->
|
|
433
|
+
return pag->getPTASVFStmtSet(kind);
|
|
434
434
|
else
|
|
435
|
-
return pag->
|
|
435
|
+
return pag->getSVFStmtSet(kind);
|
|
436
436
|
}
|
|
437
437
|
|
|
438
438
|
virtual inline bool isInterestedPAGNode(const PAGNode* node) const
|
|
@@ -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
|
|
|
@@ -169,7 +169,7 @@ public:
|
|
|
169
169
|
typedef Map<NodeID, NodeBS> NodeToPTSSMap;
|
|
170
170
|
|
|
171
171
|
/// SVFIR edge list
|
|
172
|
-
typedef SVFIR::
|
|
172
|
+
typedef SVFIR::SVFStmtList SVFStmtList;
|
|
173
173
|
/// Call Graph SCC
|
|
174
174
|
typedef SCCDetection<PTACallGraph*> SCC;
|
|
175
175
|
|
|
@@ -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
|
}
|
|
@@ -466,9 +466,9 @@ public:
|
|
|
466
466
|
}
|
|
467
467
|
//@}
|
|
468
468
|
/// Whether this instruction has SVFIR Edge
|
|
469
|
-
bool
|
|
469
|
+
bool hasSVFStmtList(const Instruction* inst);
|
|
470
470
|
/// Given an instruction, get all its the PAGEdge (statement) in sequence
|
|
471
|
-
|
|
471
|
+
SVFStmtList& getPAGEdgesFromInst(const Instruction* inst);
|
|
472
472
|
|
|
473
473
|
/// getModRefInfo APIs
|
|
474
474
|
//@{
|
|
@@ -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;
|
|
@@ -94,7 +94,7 @@ public:
|
|
|
94
94
|
typedef Map<const MemRegion*, MRVERSION> MemRegToCounterMap;
|
|
95
95
|
|
|
96
96
|
/// SVFIR edge list
|
|
97
|
-
typedef SVFIR::
|
|
97
|
+
typedef SVFIR::SVFStmtList SVFStmtList;
|
|
98
98
|
|
|
99
99
|
/// Statistics
|
|
100
100
|
//@{
|
|
@@ -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
|
}
|
|
@@ -344,19 +344,19 @@ public:
|
|
|
344
344
|
///@{
|
|
345
345
|
inline bool isFIObjNode(NodeID id) const
|
|
346
346
|
{
|
|
347
|
-
return (SVFUtil::isa<
|
|
347
|
+
return (SVFUtil::isa<FIObjVar>(pag->getGNode(id)));
|
|
348
348
|
}
|
|
349
|
-
inline NodeID
|
|
349
|
+
inline NodeID getBaseObjVar(NodeID id)
|
|
350
350
|
{
|
|
351
|
-
return pag->
|
|
351
|
+
return pag->getBaseObjVar(id);
|
|
352
352
|
}
|
|
353
|
-
inline NodeID
|
|
353
|
+
inline NodeID getFIObjVar(NodeID id)
|
|
354
354
|
{
|
|
355
|
-
return pag->
|
|
355
|
+
return pag->getFIObjVar(id);
|
|
356
356
|
}
|
|
357
|
-
inline NodeID
|
|
357
|
+
inline NodeID getGepObjVar(NodeID id, const LocationSet& ls)
|
|
358
358
|
{
|
|
359
|
-
return pag->
|
|
359
|
+
return pag->getGepObjVar(id,ls);
|
|
360
360
|
}
|
|
361
361
|
virtual inline const NodeBS& getAllFieldsObjNode(NodeID id)
|
|
362
362
|
{
|
|
@@ -352,7 +352,7 @@ public:
|
|
|
352
352
|
expandedCpts = cpts;;
|
|
353
353
|
for(typename CPtSet::const_iterator cit = cpts.begin(), ecit=cpts.end(); cit!=ecit; ++cit)
|
|
354
354
|
{
|
|
355
|
-
if(pag->
|
|
355
|
+
if(pag->getBaseObjVar(cit->get_id())==cit->get_id())
|
|
356
356
|
{
|
|
357
357
|
NodeBS& fields = pag->getAllFieldsObjNode(cit->get_id());
|
|
358
358
|
for(NodeBS::iterator it = fields.begin(), eit = fields.end(); it!=eit; ++it)
|
|
@@ -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());
|