svf-lib 1.0.1277 → 1.0.1279
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/DDAVFSolver.h +1 -2
- package/SVF-linux/include/Graphs/ICFG.h +16 -16
- package/SVF-linux/include/Graphs/ICFGEdge.h +6 -6
- package/SVF-linux/include/Graphs/ICFGNode.h +16 -16
- package/SVF-linux/include/Graphs/IRGraph.h +6 -6
- package/SVF-linux/include/Graphs/ThreadCallGraph.h +2 -2
- package/SVF-linux/include/Graphs/VFGNode.h +1 -1
- package/SVF-linux/include/MSSA/MSSAMuChi.h +11 -11
- package/SVF-linux/include/MSSA/MemRegion.h +2 -2
- package/SVF-linux/include/MSSA/MemSSA.h +13 -13
- package/SVF-linux/include/MTA/FSMPTA.h +1 -1
- package/SVF-linux/include/MTA/LockAnalysis.h +33 -33
- package/SVF-linux/include/MTA/LockResultValidator.h +7 -6
- package/SVF-linux/include/MTA/MHP.h +46 -46
- package/SVF-linux/include/MTA/MTA.h +4 -4
- package/SVF-linux/include/MTA/MTAAnnotator.h +6 -4
- package/SVF-linux/include/MTA/MTAResultValidator.h +51 -44
- package/SVF-linux/include/MTA/PCG.h +22 -27
- package/SVF-linux/include/MTA/TCT.h +28 -37
- package/SVF-linux/include/MemoryModel/SVFStatements.h +11 -6
- package/SVF-linux/include/MemoryModel/SVFVariables.h +4 -4
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +13 -19
- package/SVF-linux/include/SABER/ProgSlice.h +5 -5
- package/SVF-linux/include/SABER/SaberCheckerAPI.h +4 -4
- package/SVF-linux/include/SABER/SaberCondAllocator.h +32 -35
- package/SVF-linux/include/SVF-FE/BasicTypes.h +10 -0
- package/SVF-linux/include/SVF-FE/CPPUtil.h +9 -8
- package/SVF-linux/include/SVF-FE/DCHG.h +4 -4
- package/SVF-linux/include/SVF-FE/DataFlowUtil.h +1 -1
- package/SVF-linux/include/SVF-FE/GEPTypeBridgeIterator.h +1 -1
- package/SVF-linux/include/SVF-FE/ICFGBuilder.h +9 -9
- package/SVF-linux/include/SVF-FE/IRAnnotator.h +9 -9
- package/SVF-linux/include/SVF-FE/LLVMModule.h +119 -22
- package/SVF-linux/include/SVF-FE/LLVMUtil.h +31 -52
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +14 -20
- package/SVF-linux/include/SVF-FE/SymbolTableBuilder.h +8 -8
- package/SVF-linux/include/Util/Annotator.h +22 -22
- package/SVF-linux/include/Util/BasicTypes.h +476 -72
- package/SVF-linux/include/Util/Casting.h +1 -1
- package/SVF-linux/include/Util/CxtStmt.h +13 -12
- package/SVF-linux/include/Util/SVFBasicTypes.h +0 -78
- package/SVF-linux/include/Util/SVFInstruction.h +40 -0
- package/SVF-linux/include/Util/SVFModule.h +58 -124
- package/SVF-linux/include/Util/SVFUtil.h +48 -39
- package/SVF-linux/include/Util/ThreadAPI.h +17 -28
- package/SVF-linux/include/WPA/WPAPass.h +4 -4
- package/SVF-osx/Release-build/lib/libSvf.a +0 -0
- package/SVF-osx/include/DDA/DDAVFSolver.h +1 -2
- package/SVF-osx/include/Graphs/ICFG.h +16 -16
- package/SVF-osx/include/Graphs/ICFGEdge.h +6 -6
- package/SVF-osx/include/Graphs/ICFGNode.h +16 -16
- package/SVF-osx/include/Graphs/IRGraph.h +6 -6
- package/SVF-osx/include/Graphs/ThreadCallGraph.h +2 -2
- package/SVF-osx/include/Graphs/VFGNode.h +1 -1
- package/SVF-osx/include/MSSA/MSSAMuChi.h +11 -11
- package/SVF-osx/include/MSSA/MemRegion.h +2 -2
- package/SVF-osx/include/MSSA/MemSSA.h +13 -13
- package/SVF-osx/include/MTA/FSMPTA.h +1 -1
- package/SVF-osx/include/MTA/LockAnalysis.h +33 -33
- package/SVF-osx/include/MTA/LockResultValidator.h +7 -6
- package/SVF-osx/include/MTA/MHP.h +46 -46
- package/SVF-osx/include/MTA/MTA.h +4 -4
- package/SVF-osx/include/MTA/MTAAnnotator.h +6 -4
- package/SVF-osx/include/MTA/MTAResultValidator.h +51 -44
- package/SVF-osx/include/MTA/PCG.h +22 -27
- package/SVF-osx/include/MTA/TCT.h +28 -37
- package/SVF-osx/include/MemoryModel/SVFStatements.h +11 -6
- package/SVF-osx/include/MemoryModel/SVFVariables.h +4 -4
- package/SVF-osx/include/MemoryModel/SymbolTableInfo.h +13 -19
- package/SVF-osx/include/SABER/ProgSlice.h +5 -5
- package/SVF-osx/include/SABER/SaberCheckerAPI.h +4 -4
- package/SVF-osx/include/SABER/SaberCondAllocator.h +32 -35
- package/SVF-osx/include/SVF-FE/BasicTypes.h +10 -0
- package/SVF-osx/include/SVF-FE/CPPUtil.h +9 -8
- package/SVF-osx/include/SVF-FE/DCHG.h +4 -4
- package/SVF-osx/include/SVF-FE/DataFlowUtil.h +1 -1
- package/SVF-osx/include/SVF-FE/GEPTypeBridgeIterator.h +1 -1
- package/SVF-osx/include/SVF-FE/ICFGBuilder.h +9 -9
- package/SVF-osx/include/SVF-FE/IRAnnotator.h +9 -9
- package/SVF-osx/include/SVF-FE/LLVMModule.h +119 -22
- package/SVF-osx/include/SVF-FE/LLVMUtil.h +31 -52
- package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +14 -20
- package/SVF-osx/include/SVF-FE/SymbolTableBuilder.h +8 -8
- package/SVF-osx/include/Util/Annotator.h +22 -22
- package/SVF-osx/include/Util/BasicTypes.h +476 -72
- package/SVF-osx/include/Util/Casting.h +1 -1
- package/SVF-osx/include/Util/CxtStmt.h +13 -12
- package/SVF-osx/include/Util/SVFBasicTypes.h +0 -78
- package/SVF-osx/include/Util/SVFInstruction.h +40 -0
- package/SVF-osx/include/Util/SVFModule.h +58 -124
- package/SVF-osx/include/Util/SVFUtil.h +48 -39
- package/SVF-osx/include/Util/ThreadAPI.h +17 -28
- package/SVF-osx/include/WPA/WPAPass.h +4 -4
- package/package.json +1 -1
|
Binary file
|
|
@@ -470,9 +470,8 @@ protected:
|
|
|
470
470
|
assert(obj && "object not found!!");
|
|
471
471
|
if(obj->isStack())
|
|
472
472
|
{
|
|
473
|
-
if(const
|
|
473
|
+
if(const SVFFunction* svffun = _pag->getGNode(id)->getFunction())
|
|
474
474
|
{
|
|
475
|
-
const SVFFunction* svffun = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(fun);
|
|
476
475
|
return _callGraphSCC->isInCycle(_callGraph->getCallGraphNode(svffun)->getId());
|
|
477
476
|
}
|
|
478
477
|
}
|
|
@@ -58,9 +58,9 @@ public:
|
|
|
58
58
|
|
|
59
59
|
typedef Map<const SVFFunction*, FunEntryICFGNode *> FunToFunEntryNodeMapTy;
|
|
60
60
|
typedef Map<const SVFFunction*, FunExitICFGNode *> FunToFunExitNodeMapTy;
|
|
61
|
-
typedef Map<const
|
|
62
|
-
typedef Map<const
|
|
63
|
-
typedef Map<const
|
|
61
|
+
typedef Map<const SVFInstruction*, CallICFGNode *> CSToCallNodeMapTy;
|
|
62
|
+
typedef Map<const SVFInstruction*, RetICFGNode *> CSToRetNodeMapTy;
|
|
63
|
+
typedef Map<const SVFInstruction*, IntraICFGNode *> InstToBlockNodeMapTy;
|
|
64
64
|
typedef std::vector<const SVFLoop *> SVFLoopVec;
|
|
65
65
|
typedef Map<const ICFGNode *, SVFLoopVec> ICFGNodeToSVFLoopVec;
|
|
66
66
|
|
|
@@ -122,7 +122,7 @@ public:
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
/// Whether node is in a loop
|
|
125
|
-
inline bool isInLoop(const
|
|
125
|
+
inline bool isInLoop(const SVFInstruction* inst)
|
|
126
126
|
{
|
|
127
127
|
return isInLoop(getICFGNode(inst));
|
|
128
128
|
}
|
|
@@ -159,8 +159,8 @@ protected:
|
|
|
159
159
|
//@{
|
|
160
160
|
ICFGEdge* addIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode);
|
|
161
161
|
ICFGEdge* addConditionalIntraEdge(ICFGNode* srcNode, ICFGNode* dstNode, const Value* condition, s32_t branchCondVal);
|
|
162
|
-
ICFGEdge* addCallEdge(ICFGNode* srcNode, ICFGNode* dstNode, const
|
|
163
|
-
ICFGEdge* addRetEdge(ICFGNode* srcNode, ICFGNode* dstNode, const
|
|
162
|
+
ICFGEdge* addCallEdge(ICFGNode* srcNode, ICFGNode* dstNode, const SVFInstruction* cs);
|
|
163
|
+
ICFGEdge* addRetEdge(ICFGNode* srcNode, ICFGNode* dstNode, const SVFInstruction* cs);
|
|
164
164
|
//@}
|
|
165
165
|
|
|
166
166
|
/// sanitize Intra edges, verify that both nodes belong to the same function.
|
|
@@ -194,13 +194,13 @@ public:
|
|
|
194
194
|
/// Get a basic block ICFGNode
|
|
195
195
|
/// TODO:: need to fix the assertions
|
|
196
196
|
//@{
|
|
197
|
-
ICFGNode* getICFGNode(const
|
|
197
|
+
ICFGNode* getICFGNode(const SVFInstruction* inst);
|
|
198
198
|
|
|
199
|
-
CallICFGNode* getCallICFGNode(const
|
|
199
|
+
CallICFGNode* getCallICFGNode(const SVFInstruction* inst);
|
|
200
200
|
|
|
201
|
-
RetICFGNode* getRetICFGNode(const
|
|
201
|
+
RetICFGNode* getRetICFGNode(const SVFInstruction* inst);
|
|
202
202
|
|
|
203
|
-
IntraICFGNode* getIntraICFGNode(const
|
|
203
|
+
IntraICFGNode* getIntraICFGNode(const SVFInstruction* inst);
|
|
204
204
|
|
|
205
205
|
FunEntryICFGNode* getFunEntryICFGNode(const SVFFunction* fun);
|
|
206
206
|
|
|
@@ -220,14 +220,14 @@ public:
|
|
|
220
220
|
private:
|
|
221
221
|
|
|
222
222
|
/// Get/Add IntraBlock ICFGNode
|
|
223
|
-
inline IntraICFGNode* getIntraBlock(const
|
|
223
|
+
inline IntraICFGNode* getIntraBlock(const SVFInstruction* inst)
|
|
224
224
|
{
|
|
225
225
|
InstToBlockNodeMapTy::const_iterator it = InstToBlockNodeMap.find(inst);
|
|
226
226
|
if (it == InstToBlockNodeMap.end())
|
|
227
227
|
return nullptr;
|
|
228
228
|
return it->second;
|
|
229
229
|
}
|
|
230
|
-
inline IntraICFGNode* addIntraBlock(const
|
|
230
|
+
inline IntraICFGNode* addIntraBlock(const SVFInstruction* inst)
|
|
231
231
|
{
|
|
232
232
|
IntraICFGNode* sNode = new IntraICFGNode(totalICFGNode++,inst);
|
|
233
233
|
addICFGNode(sNode);
|
|
@@ -268,14 +268,14 @@ private:
|
|
|
268
268
|
}
|
|
269
269
|
|
|
270
270
|
/// Get/Add a call node
|
|
271
|
-
inline CallICFGNode* addCallBlock(const
|
|
271
|
+
inline CallICFGNode* addCallBlock(const SVFInstruction* cs)
|
|
272
272
|
{
|
|
273
273
|
CallICFGNode* sNode = new CallICFGNode(totalICFGNode++, cs);
|
|
274
274
|
addICFGNode(sNode);
|
|
275
275
|
CSToCallNodeMap[cs] = sNode;
|
|
276
276
|
return sNode;
|
|
277
277
|
}
|
|
278
|
-
inline CallICFGNode* getCallBlock(const
|
|
278
|
+
inline CallICFGNode* getCallBlock(const SVFInstruction* cs)
|
|
279
279
|
{
|
|
280
280
|
CSToCallNodeMapTy::const_iterator it = CSToCallNodeMap.find(cs);
|
|
281
281
|
if (it == CSToCallNodeMap.end())
|
|
@@ -284,14 +284,14 @@ private:
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
/// Get/Add a return node
|
|
287
|
-
inline RetICFGNode* getRetBlock(const
|
|
287
|
+
inline RetICFGNode* getRetBlock(const SVFInstruction* cs)
|
|
288
288
|
{
|
|
289
289
|
CSToRetNodeMapTy::const_iterator it = CSToRetNodeMap.find(cs);
|
|
290
290
|
if (it == CSToRetNodeMap.end())
|
|
291
291
|
return nullptr;
|
|
292
292
|
return it->second;
|
|
293
293
|
}
|
|
294
|
-
inline RetICFGNode* addRetBlock(const
|
|
294
|
+
inline RetICFGNode* addRetBlock(const SVFInstruction* cs)
|
|
295
295
|
{
|
|
296
296
|
CallICFGNode* callBlockNode = getCallICFGNode(cs);
|
|
297
297
|
RetICFGNode* sNode = new RetICFGNode(totalICFGNode++, cs, callBlockNode);
|
|
@@ -169,16 +169,16 @@ class CallCFGEdge : public ICFGEdge
|
|
|
169
169
|
{
|
|
170
170
|
|
|
171
171
|
private:
|
|
172
|
-
const
|
|
172
|
+
const SVFInstruction* cs;
|
|
173
173
|
std::vector<const CallPE*> callPEs;
|
|
174
174
|
public:
|
|
175
175
|
/// Constructor
|
|
176
|
-
CallCFGEdge(ICFGNode* s, ICFGNode* d, const
|
|
176
|
+
CallCFGEdge(ICFGNode* s, ICFGNode* d, const SVFInstruction* c):
|
|
177
177
|
ICFGEdge(s,d,CallCF),cs(c)
|
|
178
178
|
{
|
|
179
179
|
}
|
|
180
180
|
/// Return callsite ID
|
|
181
|
-
inline const
|
|
181
|
+
inline const SVFInstruction* getCallSite() const
|
|
182
182
|
{
|
|
183
183
|
return cs;
|
|
184
184
|
}
|
|
@@ -217,16 +217,16 @@ class RetCFGEdge : public ICFGEdge
|
|
|
217
217
|
{
|
|
218
218
|
|
|
219
219
|
private:
|
|
220
|
-
const
|
|
220
|
+
const SVFInstruction* cs;
|
|
221
221
|
const RetPE* retPE;
|
|
222
222
|
public:
|
|
223
223
|
/// Constructor
|
|
224
|
-
RetCFGEdge(ICFGNode* s, ICFGNode* d, const
|
|
224
|
+
RetCFGEdge(ICFGNode* s, ICFGNode* d, const SVFInstruction* c):
|
|
225
225
|
ICFGEdge(s,d,RetCF),cs(c),retPE(nullptr)
|
|
226
226
|
{
|
|
227
227
|
}
|
|
228
228
|
/// Return callsite ID
|
|
229
|
-
inline const
|
|
229
|
+
inline const SVFInstruction* getCallSite() const
|
|
230
230
|
{
|
|
231
231
|
return cs;
|
|
232
232
|
}
|
|
@@ -83,7 +83,7 @@ public:
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/// Return the function of this ICFGNode
|
|
86
|
-
virtual const
|
|
86
|
+
virtual const SVFBasicBlock* getBB() const
|
|
87
87
|
{
|
|
88
88
|
return bb;
|
|
89
89
|
}
|
|
@@ -130,7 +130,7 @@ public:
|
|
|
130
130
|
|
|
131
131
|
protected:
|
|
132
132
|
const SVFFunction* fun;
|
|
133
|
-
const
|
|
133
|
+
const SVFBasicBlock* bb;
|
|
134
134
|
VFGNodeList VFGNodes; //< a list of VFGNodes
|
|
135
135
|
SVFStmtList pagEdges; //< a list of PAGEdges
|
|
136
136
|
|
|
@@ -175,16 +175,16 @@ public:
|
|
|
175
175
|
class IntraICFGNode : public ICFGNode
|
|
176
176
|
{
|
|
177
177
|
private:
|
|
178
|
-
const
|
|
178
|
+
const SVFInstruction *inst;
|
|
179
179
|
|
|
180
180
|
public:
|
|
181
|
-
IntraICFGNode(NodeID id, const
|
|
181
|
+
IntraICFGNode(NodeID id, const SVFInstruction *i) : ICFGNode(id, IntraBlock), inst(i)
|
|
182
182
|
{
|
|
183
|
-
fun =
|
|
183
|
+
fun = inst->getFunction();
|
|
184
184
|
bb = inst->getParent();
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
inline const
|
|
187
|
+
inline const SVFInstruction *getInst() const
|
|
188
188
|
{
|
|
189
189
|
return inst;
|
|
190
190
|
}
|
|
@@ -366,18 +366,18 @@ class CallICFGNode : public InterICFGNode
|
|
|
366
366
|
public:
|
|
367
367
|
typedef std::vector<const SVFVar *> ActualParmNodeVec;
|
|
368
368
|
private:
|
|
369
|
-
const
|
|
369
|
+
const SVFInstruction* cs;
|
|
370
370
|
const RetICFGNode* ret;
|
|
371
371
|
ActualParmNodeVec APNodes;
|
|
372
372
|
public:
|
|
373
|
-
CallICFGNode(NodeID id, const
|
|
373
|
+
CallICFGNode(NodeID id, const SVFInstruction* c) : InterICFGNode(id, FunCallBlock), cs(c), ret(nullptr)
|
|
374
374
|
{
|
|
375
|
-
fun =
|
|
375
|
+
fun = cs->getFunction();
|
|
376
376
|
bb = cs->getParent();
|
|
377
377
|
}
|
|
378
378
|
|
|
379
379
|
/// Return callsite
|
|
380
|
-
inline const
|
|
380
|
+
inline const SVFInstruction* getCallSite() const
|
|
381
381
|
{
|
|
382
382
|
return cs;
|
|
383
383
|
}
|
|
@@ -398,11 +398,11 @@ public:
|
|
|
398
398
|
/// Return callsite
|
|
399
399
|
inline const SVFFunction* getCaller() const
|
|
400
400
|
{
|
|
401
|
-
return
|
|
401
|
+
return cs->getFunction();
|
|
402
402
|
}
|
|
403
403
|
|
|
404
404
|
/// Return Basic Block
|
|
405
|
-
inline const
|
|
405
|
+
inline const SVFBasicBlock* getParent() const
|
|
406
406
|
{
|
|
407
407
|
return cs->getParent();
|
|
408
408
|
}
|
|
@@ -459,19 +459,19 @@ class RetICFGNode : public InterICFGNode
|
|
|
459
459
|
{
|
|
460
460
|
|
|
461
461
|
private:
|
|
462
|
-
const
|
|
462
|
+
const SVFInstruction* cs;
|
|
463
463
|
const SVFVar *actualRet;
|
|
464
464
|
const CallICFGNode* callBlockNode;
|
|
465
465
|
public:
|
|
466
|
-
RetICFGNode(NodeID id, const
|
|
466
|
+
RetICFGNode(NodeID id, const SVFInstruction* c, CallICFGNode* cb) :
|
|
467
467
|
InterICFGNode(id, FunRetBlock), cs(c), actualRet(nullptr), callBlockNode(cb)
|
|
468
468
|
{
|
|
469
|
-
fun =
|
|
469
|
+
fun = cs->getFunction();
|
|
470
470
|
bb = cs->getParent();
|
|
471
471
|
}
|
|
472
472
|
|
|
473
473
|
/// Return callsite
|
|
474
|
-
inline const
|
|
474
|
+
inline const SVFInstruction* getCallSite() const
|
|
475
475
|
{
|
|
476
476
|
return cs;
|
|
477
477
|
}
|
|
@@ -78,7 +78,7 @@ protected:
|
|
|
78
78
|
SVFStmt* hasLabeledEdge(SVFVar* src, SVFVar* op1, SVFStmt::PEDGEK kind, const SVFVar* op2);
|
|
79
79
|
|
|
80
80
|
/// Map a value to a set of edges
|
|
81
|
-
inline void mapValueToEdge(const Value
|
|
81
|
+
inline void mapValueToEdge(const Value* V, SVFStmt *edge)
|
|
82
82
|
{
|
|
83
83
|
auto inserted = valueToEdgeMap.emplace(V, SVFStmtSet{edge});
|
|
84
84
|
if (!inserted.second)
|
|
@@ -108,7 +108,7 @@ public:
|
|
|
108
108
|
return fromFile;
|
|
109
109
|
}
|
|
110
110
|
/// Get all SVFIR Edges that corresponds to an LLVM value
|
|
111
|
-
inline const SVFStmtSet& getValueEdges(const Value
|
|
111
|
+
inline const SVFStmtSet& getValueEdges(const Value* V)
|
|
112
112
|
{
|
|
113
113
|
auto it = valueToEdgeMap.find(V);
|
|
114
114
|
if (it == valueToEdgeMap.end())
|
|
@@ -121,7 +121,7 @@ public:
|
|
|
121
121
|
|
|
122
122
|
/// Get SVFIR Node according to LLVM value
|
|
123
123
|
///getNode - Return the node corresponding to the specified pointer.
|
|
124
|
-
inline NodeID getValueNode(const Value
|
|
124
|
+
inline NodeID getValueNode(const Value* V)
|
|
125
125
|
{
|
|
126
126
|
return symInfo->getValSym(V);
|
|
127
127
|
}
|
|
@@ -131,19 +131,19 @@ public:
|
|
|
131
131
|
}
|
|
132
132
|
/// getObject - Return the obj node id refer to the memory object for the
|
|
133
133
|
/// specified global, heap or alloca instruction according to llvm value.
|
|
134
|
-
inline NodeID getObjectNode(const Value
|
|
134
|
+
inline NodeID getObjectNode(const Value* V)
|
|
135
135
|
{
|
|
136
136
|
return symInfo->getObjSym(V);
|
|
137
137
|
}
|
|
138
138
|
/// GetReturnNode - Return the unique node representing the return value of a function
|
|
139
139
|
inline NodeID getReturnNode(const SVFFunction* func) const
|
|
140
140
|
{
|
|
141
|
-
return symInfo->getRetSym(func
|
|
141
|
+
return symInfo->getRetSym(func);
|
|
142
142
|
}
|
|
143
143
|
/// getVarargNode - Return the unique node representing the variadic argument of a variadic function.
|
|
144
144
|
inline NodeID getVarargNode(const SVFFunction* func) const
|
|
145
145
|
{
|
|
146
|
-
return symInfo->getVarargSym(func
|
|
146
|
+
return symInfo->getVarargSym(func);
|
|
147
147
|
}
|
|
148
148
|
inline NodeID getBlackHoleNode() const
|
|
149
149
|
{
|
|
@@ -163,8 +163,8 @@ class ThreadCallGraph: public PTACallGraph
|
|
|
163
163
|
public:
|
|
164
164
|
typedef Set<const CallICFGNode*> InstSet;
|
|
165
165
|
typedef InstSet CallSiteSet;
|
|
166
|
-
typedef std::vector<const
|
|
167
|
-
typedef Map<const
|
|
166
|
+
typedef std::vector<const SVFInstruction*> InstVector;
|
|
167
|
+
typedef Map<const SVFInstruction*, InstSet> CallToInstMap;
|
|
168
168
|
typedef Set<CallSiteSet*> CtxSet;
|
|
169
169
|
typedef ThreadForkEdge::ForkEdgeSet ForkEdgeSet;
|
|
170
170
|
typedef Map<const CallICFGNode*, ForkEdgeSet> CallInstToForkEdgesMap;
|
|
@@ -182,7 +182,7 @@ public:
|
|
|
182
182
|
|| node->getNodeKind() == Load;
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
inline const
|
|
185
|
+
inline const SVFInstruction* getInst() const
|
|
186
186
|
{
|
|
187
187
|
/// should return a valid instruction unless it is a global PAGEdge
|
|
188
188
|
return pagEdge->getInst();
|
|
@@ -167,12 +167,12 @@ class LoadMU : public MSSAMU<Cond>
|
|
|
167
167
|
|
|
168
168
|
private:
|
|
169
169
|
const LoadStmt* inst;
|
|
170
|
-
const
|
|
170
|
+
const SVFBasicBlock* bb;
|
|
171
171
|
|
|
172
172
|
public:
|
|
173
173
|
/// Constructor/Destructor for MU
|
|
174
174
|
//@{
|
|
175
|
-
LoadMU(const
|
|
175
|
+
LoadMU(const SVFBasicBlock* 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
|
}
|
|
@@ -189,7 +189,7 @@ public:
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
/// Return basic block
|
|
192
|
-
inline const
|
|
192
|
+
inline const SVFBasicBlock* getBasicBlock() const
|
|
193
193
|
{
|
|
194
194
|
return bb;
|
|
195
195
|
}
|
|
@@ -244,7 +244,7 @@ public:
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
/// Return basic block
|
|
247
|
-
inline const
|
|
247
|
+
inline const SVFBasicBlock* getBasicBlock() const
|
|
248
248
|
{
|
|
249
249
|
return callsite->getCallSite()->getParent();
|
|
250
250
|
}
|
|
@@ -461,12 +461,12 @@ template<class Cond>
|
|
|
461
461
|
class StoreCHI : public MSSACHI<Cond>
|
|
462
462
|
{
|
|
463
463
|
private:
|
|
464
|
-
const
|
|
464
|
+
const SVFBasicBlock* bb;
|
|
465
465
|
const StoreStmt* inst;
|
|
466
466
|
public:
|
|
467
467
|
/// Constructors for StoreCHI
|
|
468
468
|
//@{
|
|
469
|
-
StoreCHI(const
|
|
469
|
+
StoreCHI(const SVFBasicBlock* 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
|
}
|
|
@@ -476,7 +476,7 @@ public:
|
|
|
476
476
|
//@}
|
|
477
477
|
|
|
478
478
|
/// Get basic block
|
|
479
|
-
inline const
|
|
479
|
+
inline const SVFBasicBlock* getBasicBlock() const
|
|
480
480
|
{
|
|
481
481
|
return bb;
|
|
482
482
|
}
|
|
@@ -535,7 +535,7 @@ public:
|
|
|
535
535
|
//@}
|
|
536
536
|
|
|
537
537
|
/// Return basic block
|
|
538
|
-
inline const
|
|
538
|
+
inline const SVFBasicBlock* getBasicBlock() const
|
|
539
539
|
{
|
|
540
540
|
return callsite->getCallSite()->getParent();
|
|
541
541
|
}
|
|
@@ -632,13 +632,13 @@ class MSSAPHI : public MSSADEF
|
|
|
632
632
|
public:
|
|
633
633
|
typedef Map<u32_t,const MRVer*> OPVers;
|
|
634
634
|
private:
|
|
635
|
-
const
|
|
635
|
+
const SVFBasicBlock* bb;
|
|
636
636
|
OPVers opVers;
|
|
637
637
|
Cond cond;
|
|
638
638
|
public:
|
|
639
639
|
/// Constructors for PHI
|
|
640
640
|
//@{
|
|
641
|
-
MSSAPHI(const
|
|
641
|
+
MSSAPHI(const SVFBasicBlock* b, const MemRegion* m, Cond c = true) :
|
|
642
642
|
MSSADEF(MSSADEF::SSAPHI,m), bb(b), cond(c)
|
|
643
643
|
{
|
|
644
644
|
}
|
|
@@ -681,7 +681,7 @@ public:
|
|
|
681
681
|
//@}
|
|
682
682
|
|
|
683
683
|
/// Return the basic block
|
|
684
|
-
inline const
|
|
684
|
+
inline const SVFBasicBlock* getBasicBlock() const
|
|
685
685
|
{
|
|
686
686
|
return bb;
|
|
687
687
|
}
|
|
@@ -470,9 +470,9 @@ public:
|
|
|
470
470
|
}
|
|
471
471
|
//@}
|
|
472
472
|
/// Whether this instruction has SVFIR Edge
|
|
473
|
-
bool hasSVFStmtList(const
|
|
473
|
+
bool hasSVFStmtList(const SVFInstruction* inst);
|
|
474
474
|
/// Given an instruction, get all its the PAGEdge (statement) in sequence
|
|
475
|
-
SVFStmtList& getPAGEdgesFromInst(const
|
|
475
|
+
SVFStmtList& getPAGEdgesFromInst(const SVFInstruction* inst);
|
|
476
476
|
|
|
477
477
|
/// getModRefInfo APIs
|
|
478
478
|
//@{
|
|
@@ -81,7 +81,7 @@ public:
|
|
|
81
81
|
typedef Map<const StoreStmt*, CHISet> StoreToChiSetMap;
|
|
82
82
|
typedef Map<const CallICFGNode*, MUSet> CallSiteToMUSetMap;
|
|
83
83
|
typedef Map<const CallICFGNode*, CHISet> CallSiteToCHISetMap;
|
|
84
|
-
typedef OrderedMap<const
|
|
84
|
+
typedef OrderedMap<const SVFBasicBlock*, PHISet> BBToPhiSetMap;
|
|
85
85
|
//@}
|
|
86
86
|
|
|
87
87
|
/// Map from fun to its entry chi set and return mu set
|
|
@@ -90,8 +90,8 @@ public:
|
|
|
90
90
|
|
|
91
91
|
/// For phi insertion
|
|
92
92
|
//@{
|
|
93
|
-
typedef std::vector<const
|
|
94
|
-
typedef Map<const
|
|
93
|
+
typedef std::vector<const SVFBasicBlock*> BBList;
|
|
94
|
+
typedef Map<const SVFBasicBlock*, MRSet> BBToMRSetMap;
|
|
95
95
|
typedef Map<const MemRegion*, BBList> MemRegToBBsMap;
|
|
96
96
|
//@}
|
|
97
97
|
|
|
@@ -129,7 +129,7 @@ protected:
|
|
|
129
129
|
/// SSA rename for a function
|
|
130
130
|
virtual void SSARename(const SVFFunction& fun);
|
|
131
131
|
/// SSA rename for a basic block
|
|
132
|
-
virtual void SSARenameBB(const
|
|
132
|
+
virtual void SSARenameBB(const SVFBasicBlock& bb);
|
|
133
133
|
private:
|
|
134
134
|
LoadToMUSetMap load2MuSetMap;
|
|
135
135
|
StoreToChiSetMap store2ChiSetMap;
|
|
@@ -175,7 +175,7 @@ private:
|
|
|
175
175
|
if (0 == varKills.count(mr))
|
|
176
176
|
usedRegs.insert(mr);
|
|
177
177
|
}
|
|
178
|
-
inline void collectRegDefs(const
|
|
178
|
+
inline void collectRegDefs(const SVFBasicBlock* bb, const MemRegion* mr)
|
|
179
179
|
{
|
|
180
180
|
varKills.insert(mr);
|
|
181
181
|
reg2BBMap[mr].push_back(bb);
|
|
@@ -184,12 +184,12 @@ private:
|
|
|
184
184
|
|
|
185
185
|
/// Add methods for mus/chis/phis
|
|
186
186
|
//@{
|
|
187
|
-
inline void AddLoadMU(const
|
|
187
|
+
inline void AddLoadMU(const SVFBasicBlock* bb, const LoadStmt* load, const MRSet& mrSet)
|
|
188
188
|
{
|
|
189
189
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
190
190
|
AddLoadMU(bb,load,*iter);
|
|
191
191
|
}
|
|
192
|
-
inline void AddStoreCHI(const
|
|
192
|
+
inline void AddStoreCHI(const SVFBasicBlock* bb, const StoreStmt* store, const MRSet& mrSet)
|
|
193
193
|
{
|
|
194
194
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
195
195
|
AddStoreCHI(bb,store,*iter);
|
|
@@ -204,18 +204,18 @@ private:
|
|
|
204
204
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
205
205
|
AddCallSiteCHI(cs,*iter);
|
|
206
206
|
}
|
|
207
|
-
inline void AddMSSAPHI(const
|
|
207
|
+
inline void AddMSSAPHI(const SVFBasicBlock* bb, const MRSet& mrSet)
|
|
208
208
|
{
|
|
209
209
|
for (MRSet::iterator iter = mrSet.begin(), eiter = mrSet.end(); iter != eiter; ++iter)
|
|
210
210
|
AddMSSAPHI(bb,*iter);
|
|
211
211
|
}
|
|
212
|
-
inline void AddLoadMU(const
|
|
212
|
+
inline void AddLoadMU(const SVFBasicBlock* bb, const LoadStmt* load, const MemRegion* mr)
|
|
213
213
|
{
|
|
214
214
|
LOADMU* mu = new LOADMU(bb,load, mr);
|
|
215
215
|
load2MuSetMap[load].insert(mu);
|
|
216
216
|
collectRegUses(mr);
|
|
217
217
|
}
|
|
218
|
-
inline void AddStoreCHI(const
|
|
218
|
+
inline void AddStoreCHI(const SVFBasicBlock* bb, const StoreStmt* store, const MemRegion* mr)
|
|
219
219
|
{
|
|
220
220
|
STORECHI* chi = new STORECHI(bb,store, mr);
|
|
221
221
|
store2ChiSetMap[store].insert(chi);
|
|
@@ -235,7 +235,7 @@ private:
|
|
|
235
235
|
collectRegUses(mr);
|
|
236
236
|
collectRegDefs(chi->getBasicBlock(),mr);
|
|
237
237
|
}
|
|
238
|
-
inline void AddMSSAPHI(const
|
|
238
|
+
inline void AddMSSAPHI(const SVFBasicBlock* bb, const MemRegion* mr)
|
|
239
239
|
{
|
|
240
240
|
bb2PhiSetMap[bb].insert(new PHI(bb, mr));
|
|
241
241
|
}
|
|
@@ -392,11 +392,11 @@ public:
|
|
|
392
392
|
{
|
|
393
393
|
return callsiteToChiSetMap[cs];
|
|
394
394
|
}
|
|
395
|
-
inline PHISet& getPHISet(const
|
|
395
|
+
inline PHISet& getPHISet(const SVFBasicBlock* bb)
|
|
396
396
|
{
|
|
397
397
|
return bb2PhiSetMap[bb];
|
|
398
398
|
}
|
|
399
|
-
inline bool hasPHISet(const
|
|
399
|
+
inline bool hasPHISet(const SVFBasicBlock* bb) const
|
|
400
400
|
{
|
|
401
401
|
return bb2PhiSetMap.find(bb)!=bb2PhiSetMap.end();
|
|
402
402
|
}
|
|
@@ -104,7 +104,7 @@ public:
|
|
|
104
104
|
typedef Set<const SVFGNode*> SVFGNodeSet;
|
|
105
105
|
typedef std::vector<const SVFGNode*> SVFGNodeVec;
|
|
106
106
|
typedef NodeBS SVFGNodeIDSet;
|
|
107
|
-
typedef Set<const
|
|
107
|
+
typedef Set<const SVFInstruction*> InstSet;
|
|
108
108
|
typedef std::pair<NodeID,NodeID> NodeIDPair;
|
|
109
109
|
typedef Map<SVFGNodeLockSpan, bool> PairToBoolMap;
|
|
110
110
|
|