svf-tools 1.0.333 → 1.0.334
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-doxygen/html/html/ConsG_8cpp_source.html +16 -7
- package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/FlowSensitiveTBHC_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/FlowSensitive_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/Graph2Json_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/IRGraph_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/MSSAMuChi_8h_source.html +2 -2
- package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/MemRegion_8h_source.html +2 -2
- package/SVF-doxygen/html/html/MemSSA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/MemSSA_8h_source.html +2 -2
- package/SVF-doxygen/html/html/PAGBuilderFromFile_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/SVFG_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +16 -16
- package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +22 -22
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +16 -16
- package/SVF-doxygen/html/html/SVFStatements_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFStatements_8h.html +14 -12
- package/SVF-doxygen/html/html/SVFStatements_8h_source.html +131 -122
- package/SVF-doxygen/html/html/VFGNode_8h_source.html +11 -11
- package/SVF-doxygen/html/html/VFG_8cpp_source.html +18 -18
- package/SVF-doxygen/html/html/VFG_8h_source.html +17 -16
- package/SVF-doxygen/html/html/annotated.html +271 -270
- package/SVF-doxygen/html/html/classSVF_1_1AddrStmt-members.html +16 -10
- package/SVF-doxygen/html/html/classSVF_1_1AddrStmt.html +36 -14
- package/SVF-doxygen/html/html/classSVF_1_1AddrStmt.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1AssignStmt-members.html +145 -0
- package/SVF-doxygen/html/html/classSVF_1_1AssignStmt.html +770 -0
- package/SVF-doxygen/html/html/classSVF_1_1AssignStmt.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1BinaryOPStmt-members.html +7 -11
- package/SVF-doxygen/html/html/classSVF_1_1BinaryOPStmt.html +19 -138
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt.html +39 -39
- package/SVF-doxygen/html/html/classSVF_1_1BranchVFGNode.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1CallPE-members.html +19 -13
- package/SVF-doxygen/html/html/classSVF_1_1CallPE.html +43 -21
- package/SVF-doxygen/html/html/classSVF_1_1CallPE.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1CmpStmt-members.html +7 -11
- package/SVF-doxygen/html/html/classSVF_1_1CmpStmt.html +20 -139
- package/SVF-doxygen/html/html/classSVF_1_1ConstraintGraph.html +16 -9
- package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1CopyStmt-members.html +16 -10
- package/SVF-doxygen/html/html/classSVF_1_1CopyStmt.html +36 -14
- package/SVF-doxygen/html/html/classSVF_1_1CopyStmt.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveTBHC.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1GenericEdge.html +3 -9
- package/SVF-doxygen/html/html/classSVF_1_1GenericEdge.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1GepStmt-members.html +16 -10
- package/SVF-doxygen/html/html/classSVF_1_1GepStmt.html +41 -19
- package/SVF-doxygen/html/html/classSVF_1_1GepStmt.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1ICFGPrinter.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1LoadStmt-members.html +16 -10
- package/SVF-doxygen/html/html/classSVF_1_1LoadStmt.html +36 -14
- package/SVF-doxygen/html/html/classSVF_1_1LoadStmt.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1MemSSA.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1MultiOpndStmt-members.html +36 -29
- package/SVF-doxygen/html/html/classSVF_1_1MultiOpndStmt.html +250 -31
- package/SVF-doxygen/html/html/classSVF_1_1NormalGepStmt-members.html +17 -11
- package/SVF-doxygen/html/html/classSVF_1_1NormalGepStmt.html +39 -17
- package/SVF-doxygen/html/html/classSVF_1_1NormalGepStmt.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1PhiStmt-members.html +5 -9
- package/SVF-doxygen/html/html/classSVF_1_1PhiStmt.html +18 -137
- package/SVF-doxygen/html/html/classSVF_1_1RetPE-members.html +16 -10
- package/SVF-doxygen/html/html/classSVF_1_1RetPE.html +43 -21
- package/SVF-doxygen/html/html/classSVF_1_1RetPE.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1SVFG.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +23 -23
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1SVFStmt.html +12 -8
- package/SVF-doxygen/html/html/classSVF_1_1SVFStmt.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1StoreStmt-members.html +16 -10
- package/SVF-doxygen/html/html/classSVF_1_1StoreStmt.html +36 -14
- package/SVF-doxygen/html/html/classSVF_1_1StoreStmt.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1TDForkPE-members.html +18 -12
- package/SVF-doxygen/html/html/classSVF_1_1TDForkPE.html +35 -13
- package/SVF-doxygen/html/html/classSVF_1_1TDForkPE.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1TDJoinPE-members.html +17 -11
- package/SVF-doxygen/html/html/classSVF_1_1TDJoinPE.html +35 -13
- package/SVF-doxygen/html/html/classSVF_1_1TDJoinPE.png +0 -0
- package/SVF-doxygen/html/html/classSVF_1_1UnaryOPStmt-members.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1UnaryOPStmt.html +32 -32
- package/SVF-doxygen/html/html/classSVF_1_1VFG.html +27 -27
- package/SVF-doxygen/html/html/classSVF_1_1VariantGepStmt-members.html +17 -11
- package/SVF-doxygen/html/html/classSVF_1_1VariantGepStmt.html +37 -15
- package/SVF-doxygen/html/html/classSVF_1_1VariantGepStmt.png +0 -0
- package/SVF-doxygen/html/html/classes.html +91 -93
- package/SVF-doxygen/html/html/functions_a.html +10 -7
- package/SVF-doxygen/html/html/functions_c.html +16 -15
- package/SVF-doxygen/html/html/functions_func.html +7 -4
- package/SVF-doxygen/html/html/functions_func_c.html +24 -23
- package/SVF-doxygen/html/html/functions_func_g.html +26 -18
- package/SVF-doxygen/html/html/functions_func_o.html +5 -3
- package/SVF-doxygen/html/html/functions_func_t.html +1 -0
- package/SVF-doxygen/html/html/functions_g.html +30 -22
- package/SVF-doxygen/html/html/functions_l.html +5 -5
- package/SVF-doxygen/html/html/functions_m.html +1 -1
- package/SVF-doxygen/html/html/functions_o.html +14 -12
- package/SVF-doxygen/html/html/functions_p.html +18 -14
- package/SVF-doxygen/html/html/functions_r.html +2 -2
- package/SVF-doxygen/html/html/functions_s.html +10 -12
- package/SVF-doxygen/html/html/functions_t.html +4 -3
- package/SVF-doxygen/html/html/functions_v.html +3 -3
- package/SVF-doxygen/html/html/hierarchy.html +17 -16
- package/SVF-doxygen/html/html/namespaceSVF.html +2 -0
- package/SVF-doxygen/html/html/search/all_1.js +1 -0
- package/SVF-doxygen/html/html/search/all_10.js +6 -6
- package/SVF-doxygen/html/html/search/all_12.js +2 -2
- package/SVF-doxygen/html/html/search/all_13.js +7 -7
- package/SVF-doxygen/html/html/search/all_14.js +7 -7
- package/SVF-doxygen/html/html/search/all_15.js +1 -1
- package/SVF-doxygen/html/html/search/all_16.js +2 -2
- package/SVF-doxygen/html/html/search/all_3.js +2 -2
- package/SVF-doxygen/html/html/search/all_7.js +8 -4
- package/SVF-doxygen/html/html/search/all_c.js +2 -2
- package/SVF-doxygen/html/html/search/all_d.js +1 -1
- package/SVF-doxygen/html/html/search/all_e.js +2 -2
- package/SVF-doxygen/html/html/search/all_f.js +3 -3
- package/SVF-doxygen/html/html/search/classes_0.js +2 -1
- package/SVF-doxygen/html/html/search/functions_0.js +1 -0
- package/SVF-doxygen/html/html/search/functions_11.js +1 -1
- package/SVF-doxygen/html/html/search/functions_2.js +1 -1
- package/SVF-doxygen/html/html/search/functions_6.js +8 -4
- package/SVF-doxygen/html/html/search/functions_b.js +1 -1
- package/SVF-doxygen/html/html/search/functions_d.js +1 -1
- package/SVF-doxygen/html/html/search/variables_14.js +3 -3
- package/SVF-doxygen/html/html/search/variables_15.js +1 -1
- package/SVF-doxygen/html/html/search/variables_e.js +2 -2
- package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01IRGraph_01_5_01_4.html +2 -2
- package/include/Graphs/VFG.h +4 -4
- package/include/MemoryModel/SVFStatements.h +379 -310
- package/lib/Graphs/ConsG.cpp +24 -24
- package/lib/Graphs/VFG.cpp +10 -10
- package/lib/MSSA/MemRegion.cpp +5 -5
- package/lib/MemoryModel/SVFIR.cpp +2 -2
- package/lib/MemoryModel/SVFStatements.cpp +11 -11
- package/package.json +1 -1
|
@@ -190,16 +190,89 @@ private:
|
|
|
190
190
|
static u64_t multiOpndLabelCounter; ///< MultiOpndStmt counter
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
+
/*
|
|
194
|
+
Parent class of Addr, Copy, Store, Load, Call, Ret, NormalGep, VariantGep, ThreadFork, ThreadJoin
|
|
195
|
+
connecting RHS expression and LHS expression with an assignment (e.g., LHSExpr = RHSExpr)
|
|
196
|
+
Only one operand on the right handside of an assignment
|
|
197
|
+
*/
|
|
198
|
+
class AssignStmt : public SVFStmt{
|
|
199
|
+
|
|
200
|
+
private:
|
|
201
|
+
AssignStmt(); ///< place holder
|
|
202
|
+
AssignStmt(const AssignStmt &); ///< place holder
|
|
203
|
+
void operator=(const AssignStmt &); ///< place holder
|
|
204
|
+
SVFVar* getSrcNode(); ///< not allowed, use getRHSVar() instead
|
|
205
|
+
SVFVar* getDstNode(); ///< not allowed, use getLHSVar() instead
|
|
206
|
+
NodeID getSrcID(); ///< not allowed, use getRHSVarID() instead
|
|
207
|
+
NodeID getDstID(); ///< not allowed, use getLHSVarID() instead
|
|
208
|
+
|
|
209
|
+
protected:
|
|
210
|
+
/// constructor
|
|
211
|
+
AssignStmt(SVFVar* s, SVFVar* d, GEdgeFlag k) : SVFStmt(s,d,k)
|
|
212
|
+
{
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
public:
|
|
216
|
+
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
217
|
+
//@{
|
|
218
|
+
static inline bool classof(const AssignStmt *)
|
|
219
|
+
{
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
static inline bool classof(const SVFStmt *edge)
|
|
223
|
+
{
|
|
224
|
+
return edge->getEdgeKind() == SVFStmt::Addr ||
|
|
225
|
+
edge->getEdgeKind() == SVFStmt::Copy ||
|
|
226
|
+
edge->getEdgeKind() == SVFStmt::Store ||
|
|
227
|
+
edge->getEdgeKind() == SVFStmt::Load ||
|
|
228
|
+
edge->getEdgeKind() == SVFStmt::Call ||
|
|
229
|
+
edge->getEdgeKind() == SVFStmt::Ret ||
|
|
230
|
+
edge->getEdgeKind() == SVFStmt::NormalGep ||
|
|
231
|
+
edge->getEdgeKind() == SVFStmt::VariantGep ||
|
|
232
|
+
edge->getEdgeKind() == SVFStmt::ThreadFork ||
|
|
233
|
+
edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
234
|
+
}
|
|
235
|
+
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
236
|
+
{
|
|
237
|
+
return edge->getEdgeKind() == SVFStmt::Addr ||
|
|
238
|
+
edge->getEdgeKind() == SVFStmt::Copy ||
|
|
239
|
+
edge->getEdgeKind() == SVFStmt::Store ||
|
|
240
|
+
edge->getEdgeKind() == SVFStmt::Load ||
|
|
241
|
+
edge->getEdgeKind() == SVFStmt::Call ||
|
|
242
|
+
edge->getEdgeKind() == SVFStmt::Ret ||
|
|
243
|
+
edge->getEdgeKind() == SVFStmt::NormalGep ||
|
|
244
|
+
edge->getEdgeKind() == SVFStmt::VariantGep ||
|
|
245
|
+
edge->getEdgeKind() == SVFStmt::ThreadFork ||
|
|
246
|
+
edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
247
|
+
}
|
|
248
|
+
//@}
|
|
249
|
+
|
|
250
|
+
inline SVFVar* getRHSVar() const {
|
|
251
|
+
return SVFStmt::getSrcNode();
|
|
252
|
+
}
|
|
253
|
+
inline SVFVar* getLHSVar() const {
|
|
254
|
+
return SVFStmt::getDstNode();
|
|
255
|
+
}
|
|
256
|
+
inline NodeID getRHSVarID() const {
|
|
257
|
+
return SVFStmt::getSrcID();
|
|
258
|
+
}
|
|
259
|
+
inline NodeID getLHSVarID() const {
|
|
260
|
+
return SVFStmt::getDstID();
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
virtual const std::string toString() const = 0;
|
|
264
|
+
};
|
|
193
265
|
|
|
194
266
|
/*!
|
|
195
267
|
* Address statement (memory allocations)
|
|
196
268
|
*/
|
|
197
|
-
class AddrStmt: public
|
|
269
|
+
class AddrStmt: public AssignStmt
|
|
198
270
|
{
|
|
199
271
|
private:
|
|
200
272
|
AddrStmt(); ///< place holder
|
|
201
273
|
AddrStmt(const AddrStmt &); ///< place holder
|
|
202
274
|
void operator=(const AddrStmt &); ///< place holder
|
|
275
|
+
|
|
203
276
|
public:
|
|
204
277
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
205
278
|
//@{
|
|
@@ -218,7 +291,7 @@ public:
|
|
|
218
291
|
//@}
|
|
219
292
|
|
|
220
293
|
/// constructor
|
|
221
|
-
AddrStmt(SVFVar* s, SVFVar* d) :
|
|
294
|
+
AddrStmt(SVFVar* s, SVFVar* d) : AssignStmt(s,d,SVFStmt::Addr)
|
|
222
295
|
{
|
|
223
296
|
}
|
|
224
297
|
|
|
@@ -229,7 +302,7 @@ public:
|
|
|
229
302
|
/*!
|
|
230
303
|
* Copy statements (simple assignment and casting)
|
|
231
304
|
*/
|
|
232
|
-
class CopyStmt: public
|
|
305
|
+
class CopyStmt: public AssignStmt
|
|
233
306
|
{
|
|
234
307
|
private:
|
|
235
308
|
CopyStmt(); ///< place holder
|
|
@@ -253,646 +326,642 @@ public:
|
|
|
253
326
|
//@}
|
|
254
327
|
|
|
255
328
|
/// constructor
|
|
256
|
-
CopyStmt(SVFVar* s, SVFVar* d) :
|
|
329
|
+
CopyStmt(SVFVar* s, SVFVar* d) : AssignStmt(s,d,SVFStmt::Copy)
|
|
257
330
|
{
|
|
258
331
|
}
|
|
259
332
|
|
|
260
333
|
virtual const std::string toString() const override;
|
|
261
334
|
};
|
|
262
335
|
|
|
263
|
-
|
|
264
|
-
*
|
|
265
|
-
*/
|
|
266
|
-
class
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
336
|
+
/*!
|
|
337
|
+
* Store statement
|
|
338
|
+
*/
|
|
339
|
+
class StoreStmt: public AssignStmt
|
|
340
|
+
{
|
|
341
|
+
private:
|
|
342
|
+
StoreStmt(); ///< place holder
|
|
343
|
+
StoreStmt(const StoreStmt &); ///< place holder
|
|
344
|
+
void operator=(const StoreStmt &); ///< place holder
|
|
345
|
+
|
|
271
346
|
public:
|
|
272
|
-
/// Constructor, only used by subclassess but not external users
|
|
273
|
-
MultiOpndStmt(SVFVar* r, const OPVars& opnds, GEdgeFlag k): SVFStmt(opnds.at(0), r, k), opVars(opnds)
|
|
274
|
-
{
|
|
275
|
-
}
|
|
276
347
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
277
348
|
//@{
|
|
278
|
-
static inline bool classof(const
|
|
349
|
+
static inline bool classof(const StoreStmt *)
|
|
279
350
|
{
|
|
280
351
|
return true;
|
|
281
352
|
}
|
|
282
|
-
static inline bool classof(const SVFStmt *
|
|
353
|
+
static inline bool classof(const SVFStmt *edge)
|
|
283
354
|
{
|
|
284
|
-
return
|
|
285
|
-
node->getEdgeKind() == BinaryOp ||
|
|
286
|
-
node->getEdgeKind() == Cmp;
|
|
355
|
+
return edge->getEdgeKind() == SVFStmt::Store;
|
|
287
356
|
}
|
|
288
|
-
static inline bool classof(const GenericPAGEdgeTy *
|
|
357
|
+
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
289
358
|
{
|
|
290
|
-
return
|
|
291
|
-
node->getEdgeKind() == BinaryOp ||
|
|
292
|
-
node->getEdgeKind() == Cmp;
|
|
359
|
+
return edge->getEdgeKind() == SVFStmt::Store;
|
|
293
360
|
}
|
|
294
361
|
//@}
|
|
295
|
-
/// Operands and result at a BinaryNode e.g., p = q + r, `p` is resVar and `r` is OpVar
|
|
296
|
-
//@{
|
|
297
|
-
/// Operand SVFVars
|
|
298
|
-
inline const SVFVar* getOpVar(u32_t pos) const
|
|
299
|
-
{
|
|
300
|
-
return opVars.at(pos);
|
|
301
|
-
}
|
|
302
|
-
/// Result SVFVar
|
|
303
|
-
inline const SVFVar* getRes() const
|
|
304
|
-
{
|
|
305
|
-
return getDstNode();
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
NodeID getOpVarID(u32_t pos) const;
|
|
309
|
-
NodeID getResID() const;
|
|
310
362
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
}
|
|
315
|
-
inline const OPVars& getOpndVars() const{
|
|
316
|
-
return opVars;
|
|
317
|
-
}
|
|
318
|
-
inline OPVars::const_iterator opVarBegin() const
|
|
319
|
-
{
|
|
320
|
-
return opVars.begin();
|
|
321
|
-
}
|
|
322
|
-
inline OPVars::const_iterator opVerEnd() const
|
|
363
|
+
/// constructor
|
|
364
|
+
StoreStmt(SVFVar* s, SVFVar* d, const IntraBlockNode* st) :
|
|
365
|
+
AssignStmt(s, d, makeEdgeFlagWithStoreInst(SVFStmt::Store, st))
|
|
323
366
|
{
|
|
324
|
-
return opVars.end();
|
|
325
367
|
}
|
|
326
|
-
|
|
368
|
+
|
|
369
|
+
virtual const std::string toString() const override;
|
|
327
370
|
};
|
|
328
371
|
|
|
372
|
+
|
|
329
373
|
/*!
|
|
330
|
-
*
|
|
331
|
-
* it is typically at a joint point of the control-flow graph
|
|
374
|
+
* Load statement
|
|
332
375
|
*/
|
|
333
|
-
class
|
|
376
|
+
class LoadStmt: public AssignStmt
|
|
334
377
|
{
|
|
335
378
|
private:
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
void operator=(const
|
|
339
|
-
SVFVar* getSrcNode(); ///< place holder, not allowed since this SVFStmt has multiple operands but not a single source
|
|
340
|
-
SVFVar* getDstNode(); ///< place holder, use getRes() instead
|
|
341
|
-
SVFVar* getSrcID(); ///< place holder, use getOpVarID(pos) instead
|
|
342
|
-
SVFVar* getDstID(); ///< place holder, use getResID() instead
|
|
379
|
+
LoadStmt(); ///< place holder
|
|
380
|
+
LoadStmt(const LoadStmt &); ///< place holder
|
|
381
|
+
void operator=(const LoadStmt &); ///< place holder
|
|
343
382
|
|
|
344
383
|
public:
|
|
345
384
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
346
385
|
//@{
|
|
347
|
-
static inline bool classof(const
|
|
386
|
+
static inline bool classof(const LoadStmt *)
|
|
348
387
|
{
|
|
349
388
|
return true;
|
|
350
389
|
}
|
|
351
390
|
static inline bool classof(const SVFStmt *edge)
|
|
352
391
|
{
|
|
353
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
354
|
-
}
|
|
355
|
-
static inline bool classof(const MultiOpndStmt *edge)
|
|
356
|
-
{
|
|
357
|
-
return edge->getEdgeKind() == SVFStmt::Phi;
|
|
392
|
+
return edge->getEdgeKind() == SVFStmt::Load;
|
|
358
393
|
}
|
|
359
394
|
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
360
395
|
{
|
|
361
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
396
|
+
return edge->getEdgeKind() == SVFStmt::Load;
|
|
362
397
|
}
|
|
363
398
|
//@}
|
|
364
399
|
|
|
365
400
|
/// constructor
|
|
366
|
-
|
|
401
|
+
LoadStmt(SVFVar* s, SVFVar* d) : AssignStmt(s,d,SVFStmt::Load)
|
|
367
402
|
{
|
|
368
403
|
}
|
|
369
|
-
|
|
370
|
-
opVars.push_back(op);
|
|
371
|
-
}
|
|
404
|
+
|
|
372
405
|
virtual const std::string toString() const override;
|
|
373
406
|
};
|
|
374
407
|
|
|
375
408
|
|
|
376
409
|
/*!
|
|
377
|
-
*
|
|
410
|
+
* Gep statement for struct field access, array access and pointer arithmetic
|
|
378
411
|
*/
|
|
379
|
-
class
|
|
412
|
+
class GepStmt: public AssignStmt
|
|
380
413
|
{
|
|
381
414
|
private:
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
void operator=(const
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
SVFVar* getSrcID(); ///< place holder, use getOpVarID(pos) instead
|
|
388
|
-
SVFVar* getDstID(); ///< place holder, use getResID() instead
|
|
415
|
+
GepStmt(); ///< place holder
|
|
416
|
+
GepStmt(const GepStmt &); ///< place holder
|
|
417
|
+
void operator=(const GepStmt &); ///< place holder
|
|
418
|
+
|
|
419
|
+
LocationSet ls; ///< location set of the gep edge
|
|
389
420
|
|
|
390
|
-
u32_t predicate;
|
|
391
421
|
public:
|
|
392
422
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
393
423
|
//@{
|
|
394
|
-
static inline bool classof(const
|
|
424
|
+
static inline bool classof(const GepStmt *)
|
|
395
425
|
{
|
|
396
426
|
return true;
|
|
397
427
|
}
|
|
398
428
|
static inline bool classof(const SVFStmt *edge)
|
|
399
429
|
{
|
|
400
|
-
return
|
|
401
|
-
|
|
402
|
-
static inline bool classof(const MultiOpndStmt *edge)
|
|
403
|
-
{
|
|
404
|
-
return edge->getEdgeKind() == SVFStmt::Cmp;
|
|
430
|
+
return edge->getEdgeKind() == SVFStmt::NormalGep ||
|
|
431
|
+
edge->getEdgeKind() == SVFStmt::VariantGep;
|
|
405
432
|
}
|
|
406
433
|
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
407
434
|
{
|
|
408
|
-
return
|
|
435
|
+
return edge->getEdgeKind() == SVFStmt::NormalGep ||
|
|
436
|
+
edge->getEdgeKind() == SVFStmt::VariantGep;
|
|
409
437
|
}
|
|
410
438
|
//@}
|
|
411
439
|
|
|
412
|
-
|
|
413
|
-
CmpStmt(SVFVar* s, const OPVars& opnds, u32_t pre) : MultiOpndStmt(s,opnds,SVFStmt::Cmp), predicate(pre)
|
|
440
|
+
inline const LocationSet& getLocationSet() const
|
|
414
441
|
{
|
|
442
|
+
return ls;
|
|
415
443
|
}
|
|
416
444
|
|
|
417
|
-
|
|
445
|
+
protected:
|
|
446
|
+
/// constructor
|
|
447
|
+
GepStmt(SVFVar* s, SVFVar* d, const LocationSet& l, PEDGEK k) : AssignStmt(s,d,k), ls(l)
|
|
418
448
|
{
|
|
419
|
-
return predicate;
|
|
420
449
|
}
|
|
421
|
-
|
|
422
|
-
virtual const std::string toString() const
|
|
450
|
+
|
|
451
|
+
virtual const std::string toString() const;
|
|
452
|
+
|
|
423
453
|
};
|
|
424
454
|
|
|
425
455
|
|
|
426
456
|
/*!
|
|
427
|
-
*
|
|
457
|
+
* Gep statement with a fixed field index for struct field access
|
|
428
458
|
*/
|
|
429
|
-
class
|
|
459
|
+
class NormalGepStmt : public GepStmt
|
|
430
460
|
{
|
|
431
461
|
private:
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
void operator=(const
|
|
435
|
-
SVFVar* getSrcNode(); ///< place holder, not allowed since this SVFStmt has multiple operands but not a single source
|
|
436
|
-
SVFVar* getDstNode(); ///< place holder, use getRes() instead
|
|
437
|
-
SVFVar* getSrcID(); ///< place holder, use getOpVarID(pos) instead
|
|
438
|
-
SVFVar* getDstID(); ///< place holder, use getResID() instead
|
|
439
|
-
|
|
440
|
-
u32_t opcode;
|
|
462
|
+
NormalGepStmt(); ///< place holder
|
|
463
|
+
NormalGepStmt(const NormalGepStmt&); ///< place holder
|
|
464
|
+
void operator=(const NormalGepStmt&); ///< place holder
|
|
441
465
|
|
|
442
466
|
public:
|
|
443
467
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
444
468
|
//@{
|
|
445
|
-
static inline bool classof(const
|
|
469
|
+
static inline bool classof(const NormalGepStmt *)
|
|
446
470
|
{
|
|
447
471
|
return true;
|
|
448
472
|
}
|
|
449
|
-
static inline bool classof(const
|
|
473
|
+
static inline bool classof(const GepStmt *edge)
|
|
450
474
|
{
|
|
451
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
475
|
+
return edge->getEdgeKind() == SVFStmt::NormalGep;
|
|
452
476
|
}
|
|
453
|
-
static inline bool classof(const
|
|
477
|
+
static inline bool classof(const SVFStmt *edge)
|
|
454
478
|
{
|
|
455
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
479
|
+
return edge->getEdgeKind() == SVFStmt::NormalGep;
|
|
456
480
|
}
|
|
457
481
|
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
458
482
|
{
|
|
459
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
483
|
+
return edge->getEdgeKind() == SVFStmt::NormalGep;
|
|
460
484
|
}
|
|
461
485
|
//@}
|
|
462
486
|
|
|
463
487
|
/// constructor
|
|
464
|
-
|
|
465
|
-
{
|
|
466
|
-
}
|
|
488
|
+
NormalGepStmt(SVFVar* s, SVFVar* d, const LocationSet& l) : GepStmt(s,d,l, SVFStmt::NormalGep)
|
|
489
|
+
{}
|
|
467
490
|
|
|
468
|
-
|
|
491
|
+
/// offset of the gep edge
|
|
492
|
+
inline u32_t getFieldOffset() const
|
|
469
493
|
{
|
|
470
|
-
return
|
|
494
|
+
return getLocationSet().accumulateConstantFieldIdx();
|
|
471
495
|
}
|
|
472
496
|
|
|
473
497
|
virtual const std::string toString() const override;
|
|
474
498
|
};
|
|
475
499
|
|
|
476
500
|
/*!
|
|
477
|
-
*
|
|
501
|
+
* Gep statement with a variant field index for struct field access
|
|
478
502
|
*/
|
|
479
|
-
class
|
|
503
|
+
class VariantGepStmt : public GepStmt
|
|
480
504
|
{
|
|
481
505
|
private:
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
void operator=(const
|
|
485
|
-
SVFVar* getSrcNode(); ///< place holder, use getOpVar() instead
|
|
486
|
-
SVFVar* getDstNode(); ///< place holder, use getRes() instead
|
|
487
|
-
SVFVar* getSrcID(); ///< place holder, use getOpVarID() instead
|
|
488
|
-
SVFVar* getDstID(); ///< place holder, use getResID() instead
|
|
506
|
+
VariantGepStmt(); ///< place holder
|
|
507
|
+
VariantGepStmt(const VariantGepStmt&); ///< place holder
|
|
508
|
+
void operator=(const VariantGepStmt&); ///< place holder
|
|
489
509
|
|
|
490
|
-
u32_t opcode;
|
|
491
510
|
public:
|
|
492
511
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
493
512
|
//@{
|
|
494
|
-
static inline bool classof(const
|
|
513
|
+
static inline bool classof(const VariantGepStmt *)
|
|
495
514
|
{
|
|
496
515
|
return true;
|
|
497
516
|
}
|
|
517
|
+
static inline bool classof(const GepStmt *edge)
|
|
518
|
+
{
|
|
519
|
+
return edge->getEdgeKind() == SVFStmt::VariantGep;
|
|
520
|
+
}
|
|
498
521
|
static inline bool classof(const SVFStmt *edge)
|
|
499
522
|
{
|
|
500
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
523
|
+
return edge->getEdgeKind() == SVFStmt::VariantGep;
|
|
501
524
|
}
|
|
502
525
|
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
503
526
|
{
|
|
504
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
527
|
+
return edge->getEdgeKind() == SVFStmt::VariantGep;
|
|
505
528
|
}
|
|
506
529
|
//@}
|
|
507
530
|
|
|
508
531
|
/// constructor
|
|
509
|
-
|
|
510
|
-
{
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
u32_t getOpcode() const
|
|
514
|
-
{
|
|
515
|
-
return opcode;
|
|
516
|
-
}
|
|
517
|
-
inline const SVFVar* getOpVar() const{
|
|
518
|
-
return SVFStmt::getSrcNode();
|
|
519
|
-
}
|
|
520
|
-
inline const SVFVar* getRes() const{
|
|
521
|
-
return SVFStmt::getDstNode();
|
|
522
|
-
}
|
|
523
|
-
NodeID getOpVarID() const;
|
|
524
|
-
NodeID getResID() const;
|
|
532
|
+
VariantGepStmt(SVFVar* s, SVFVar* d, const LocationSet& l) : GepStmt(s,d,l, SVFStmt::VariantGep) {}
|
|
525
533
|
|
|
526
534
|
virtual const std::string toString() const override;
|
|
535
|
+
|
|
527
536
|
};
|
|
528
537
|
|
|
529
538
|
|
|
530
539
|
/*!
|
|
531
|
-
*
|
|
540
|
+
* Call
|
|
532
541
|
*/
|
|
533
|
-
class
|
|
542
|
+
class CallPE: public AssignStmt
|
|
534
543
|
{
|
|
535
544
|
private:
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
void operator=(const
|
|
539
|
-
SVFVar* getSrcNode(); ///< place holder, not allowed
|
|
540
|
-
SVFVar* getDstNode(); ///< place holder, not allowed
|
|
541
|
-
SVFVar* getSrcID(); ///< place holder, not allowed
|
|
542
|
-
SVFVar* getDstID(); ///< place holder, not allowed
|
|
545
|
+
CallPE(); ///< place holder
|
|
546
|
+
CallPE(const CallPE &); ///< place holder
|
|
547
|
+
void operator=(const CallPE &); ///< place holder
|
|
543
548
|
|
|
544
|
-
|
|
545
|
-
const SVFVar* cond;
|
|
546
|
-
const SVFVar* brInst;
|
|
549
|
+
const CallBlockNode* inst; ///< llvm instruction for this call
|
|
547
550
|
public:
|
|
548
551
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
549
552
|
//@{
|
|
550
|
-
static inline bool classof(const
|
|
553
|
+
static inline bool classof(const CallPE *)
|
|
551
554
|
{
|
|
552
555
|
return true;
|
|
553
556
|
}
|
|
554
557
|
static inline bool classof(const SVFStmt *edge)
|
|
555
558
|
{
|
|
556
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
559
|
+
return edge->getEdgeKind() == SVFStmt::Call
|
|
560
|
+
|| edge->getEdgeKind() == SVFStmt::ThreadFork;
|
|
557
561
|
}
|
|
558
562
|
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
559
563
|
{
|
|
560
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
564
|
+
return edge->getEdgeKind() == SVFStmt::Call
|
|
565
|
+
|| edge->getEdgeKind() == SVFStmt::ThreadFork;
|
|
561
566
|
}
|
|
562
567
|
//@}
|
|
563
568
|
|
|
564
569
|
/// constructor
|
|
565
|
-
|
|
570
|
+
CallPE(SVFVar* s, SVFVar* d, const CallBlockNode* i, GEdgeKind k = SVFStmt::Call) :
|
|
571
|
+
AssignStmt(s,d,makeEdgeFlagWithCallInst(k,i)), inst(i)
|
|
566
572
|
{
|
|
567
573
|
}
|
|
568
574
|
|
|
569
|
-
///
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
const SVFVar* getCondition() const;
|
|
575
|
-
const SVFVar* getBranchInst() const{
|
|
576
|
-
return brInst;
|
|
577
|
-
}
|
|
578
|
-
/// Successors of this branch statement
|
|
579
|
-
///@{
|
|
580
|
-
u32_t getNumSuccessors() const{
|
|
581
|
-
return successors.size();
|
|
582
|
-
}
|
|
583
|
-
const std::vector<const ICFGNode*>& getSuccessors() const{
|
|
584
|
-
return successors;
|
|
575
|
+
/// Get method for the call instruction
|
|
576
|
+
//@{
|
|
577
|
+
inline const CallBlockNode* getCallInst() const
|
|
578
|
+
{
|
|
579
|
+
return inst;
|
|
585
580
|
}
|
|
586
|
-
const
|
|
587
|
-
|
|
581
|
+
inline const CallBlockNode* getCallSite() const
|
|
582
|
+
{
|
|
583
|
+
return inst;
|
|
588
584
|
}
|
|
589
|
-
|
|
585
|
+
//@}
|
|
586
|
+
|
|
590
587
|
virtual const std::string toString() const override;
|
|
591
588
|
};
|
|
592
589
|
|
|
590
|
+
|
|
593
591
|
/*!
|
|
594
|
-
*
|
|
592
|
+
* Return
|
|
595
593
|
*/
|
|
596
|
-
class
|
|
594
|
+
class RetPE: public AssignStmt
|
|
597
595
|
{
|
|
598
596
|
private:
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
void operator=(const
|
|
597
|
+
RetPE(); ///< place holder
|
|
598
|
+
RetPE(const RetPE &); ///< place holder
|
|
599
|
+
void operator=(const RetPE &); ///< place holder
|
|
602
600
|
|
|
601
|
+
const CallBlockNode* inst; /// the callsite instruction return to
|
|
603
602
|
public:
|
|
604
603
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
605
604
|
//@{
|
|
606
|
-
static inline bool classof(const
|
|
605
|
+
static inline bool classof(const RetPE *)
|
|
607
606
|
{
|
|
608
607
|
return true;
|
|
609
608
|
}
|
|
610
609
|
static inline bool classof(const SVFStmt *edge)
|
|
611
610
|
{
|
|
612
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
611
|
+
return edge->getEdgeKind() == SVFStmt::Ret
|
|
612
|
+
|| edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
613
613
|
}
|
|
614
614
|
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
615
615
|
{
|
|
616
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
616
|
+
return edge->getEdgeKind() == SVFStmt::Ret
|
|
617
|
+
|| edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
617
618
|
}
|
|
618
619
|
//@}
|
|
619
620
|
|
|
620
621
|
/// constructor
|
|
621
|
-
|
|
622
|
-
|
|
622
|
+
RetPE(SVFVar* s, SVFVar* d, const CallBlockNode* i, GEdgeKind k = SVFStmt::Ret) :
|
|
623
|
+
AssignStmt(s,d,makeEdgeFlagWithCallInst(k,i)), inst(i)
|
|
624
|
+
{
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
/// Get method for call instruction at caller
|
|
628
|
+
//@{
|
|
629
|
+
inline const CallBlockNode* getCallInst() const
|
|
623
630
|
{
|
|
631
|
+
return inst;
|
|
624
632
|
}
|
|
633
|
+
inline const CallBlockNode* getCallSite() const
|
|
634
|
+
{
|
|
635
|
+
return inst;
|
|
636
|
+
}
|
|
637
|
+
//@}
|
|
625
638
|
|
|
626
639
|
virtual const std::string toString() const override;
|
|
627
640
|
};
|
|
628
641
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
642
|
+
/*
|
|
643
|
+
* Program statements with multiple operands including BinaryOPStmt, CmpStmt and PhiStmt
|
|
644
|
+
*/
|
|
645
|
+
class MultiOpndStmt : public SVFStmt{
|
|
646
|
+
public:
|
|
647
|
+
typedef std::vector<SVFVar*> OPVars;
|
|
635
648
|
private:
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
void operator=(const
|
|
649
|
+
MultiOpndStmt(); ///< place holder
|
|
650
|
+
MultiOpndStmt(const MultiOpndStmt &); ///< place holder
|
|
651
|
+
void operator=(const MultiOpndStmt &); ///< place holder
|
|
652
|
+
SVFVar* getSrcNode(); ///< not allowed, use getOpVar(idx) instead
|
|
653
|
+
SVFVar* getDstNode(); ///< not allowed, use getRes() instead
|
|
654
|
+
NodeID getSrcID(); ///< not allowed, use getOpVarID(idx) instead
|
|
655
|
+
NodeID getDstID(); ///< not allowed, use getResID() instead
|
|
639
656
|
|
|
657
|
+
protected:
|
|
658
|
+
OPVars opVars;
|
|
659
|
+
/// Constructor, only used by subclassess but not external users
|
|
660
|
+
MultiOpndStmt(SVFVar* r, const OPVars& opnds, GEdgeFlag k): SVFStmt(opnds.at(0), r, k), opVars(opnds)
|
|
661
|
+
{
|
|
662
|
+
}
|
|
640
663
|
public:
|
|
641
664
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
642
665
|
//@{
|
|
643
|
-
static inline bool classof(const
|
|
666
|
+
static inline bool classof(const MultiOpndStmt *)
|
|
644
667
|
{
|
|
645
668
|
return true;
|
|
646
669
|
}
|
|
647
|
-
static inline bool classof(const SVFStmt *
|
|
670
|
+
static inline bool classof(const SVFStmt *node)
|
|
648
671
|
{
|
|
649
|
-
return
|
|
672
|
+
return node->getEdgeKind() == Phi ||
|
|
673
|
+
node->getEdgeKind() == BinaryOp ||
|
|
674
|
+
node->getEdgeKind() == Cmp;
|
|
650
675
|
}
|
|
651
|
-
static inline bool classof(const GenericPAGEdgeTy *
|
|
676
|
+
static inline bool classof(const GenericPAGEdgeTy *node)
|
|
652
677
|
{
|
|
653
|
-
return
|
|
678
|
+
return node->getEdgeKind() == Phi ||
|
|
679
|
+
node->getEdgeKind() == BinaryOp ||
|
|
680
|
+
node->getEdgeKind() == Cmp;
|
|
654
681
|
}
|
|
655
682
|
//@}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
683
|
+
/// Operands and result at a BinaryNode e.g., p = q + r, `p` is resVar and `r` is OpVar
|
|
684
|
+
//@{
|
|
685
|
+
/// Operand SVFVars
|
|
686
|
+
inline const SVFVar* getOpVar(u32_t pos) const
|
|
659
687
|
{
|
|
688
|
+
return opVars.at(pos);
|
|
660
689
|
}
|
|
690
|
+
/// Result SVFVar
|
|
691
|
+
inline const SVFVar* getRes() const
|
|
692
|
+
{
|
|
693
|
+
return SVFStmt::getDstNode();
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
NodeID getOpVarID(u32_t pos) const;
|
|
697
|
+
NodeID getResID() const;
|
|
661
698
|
|
|
662
|
-
|
|
699
|
+
inline u32_t getOpVarNum() const
|
|
700
|
+
{
|
|
701
|
+
return opVars.size();
|
|
702
|
+
}
|
|
703
|
+
inline const OPVars& getOpndVars() const{
|
|
704
|
+
return opVars;
|
|
705
|
+
}
|
|
706
|
+
inline OPVars::const_iterator opVarBegin() const
|
|
707
|
+
{
|
|
708
|
+
return opVars.begin();
|
|
709
|
+
}
|
|
710
|
+
inline OPVars::const_iterator opVerEnd() const
|
|
711
|
+
{
|
|
712
|
+
return opVars.end();
|
|
713
|
+
}
|
|
714
|
+
//@}
|
|
663
715
|
};
|
|
664
716
|
|
|
665
|
-
|
|
666
717
|
/*!
|
|
667
|
-
*
|
|
718
|
+
* Phi statement (e.g., p = phi(q,r) which receives values from variables q and r from different paths)
|
|
719
|
+
* it is typically at a joint point of the control-flow graph
|
|
668
720
|
*/
|
|
669
|
-
class
|
|
721
|
+
class PhiStmt: public MultiOpndStmt
|
|
670
722
|
{
|
|
671
723
|
private:
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
void operator=(const
|
|
675
|
-
|
|
676
|
-
LocationSet ls; ///< location set of the gep edge
|
|
724
|
+
PhiStmt(); ///< place holder
|
|
725
|
+
PhiStmt(const PhiStmt &); ///< place holder
|
|
726
|
+
void operator=(const PhiStmt &); ///< place holder
|
|
677
727
|
|
|
678
728
|
public:
|
|
679
729
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
680
730
|
//@{
|
|
681
|
-
static inline bool classof(const
|
|
731
|
+
static inline bool classof(const PhiStmt *)
|
|
682
732
|
{
|
|
683
733
|
return true;
|
|
684
734
|
}
|
|
685
735
|
static inline bool classof(const SVFStmt *edge)
|
|
686
736
|
{
|
|
687
|
-
return
|
|
688
|
-
edge->getEdgeKind() == SVFStmt::VariantGep;
|
|
737
|
+
return edge->getEdgeKind() == SVFStmt::Phi;
|
|
689
738
|
}
|
|
690
|
-
static inline bool classof(const
|
|
739
|
+
static inline bool classof(const MultiOpndStmt *edge)
|
|
691
740
|
{
|
|
692
|
-
return
|
|
693
|
-
edge->getEdgeKind() == SVFStmt::VariantGep;
|
|
741
|
+
return edge->getEdgeKind() == SVFStmt::Phi;
|
|
694
742
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
inline const LocationSet& getLocationSet() const
|
|
743
|
+
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
698
744
|
{
|
|
699
|
-
return
|
|
745
|
+
return edge->getEdgeKind() == SVFStmt::Phi;
|
|
700
746
|
}
|
|
747
|
+
//@}
|
|
701
748
|
|
|
702
|
-
protected:
|
|
703
749
|
/// constructor
|
|
704
|
-
|
|
750
|
+
PhiStmt(SVFVar* s, const OPVars& opnds) : MultiOpndStmt(s,opnds,SVFStmt::Phi)
|
|
705
751
|
{
|
|
706
752
|
}
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
753
|
+
void addOpVar(SVFVar* op){
|
|
754
|
+
opVars.push_back(op);
|
|
755
|
+
}
|
|
756
|
+
virtual const std::string toString() const override;
|
|
710
757
|
};
|
|
711
758
|
|
|
712
759
|
|
|
713
760
|
/*!
|
|
714
|
-
*
|
|
761
|
+
* Comparison statement
|
|
715
762
|
*/
|
|
716
|
-
class
|
|
763
|
+
class CmpStmt: public MultiOpndStmt
|
|
717
764
|
{
|
|
718
765
|
private:
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
void operator=(const
|
|
766
|
+
CmpStmt(); ///< place holder
|
|
767
|
+
CmpStmt(const CmpStmt &); ///< place holder
|
|
768
|
+
void operator=(const CmpStmt &); ///< place holder
|
|
722
769
|
|
|
770
|
+
u32_t predicate;
|
|
723
771
|
public:
|
|
724
772
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
725
773
|
//@{
|
|
726
|
-
static inline bool classof(const
|
|
774
|
+
static inline bool classof(const CmpStmt *)
|
|
727
775
|
{
|
|
728
776
|
return true;
|
|
729
777
|
}
|
|
730
|
-
static inline bool classof(const
|
|
778
|
+
static inline bool classof(const SVFStmt *edge)
|
|
731
779
|
{
|
|
732
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
780
|
+
return edge->getEdgeKind() == SVFStmt::Cmp;
|
|
733
781
|
}
|
|
734
|
-
static inline bool classof(const
|
|
782
|
+
static inline bool classof(const MultiOpndStmt *edge)
|
|
735
783
|
{
|
|
736
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
784
|
+
return edge->getEdgeKind() == SVFStmt::Cmp;
|
|
737
785
|
}
|
|
738
786
|
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
739
787
|
{
|
|
740
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
788
|
+
return edge->getEdgeKind() == SVFStmt::Cmp;
|
|
741
789
|
}
|
|
742
790
|
//@}
|
|
743
791
|
|
|
744
792
|
/// constructor
|
|
745
|
-
|
|
746
|
-
{}
|
|
747
|
-
|
|
748
|
-
/// offset of the gep edge
|
|
749
|
-
inline u32_t getFieldOffset() const
|
|
793
|
+
CmpStmt(SVFVar* s, const OPVars& opnds, u32_t pre) : MultiOpndStmt(s,opnds,SVFStmt::Cmp), predicate(pre)
|
|
750
794
|
{
|
|
751
|
-
return getLocationSet().accumulateConstantFieldIdx();
|
|
752
795
|
}
|
|
753
796
|
|
|
797
|
+
u32_t getPredicate() const
|
|
798
|
+
{
|
|
799
|
+
return predicate;
|
|
800
|
+
}
|
|
801
|
+
|
|
754
802
|
virtual const std::string toString() const override;
|
|
755
803
|
};
|
|
756
804
|
|
|
805
|
+
|
|
757
806
|
/*!
|
|
758
|
-
*
|
|
807
|
+
* Binary statement
|
|
759
808
|
*/
|
|
760
|
-
class
|
|
809
|
+
class BinaryOPStmt: public MultiOpndStmt
|
|
761
810
|
{
|
|
762
811
|
private:
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
void operator=(const
|
|
812
|
+
BinaryOPStmt(); ///< place holder
|
|
813
|
+
BinaryOPStmt(const BinaryOPStmt &); ///< place holder
|
|
814
|
+
void operator=(const BinaryOPStmt &); ///< place holder
|
|
815
|
+
u32_t opcode;
|
|
766
816
|
|
|
767
817
|
public:
|
|
768
818
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
769
819
|
//@{
|
|
770
|
-
static inline bool classof(const
|
|
820
|
+
static inline bool classof(const BinaryOPStmt *)
|
|
771
821
|
{
|
|
772
822
|
return true;
|
|
773
823
|
}
|
|
774
|
-
static inline bool classof(const
|
|
824
|
+
static inline bool classof(const SVFStmt *edge)
|
|
775
825
|
{
|
|
776
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
826
|
+
return edge->getEdgeKind() == SVFStmt::BinaryOp;
|
|
777
827
|
}
|
|
778
|
-
static inline bool classof(const
|
|
828
|
+
static inline bool classof(const MultiOpndStmt *edge)
|
|
779
829
|
{
|
|
780
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
830
|
+
return edge->getEdgeKind() == SVFStmt::BinaryOp;
|
|
781
831
|
}
|
|
782
832
|
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
783
833
|
{
|
|
784
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
834
|
+
return edge->getEdgeKind() == SVFStmt::BinaryOp;
|
|
785
835
|
}
|
|
786
836
|
//@}
|
|
787
837
|
|
|
788
838
|
/// constructor
|
|
789
|
-
|
|
839
|
+
BinaryOPStmt(SVFVar* s, const OPVars& opnds, u32_t oc) : MultiOpndStmt(s,opnds,SVFStmt::BinaryOp), opcode(oc)
|
|
840
|
+
{
|
|
841
|
+
}
|
|
790
842
|
|
|
791
|
-
|
|
843
|
+
u32_t getOpcode() const
|
|
844
|
+
{
|
|
845
|
+
return opcode;
|
|
846
|
+
}
|
|
792
847
|
|
|
848
|
+
virtual const std::string toString() const override;
|
|
793
849
|
};
|
|
794
850
|
|
|
795
|
-
|
|
796
851
|
/*!
|
|
797
|
-
*
|
|
852
|
+
* Unary statement
|
|
798
853
|
*/
|
|
799
|
-
class
|
|
854
|
+
class UnaryOPStmt: public SVFStmt
|
|
800
855
|
{
|
|
801
856
|
private:
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
void operator=(const
|
|
857
|
+
UnaryOPStmt(); ///< place holder
|
|
858
|
+
UnaryOPStmt(const UnaryOPStmt &); ///< place holder
|
|
859
|
+
void operator=(const UnaryOPStmt &); ///< place holder
|
|
860
|
+
SVFVar* getSrcNode(); ///< place holder, use getOpVar() instead
|
|
861
|
+
SVFVar* getDstNode(); ///< place holder, use getRes() instead
|
|
862
|
+
NodeID getSrcID(); ///< place holder, use getOpVarID(pos) instead
|
|
863
|
+
NodeID getDstID(); ///< place holder, use getResID() instead
|
|
805
864
|
|
|
806
|
-
|
|
865
|
+
u32_t opcode;
|
|
807
866
|
public:
|
|
808
867
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
809
868
|
//@{
|
|
810
|
-
static inline bool classof(const
|
|
869
|
+
static inline bool classof(const UnaryOPStmt *)
|
|
811
870
|
{
|
|
812
871
|
return true;
|
|
813
872
|
}
|
|
814
873
|
static inline bool classof(const SVFStmt *edge)
|
|
815
874
|
{
|
|
816
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
817
|
-
|| edge->getEdgeKind() == SVFStmt::ThreadFork;
|
|
875
|
+
return edge->getEdgeKind() == SVFStmt::UnaryOp;
|
|
818
876
|
}
|
|
819
877
|
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
820
878
|
{
|
|
821
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
822
|
-
|| edge->getEdgeKind() == SVFStmt::ThreadFork;
|
|
879
|
+
return edge->getEdgeKind() == SVFStmt::UnaryOp;
|
|
823
880
|
}
|
|
824
881
|
//@}
|
|
825
882
|
|
|
826
883
|
/// constructor
|
|
827
|
-
|
|
828
|
-
SVFStmt(s,d,makeEdgeFlagWithCallInst(k,i)), inst(i)
|
|
884
|
+
UnaryOPStmt(SVFVar* s, SVFVar* d, u32_t oc) : SVFStmt(s,d,SVFStmt::UnaryOp), opcode(oc)
|
|
829
885
|
{
|
|
830
886
|
}
|
|
831
887
|
|
|
832
|
-
|
|
833
|
-
//@{
|
|
834
|
-
inline const CallBlockNode* getCallInst() const
|
|
888
|
+
u32_t getOpcode() const
|
|
835
889
|
{
|
|
836
|
-
return
|
|
890
|
+
return opcode;
|
|
837
891
|
}
|
|
838
|
-
inline const
|
|
839
|
-
|
|
840
|
-
return inst;
|
|
892
|
+
inline const SVFVar* getOpVar() const{
|
|
893
|
+
return SVFStmt::getSrcNode();
|
|
841
894
|
}
|
|
842
|
-
|
|
895
|
+
inline const SVFVar* getRes() const{
|
|
896
|
+
return SVFStmt::getDstNode();
|
|
897
|
+
}
|
|
898
|
+
NodeID getOpVarID() const;
|
|
899
|
+
NodeID getResID() const;
|
|
843
900
|
|
|
844
901
|
virtual const std::string toString() const override;
|
|
845
902
|
};
|
|
846
903
|
|
|
847
904
|
|
|
848
905
|
/*!
|
|
849
|
-
*
|
|
906
|
+
* Branch statements including if/else and switch
|
|
850
907
|
*/
|
|
851
|
-
class
|
|
908
|
+
class BranchStmt: public SVFStmt
|
|
852
909
|
{
|
|
853
910
|
private:
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
void operator=(const
|
|
911
|
+
BranchStmt(); ///< place holder
|
|
912
|
+
BranchStmt(const BranchStmt &); ///< place holder
|
|
913
|
+
void operator=(const BranchStmt &); ///< place holder
|
|
914
|
+
SVFVar* getSrcNode(); ///< place holder, not allowed
|
|
915
|
+
SVFVar* getDstNode(); ///< place holder, not allowed
|
|
916
|
+
NodeID getSrcID(); ///< place holder, use getOpVarID(pos) instead
|
|
917
|
+
NodeID getDstID(); ///< place holder, use getResID() instead
|
|
857
918
|
|
|
858
|
-
const
|
|
919
|
+
std::vector<const ICFGNode*> successors;
|
|
920
|
+
const SVFVar* cond;
|
|
921
|
+
const SVFVar* brInst;
|
|
859
922
|
public:
|
|
860
923
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
861
924
|
//@{
|
|
862
|
-
static inline bool classof(const
|
|
925
|
+
static inline bool classof(const BranchStmt *)
|
|
863
926
|
{
|
|
864
927
|
return true;
|
|
865
928
|
}
|
|
866
929
|
static inline bool classof(const SVFStmt *edge)
|
|
867
930
|
{
|
|
868
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
869
|
-
|| edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
931
|
+
return edge->getEdgeKind() == SVFStmt::Branch;
|
|
870
932
|
}
|
|
871
933
|
static inline bool classof(const GenericPAGEdgeTy *edge)
|
|
872
934
|
{
|
|
873
|
-
return edge->getEdgeKind() == SVFStmt::
|
|
874
|
-
|| edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
935
|
+
return edge->getEdgeKind() == SVFStmt::Branch;
|
|
875
936
|
}
|
|
876
937
|
//@}
|
|
877
938
|
|
|
878
939
|
/// constructor
|
|
879
|
-
|
|
880
|
-
SVFStmt(s,d,makeEdgeFlagWithCallInst(k,i)), inst(i)
|
|
940
|
+
BranchStmt(SVFVar* inst, SVFVar* c, const std::vector<const ICFGNode*>& succs) : SVFStmt(c,inst,SVFStmt::Branch), successors(succs), cond(c), brInst(inst)
|
|
881
941
|
{
|
|
882
942
|
}
|
|
883
943
|
|
|
884
|
-
///
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
944
|
+
/// The branch is unconditional if cond is a null value
|
|
945
|
+
bool isUnconditional() const;
|
|
946
|
+
/// The branch is conditional if cond is not a null value
|
|
947
|
+
bool isConditional() const;
|
|
948
|
+
/// Return the condition
|
|
949
|
+
const SVFVar* getCondition() const;
|
|
950
|
+
const SVFVar* getBranchInst() const{
|
|
951
|
+
return brInst;
|
|
889
952
|
}
|
|
890
|
-
|
|
891
|
-
{
|
|
892
|
-
|
|
953
|
+
/// Successors of this branch statement
|
|
954
|
+
///@{
|
|
955
|
+
u32_t getNumSuccessors() const{
|
|
956
|
+
return successors.size();
|
|
893
957
|
}
|
|
894
|
-
|
|
895
|
-
|
|
958
|
+
const std::vector<const ICFGNode*>& getSuccessors() const{
|
|
959
|
+
return successors;
|
|
960
|
+
}
|
|
961
|
+
const ICFGNode* getSuccessor (u32_t i) const{
|
|
962
|
+
return successors.at(i);
|
|
963
|
+
}
|
|
964
|
+
///@}
|
|
896
965
|
virtual const std::string toString() const override;
|
|
897
966
|
};
|
|
898
967
|
|