svf-lib 1.0.845 → 1.0.846
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/MemoryModel/LocationSet.h +0 -6
- package/SVF-linux/include/MemoryModel/SVFStatements.h +1 -1
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +1 -1
- package/SVF-linux/include/SVF-FE/LLVMUtil.h +1 -1
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +59 -75
- package/package.json +1 -1
|
Binary file
|
|
@@ -434,7 +434,6 @@ public:
|
|
|
434
434
|
|
|
435
435
|
inline const LocationSet& getLocationSet() const
|
|
436
436
|
{
|
|
437
|
-
assert(isVariantFieldGep()==false && "Can't retrieve the LocationSet if using a variable field index (pointer arithmetic) for struct field access ");
|
|
438
437
|
return ls;
|
|
439
438
|
}
|
|
440
439
|
inline const LocationSet::OffsetValueVec& getOffsetValueVec() const
|
|
@@ -453,6 +452,7 @@ public:
|
|
|
453
452
|
/// Field index of the gep statement if it access the field of a struct
|
|
454
453
|
inline s64_t getConstantFieldIdx() const
|
|
455
454
|
{
|
|
455
|
+
assert(isVariantFieldGep()==false && "Can't retrieve the LocationSet if using a variable field index (pointer arithmetic) for struct field access ");
|
|
456
456
|
return getLocationSet().accumulateConstantFieldIdx();
|
|
457
457
|
}
|
|
458
458
|
/// Gep statement with a variant field index (pointer arithmetic) for struct field access
|
|
@@ -360,7 +360,7 @@ public:
|
|
|
360
360
|
/// Flatterned element idx of an array or struct by considering stride
|
|
361
361
|
const std::vector<u32_t>& getFlattenedElemIdxVec(const Type *T);
|
|
362
362
|
/// Flatterned field index information of a struct ignoring any array field
|
|
363
|
-
const std::vector<u32_t>& getFlattenedFieldIdxVec(const
|
|
363
|
+
const std::vector<u32_t>& getFlattenedFieldIdxVec(const Type *T);
|
|
364
364
|
|
|
365
365
|
const std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec(const Type *T);
|
|
366
366
|
|
|
@@ -510,7 +510,7 @@ inline const BasicBlock* getFunExitBB(const Function* fun)
|
|
|
510
510
|
const Value * stripConstantCasts(const Value *val);
|
|
511
511
|
|
|
512
512
|
/// Strip off the all casts
|
|
513
|
-
Value *stripAllCasts(Value *val) ;
|
|
513
|
+
const Value *stripAllCasts(const Value *val) ;
|
|
514
514
|
|
|
515
515
|
/// Get the type of the heap allocation
|
|
516
516
|
const Type *getTypeOfHeapAlloc(const llvm::Instruction *inst) ;
|
|
@@ -128,10 +128,7 @@ public:
|
|
|
128
128
|
bool computeGepOffset(const User *V, LocationSet& ls);
|
|
129
129
|
|
|
130
130
|
/// Get the base type and max offset
|
|
131
|
-
const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields);
|
|
132
|
-
|
|
133
|
-
/// Replace fields with flatten fields of T if the number of its fields is larger than msz.
|
|
134
|
-
u32_t getFields(std::vector<LocationSet>& fields, const Type* T, u32_t msz);
|
|
131
|
+
const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields, const Value* sz);
|
|
135
132
|
|
|
136
133
|
/// Handle direct call
|
|
137
134
|
void handleDirectCall(CallSite cs, const SVFFunction *F);
|
|
@@ -145,7 +142,7 @@ public:
|
|
|
145
142
|
/// Handle external call
|
|
146
143
|
//@{
|
|
147
144
|
virtual void handleExtCall(CallSite cs, const SVFFunction *F);
|
|
148
|
-
void addComplexConsForExt(Value *D, Value *S,
|
|
145
|
+
void addComplexConsForExt(Value *D, Value *S, const Value* sz);
|
|
149
146
|
//@}
|
|
150
147
|
|
|
151
148
|
/// Our visit overrides.
|
|
@@ -284,137 +281,124 @@ public:
|
|
|
284
281
|
|
|
285
282
|
void setCurrentBBAndValueForPAGEdge(PAGEdge* edge);
|
|
286
283
|
|
|
287
|
-
inline
|
|
284
|
+
inline void addBlackHoleAddrEdge(NodeID node)
|
|
288
285
|
{
|
|
289
|
-
PAGEdge *edge = pag->addBlackHoleAddrStmt(node)
|
|
290
|
-
|
|
291
|
-
return edge;
|
|
286
|
+
if(PAGEdge *edge = pag->addBlackHoleAddrStmt(node))
|
|
287
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
292
288
|
}
|
|
293
289
|
|
|
294
290
|
/// Add Address edge
|
|
295
291
|
inline AddrStmt* addAddrEdge(NodeID src, NodeID dst)
|
|
296
292
|
{
|
|
297
|
-
AddrStmt *edge = pag->addAddrStmt(src, dst)
|
|
298
|
-
|
|
299
|
-
|
|
293
|
+
if(AddrStmt *edge = pag->addAddrStmt(src, dst)){
|
|
294
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
295
|
+
return edge;
|
|
296
|
+
}
|
|
297
|
+
return nullptr;
|
|
300
298
|
}
|
|
301
299
|
/// Add Copy edge
|
|
302
300
|
inline CopyStmt* addCopyEdge(NodeID src, NodeID dst)
|
|
303
301
|
{
|
|
304
|
-
CopyStmt *edge = pag->addCopyStmt(src, dst)
|
|
305
|
-
|
|
306
|
-
|
|
302
|
+
if(CopyStmt *edge = pag->addCopyStmt(src, dst)){
|
|
303
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
304
|
+
return edge;
|
|
305
|
+
}
|
|
306
|
+
return nullptr;
|
|
307
307
|
}
|
|
308
308
|
/// Add Copy edge
|
|
309
|
-
inline
|
|
309
|
+
inline void addPhiStmt(NodeID res, NodeID opnd, const ICFGNode* pred)
|
|
310
310
|
{
|
|
311
|
-
PhiStmt *edge = pag->addPhiStmt(res,opnd,pred);
|
|
312
311
|
/// If we already added this phi node, then skip this adding
|
|
313
|
-
if(edge)
|
|
312
|
+
if(PhiStmt *edge = pag->addPhiStmt(res,opnd,pred))
|
|
314
313
|
setCurrentBBAndValueForPAGEdge(edge);
|
|
315
|
-
return edge;
|
|
316
314
|
}
|
|
317
315
|
/// Add SelectStmt
|
|
318
|
-
inline
|
|
316
|
+
inline void addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond)
|
|
319
317
|
{
|
|
320
|
-
SelectStmt *edge = pag->addSelectStmt(res,op1,op2,cond)
|
|
321
|
-
|
|
322
|
-
return edge;
|
|
318
|
+
if(SelectStmt *edge = pag->addSelectStmt(res,op1,op2,cond))
|
|
319
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
323
320
|
}
|
|
324
321
|
/// Add Copy edge
|
|
325
|
-
inline
|
|
322
|
+
inline void addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t predict)
|
|
326
323
|
{
|
|
327
|
-
CmpStmt *edge = pag->addCmpStmt(op1, op2, dst, predict)
|
|
328
|
-
|
|
329
|
-
return edge;
|
|
324
|
+
if(CmpStmt *edge = pag->addCmpStmt(op1, op2, dst, predict))
|
|
325
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
330
326
|
}
|
|
331
327
|
/// Add Copy edge
|
|
332
|
-
inline
|
|
328
|
+
inline void addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
|
|
333
329
|
{
|
|
334
|
-
BinaryOPStmt *edge = pag->addBinaryOPStmt(op1, op2, dst, opcode)
|
|
335
|
-
|
|
336
|
-
return edge;
|
|
330
|
+
if(BinaryOPStmt *edge = pag->addBinaryOPStmt(op1, op2, dst, opcode))
|
|
331
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
337
332
|
}
|
|
338
333
|
/// Add Unary edge
|
|
339
|
-
inline
|
|
334
|
+
inline void addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
|
|
340
335
|
{
|
|
341
|
-
UnaryOPStmt *edge = pag->addUnaryOPStmt(src, dst, opcode)
|
|
342
|
-
|
|
343
|
-
return edge;
|
|
336
|
+
if(UnaryOPStmt *edge = pag->addUnaryOPStmt(src, dst, opcode))
|
|
337
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
344
338
|
}
|
|
345
339
|
/// Add Branch statement
|
|
346
|
-
inline
|
|
347
|
-
BranchStmt *edge = pag->addBranchStmt(br, cond, succs)
|
|
348
|
-
|
|
349
|
-
return edge;
|
|
340
|
+
inline void addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccAndCondPairVec& succs){
|
|
341
|
+
if(BranchStmt *edge = pag->addBranchStmt(br, cond, succs))
|
|
342
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
350
343
|
}
|
|
351
344
|
/// Add Load edge
|
|
352
|
-
inline
|
|
345
|
+
inline void addLoadEdge(NodeID src, NodeID dst)
|
|
353
346
|
{
|
|
354
|
-
LoadStmt *edge = pag->addLoadStmt(src, dst)
|
|
355
|
-
|
|
356
|
-
return edge;
|
|
347
|
+
if(LoadStmt *edge = pag->addLoadStmt(src, dst))
|
|
348
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
357
349
|
}
|
|
358
350
|
/// Add Store edge
|
|
359
|
-
inline
|
|
351
|
+
inline void addStoreEdge(NodeID src, NodeID dst)
|
|
360
352
|
{
|
|
361
353
|
IntraICFGNode* node;
|
|
362
354
|
if(const Instruction* inst = SVFUtil::dyn_cast<Instruction>(curVal))
|
|
363
355
|
node = pag->getICFG()->getIntraICFGNode(inst);
|
|
364
356
|
else
|
|
365
357
|
node = nullptr;
|
|
366
|
-
StoreStmt *edge = pag->addStoreStmt(src, dst, node)
|
|
367
|
-
|
|
368
|
-
return edge;
|
|
358
|
+
if(StoreStmt *edge = pag->addStoreStmt(src, dst, node))
|
|
359
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
369
360
|
}
|
|
370
361
|
/// Add Call edge
|
|
371
|
-
inline
|
|
362
|
+
inline void addCallEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunEntryICFGNode* entry)
|
|
372
363
|
{
|
|
373
|
-
CallPE *edge = pag->addCallPE(src, dst, cs, entry)
|
|
374
|
-
|
|
375
|
-
return edge;
|
|
364
|
+
if(CallPE *edge = pag->addCallPE(src, dst, cs, entry))
|
|
365
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
376
366
|
}
|
|
377
367
|
/// Add Return edge
|
|
378
|
-
inline
|
|
368
|
+
inline void addRetEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunExitICFGNode* exit)
|
|
379
369
|
{
|
|
380
|
-
RetPE *edge = pag->addRetPE(src, dst, cs, exit)
|
|
381
|
-
|
|
382
|
-
return edge;
|
|
370
|
+
if(RetPE *edge = pag->addRetPE(src, dst, cs, exit))
|
|
371
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
383
372
|
}
|
|
384
373
|
/// Add Gep edge
|
|
385
|
-
inline
|
|
374
|
+
inline void addGepEdge(NodeID src, NodeID dst, const LocationSet& ls, bool constGep)
|
|
386
375
|
{
|
|
387
|
-
GepStmt *edge = pag->addGepStmt(src, dst, ls, constGep)
|
|
388
|
-
|
|
389
|
-
return edge;
|
|
376
|
+
if(GepStmt *edge = pag->addGepStmt(src, dst, ls, constGep))
|
|
377
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
390
378
|
}
|
|
391
379
|
/// Add Offset(Gep) edge
|
|
392
|
-
inline
|
|
380
|
+
inline void addNormalGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
|
|
393
381
|
{
|
|
394
|
-
GepStmt *edge = pag->addNormalGepStmt(src, dst, ls)
|
|
395
|
-
|
|
396
|
-
return edge;
|
|
382
|
+
if(GepStmt *edge = pag->addNormalGepStmt(src, dst, ls))
|
|
383
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
397
384
|
}
|
|
398
385
|
/// Add Variant(Gep) edge
|
|
399
|
-
inline
|
|
386
|
+
inline void addVariantGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
|
|
400
387
|
{
|
|
401
|
-
GepStmt *edge = pag->addVariantGepStmt(src, dst, ls)
|
|
402
|
-
|
|
403
|
-
return edge;
|
|
388
|
+
if(GepStmt *edge = pag->addVariantGepStmt(src, dst, ls))
|
|
389
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
404
390
|
}
|
|
405
391
|
/// Add Thread fork edge for parameter passing
|
|
406
|
-
inline
|
|
392
|
+
inline void addThreadForkEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunEntryICFGNode* entry)
|
|
407
393
|
{
|
|
408
|
-
TDForkPE *edge = pag->addThreadForkPE(src, dst, cs, entry)
|
|
409
|
-
|
|
410
|
-
return edge;
|
|
394
|
+
if(TDForkPE *edge = pag->addThreadForkPE(src, dst, cs, entry))
|
|
395
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
411
396
|
}
|
|
412
397
|
/// Add Thread join edge for parameter passing
|
|
413
|
-
inline
|
|
398
|
+
inline void addThreadJoinEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunExitICFGNode* exit)
|
|
414
399
|
{
|
|
415
|
-
TDJoinPE *edge = pag->addThreadJoinPE(src, dst, cs, exit)
|
|
416
|
-
|
|
417
|
-
return edge;
|
|
400
|
+
if(TDJoinPE *edge = pag->addThreadJoinPE(src, dst, cs, exit))
|
|
401
|
+
setCurrentBBAndValueForPAGEdge(edge);
|
|
418
402
|
}
|
|
419
403
|
//@}
|
|
420
404
|
|