svf-lib 1.0.722 → 1.0.726
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/MemModel.h +5 -21
- package/SVF-linux/include/SVF-FE/CHG.h +1 -1
- package/SVF-linux/include/SVF-FE/SymbolTableInfo.h +14 -56
- package/SVF-linux/include/WPA/Andersen.h +2 -7
- 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/MemoryModel/MemModel.h +5 -21
- package/SVF-osx/include/SVF-FE/CHG.h +1 -1
- package/SVF-osx/include/SVF-FE/SymbolTableInfo.h +14 -56
- package/SVF-osx/include/WPA/Andersen.h +2 -7
- package/package.json +1 -1
|
Binary file
|
|
@@ -172,18 +172,12 @@ public:
|
|
|
172
172
|
{
|
|
173
173
|
|
|
174
174
|
}
|
|
175
|
-
/// Initialize the object type
|
|
176
|
-
void init(const Value* value);
|
|
177
175
|
|
|
178
|
-
///
|
|
179
|
-
|
|
180
|
-
virtual u32_t getObjSize(const Value* val);
|
|
181
|
-
|
|
182
|
-
/// Analyse types of gobal and stack objects
|
|
183
|
-
void analyzeGlobalStackObjType(const Value* val);
|
|
176
|
+
/// Analyse types of heap and static objects
|
|
177
|
+
void analyzeHeapObjType(const Type* type);
|
|
184
178
|
|
|
185
179
|
/// Analyse types of heap and static objects
|
|
186
|
-
void
|
|
180
|
+
void analyzeStaticObjType(const Type* type);
|
|
187
181
|
|
|
188
182
|
/// Get LLVM type
|
|
189
183
|
inline const Type* getType() const
|
|
@@ -295,25 +289,15 @@ private:
|
|
|
295
289
|
public:
|
|
296
290
|
|
|
297
291
|
/// Constructor
|
|
298
|
-
MemObj(const Value *val
|
|
299
|
-
|
|
300
|
-
/// Constructor for black hole and constant obj
|
|
301
|
-
MemObj(SymID id, const Type* type = nullptr);
|
|
292
|
+
MemObj(SymID id, ObjTypeInfo* ti, const Value *val = nullptr);
|
|
302
293
|
|
|
303
294
|
/// Destructor
|
|
304
295
|
~MemObj()
|
|
305
296
|
{
|
|
306
297
|
destroy();
|
|
307
298
|
}
|
|
308
|
-
|
|
309
|
-
/// Initialize the object
|
|
310
|
-
void init(const Value *val);
|
|
311
|
-
|
|
312
|
-
/// Initialize black hole and constant object
|
|
313
|
-
void init(const Type* type);
|
|
314
|
-
|
|
315
299
|
/// Get obj type
|
|
316
|
-
const
|
|
300
|
+
const Type* getType() const;
|
|
317
301
|
|
|
318
302
|
/// Get max field offset limit
|
|
319
303
|
inline Size_t getMaxFieldOffsetLimit() const
|
|
@@ -206,7 +206,7 @@ public:
|
|
|
206
206
|
{
|
|
207
207
|
assert(isBlkObjOrConstantObj(symId));
|
|
208
208
|
assert(objMap.find(symId)==objMap.end());
|
|
209
|
-
objMap[symId] = new MemObj(symId);;
|
|
209
|
+
objMap[symId] = new MemObj(symId, createObjTypeInfo());;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
inline MemObj* getBlkObj() const
|
|
@@ -242,7 +242,7 @@ public:
|
|
|
242
242
|
inline const MemObj* createDummyObj(SymID symId, const Type* type)
|
|
243
243
|
{
|
|
244
244
|
assert(objMap.find(symId)==objMap.end() && "this dummy obj has been created before");
|
|
245
|
-
MemObj* memObj = new MemObj(symId, type);
|
|
245
|
+
MemObj* memObj = new MemObj(symId, createObjTypeInfo(type));
|
|
246
246
|
objMap[symId] = memObj;
|
|
247
247
|
return memObj;
|
|
248
248
|
}
|
|
@@ -433,6 +433,18 @@ protected:
|
|
|
433
433
|
/// Collect simple type (non-aggregate) info
|
|
434
434
|
virtual void collectSimpleTypeInfo(const Type* T);
|
|
435
435
|
|
|
436
|
+
/// Create an objectInfo based on LLVM value
|
|
437
|
+
ObjTypeInfo* createObjTypeInfo(const Value *val);
|
|
438
|
+
/// Create an objectInfo based on LLVM type (value is null, and type could be null, representing a dummy object)
|
|
439
|
+
ObjTypeInfo* createObjTypeInfo(const Type *type = nullptr);
|
|
440
|
+
|
|
441
|
+
/// Initialize TypeInfo based on LLVM Value
|
|
442
|
+
void initTypeInfo(ObjTypeInfo* typeinfo, const Value* value);
|
|
443
|
+
/// Analyse types of all flattened fields of this object
|
|
444
|
+
void analyzeGlobalStackObjType(ObjTypeInfo* typeinfo, const Value* val);
|
|
445
|
+
/// Return size of this object based on LLVM value
|
|
446
|
+
u32_t getObjSize(const Value* val);
|
|
447
|
+
|
|
436
448
|
/// Every type T is mapped to StInfo
|
|
437
449
|
/// which contains size (fsize) , offset(foffset)
|
|
438
450
|
/// fsize[i] is the number of fields in the largest such struct, else fsize[i] = 1.
|
|
@@ -447,60 +459,6 @@ protected:
|
|
|
447
459
|
};
|
|
448
460
|
|
|
449
461
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
/*!
|
|
453
|
-
* Bytes/bits-level modeling of memory locations to handle weakly type languages.
|
|
454
|
-
* (declared with one type but accessed as another)
|
|
455
|
-
* Abstract memory objects are created according to the static allocated size.
|
|
456
|
-
*/
|
|
457
|
-
class LocSymTableInfo : public SymbolTableInfo
|
|
458
|
-
{
|
|
459
|
-
|
|
460
|
-
public:
|
|
461
|
-
/// Constructor
|
|
462
|
-
LocSymTableInfo()
|
|
463
|
-
{
|
|
464
|
-
}
|
|
465
|
-
/// Destructor
|
|
466
|
-
virtual ~LocSymTableInfo()
|
|
467
|
-
{
|
|
468
|
-
}
|
|
469
|
-
/// Compute gep offset
|
|
470
|
-
virtual bool computeGepOffset(const User *V, LocationSet& ls);
|
|
471
|
-
/// Given an offset from a Gep Instruction, return it modulus offset by considering memory layout
|
|
472
|
-
virtual LocationSet getModulusOffset(const MemObj* obj, const LocationSet& ls);
|
|
473
|
-
|
|
474
|
-
/// Verify struct size construction
|
|
475
|
-
void verifyStructSize(StInfo *stInfo, u32_t structSize);
|
|
476
|
-
|
|
477
|
-
protected:
|
|
478
|
-
/// Collect the struct info
|
|
479
|
-
virtual void collectStructInfo(const StructType *T);
|
|
480
|
-
/// Collect the array info
|
|
481
|
-
virtual void collectArrayInfo(const ArrayType *T);
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
class LocObjTypeInfo : public ObjTypeInfo
|
|
486
|
-
{
|
|
487
|
-
|
|
488
|
-
public:
|
|
489
|
-
/// Constructor
|
|
490
|
-
LocObjTypeInfo(const Value* val, Type* t, Size_t max) : ObjTypeInfo(val,t,max)
|
|
491
|
-
{
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
/// Destructor
|
|
495
|
-
virtual ~LocObjTypeInfo()
|
|
496
|
-
{
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
/// Get the size of this object
|
|
500
|
-
u32_t getObjSize(const Value* val);
|
|
501
|
-
|
|
502
|
-
};
|
|
503
|
-
|
|
504
462
|
} // End namespace SVF
|
|
505
463
|
|
|
506
464
|
#endif /* INCLUDE_SVF_FE_SYMBOLTABLEINFO_H_ */
|
|
@@ -53,19 +53,14 @@ class AndersenBase: public WPAConstraintSolver, public BVDataPTAImpl
|
|
|
53
53
|
public:
|
|
54
54
|
|
|
55
55
|
/// Constructor
|
|
56
|
-
|
|
56
|
+
AndersenBase(PAG* _pag, PTATY type = Andersen_BASE, bool alias_check = true)
|
|
57
57
|
: BVDataPTAImpl(_pag, type, alias_check), consCG(nullptr)
|
|
58
58
|
{
|
|
59
59
|
iterationForPrintStat = OnTheFlyIterBudgetForStat;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/// Destructor
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
if (consCG != nullptr)
|
|
66
|
-
delete consCG;
|
|
67
|
-
consCG = nullptr;
|
|
68
|
-
}
|
|
63
|
+
~AndersenBase() override;
|
|
69
64
|
|
|
70
65
|
/// Andersen analysis
|
|
71
66
|
virtual void analyze() override;
|
|
Binary file
|
|
Binary file
|
|
@@ -172,18 +172,12 @@ public:
|
|
|
172
172
|
{
|
|
173
173
|
|
|
174
174
|
}
|
|
175
|
-
/// Initialize the object type
|
|
176
|
-
void init(const Value* value);
|
|
177
175
|
|
|
178
|
-
///
|
|
179
|
-
|
|
180
|
-
virtual u32_t getObjSize(const Value* val);
|
|
181
|
-
|
|
182
|
-
/// Analyse types of gobal and stack objects
|
|
183
|
-
void analyzeGlobalStackObjType(const Value* val);
|
|
176
|
+
/// Analyse types of heap and static objects
|
|
177
|
+
void analyzeHeapObjType(const Type* type);
|
|
184
178
|
|
|
185
179
|
/// Analyse types of heap and static objects
|
|
186
|
-
void
|
|
180
|
+
void analyzeStaticObjType(const Type* type);
|
|
187
181
|
|
|
188
182
|
/// Get LLVM type
|
|
189
183
|
inline const Type* getType() const
|
|
@@ -295,25 +289,15 @@ private:
|
|
|
295
289
|
public:
|
|
296
290
|
|
|
297
291
|
/// Constructor
|
|
298
|
-
MemObj(const Value *val
|
|
299
|
-
|
|
300
|
-
/// Constructor for black hole and constant obj
|
|
301
|
-
MemObj(SymID id, const Type* type = nullptr);
|
|
292
|
+
MemObj(SymID id, ObjTypeInfo* ti, const Value *val = nullptr);
|
|
302
293
|
|
|
303
294
|
/// Destructor
|
|
304
295
|
~MemObj()
|
|
305
296
|
{
|
|
306
297
|
destroy();
|
|
307
298
|
}
|
|
308
|
-
|
|
309
|
-
/// Initialize the object
|
|
310
|
-
void init(const Value *val);
|
|
311
|
-
|
|
312
|
-
/// Initialize black hole and constant object
|
|
313
|
-
void init(const Type* type);
|
|
314
|
-
|
|
315
299
|
/// Get obj type
|
|
316
|
-
const
|
|
300
|
+
const Type* getType() const;
|
|
317
301
|
|
|
318
302
|
/// Get max field offset limit
|
|
319
303
|
inline Size_t getMaxFieldOffsetLimit() const
|
|
@@ -206,7 +206,7 @@ public:
|
|
|
206
206
|
{
|
|
207
207
|
assert(isBlkObjOrConstantObj(symId));
|
|
208
208
|
assert(objMap.find(symId)==objMap.end());
|
|
209
|
-
objMap[symId] = new MemObj(symId);;
|
|
209
|
+
objMap[symId] = new MemObj(symId, createObjTypeInfo());;
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
inline MemObj* getBlkObj() const
|
|
@@ -242,7 +242,7 @@ public:
|
|
|
242
242
|
inline const MemObj* createDummyObj(SymID symId, const Type* type)
|
|
243
243
|
{
|
|
244
244
|
assert(objMap.find(symId)==objMap.end() && "this dummy obj has been created before");
|
|
245
|
-
MemObj* memObj = new MemObj(symId, type);
|
|
245
|
+
MemObj* memObj = new MemObj(symId, createObjTypeInfo(type));
|
|
246
246
|
objMap[symId] = memObj;
|
|
247
247
|
return memObj;
|
|
248
248
|
}
|
|
@@ -433,6 +433,18 @@ protected:
|
|
|
433
433
|
/// Collect simple type (non-aggregate) info
|
|
434
434
|
virtual void collectSimpleTypeInfo(const Type* T);
|
|
435
435
|
|
|
436
|
+
/// Create an objectInfo based on LLVM value
|
|
437
|
+
ObjTypeInfo* createObjTypeInfo(const Value *val);
|
|
438
|
+
/// Create an objectInfo based on LLVM type (value is null, and type could be null, representing a dummy object)
|
|
439
|
+
ObjTypeInfo* createObjTypeInfo(const Type *type = nullptr);
|
|
440
|
+
|
|
441
|
+
/// Initialize TypeInfo based on LLVM Value
|
|
442
|
+
void initTypeInfo(ObjTypeInfo* typeinfo, const Value* value);
|
|
443
|
+
/// Analyse types of all flattened fields of this object
|
|
444
|
+
void analyzeGlobalStackObjType(ObjTypeInfo* typeinfo, const Value* val);
|
|
445
|
+
/// Return size of this object based on LLVM value
|
|
446
|
+
u32_t getObjSize(const Value* val);
|
|
447
|
+
|
|
436
448
|
/// Every type T is mapped to StInfo
|
|
437
449
|
/// which contains size (fsize) , offset(foffset)
|
|
438
450
|
/// fsize[i] is the number of fields in the largest such struct, else fsize[i] = 1.
|
|
@@ -447,60 +459,6 @@ protected:
|
|
|
447
459
|
};
|
|
448
460
|
|
|
449
461
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
/*!
|
|
453
|
-
* Bytes/bits-level modeling of memory locations to handle weakly type languages.
|
|
454
|
-
* (declared with one type but accessed as another)
|
|
455
|
-
* Abstract memory objects are created according to the static allocated size.
|
|
456
|
-
*/
|
|
457
|
-
class LocSymTableInfo : public SymbolTableInfo
|
|
458
|
-
{
|
|
459
|
-
|
|
460
|
-
public:
|
|
461
|
-
/// Constructor
|
|
462
|
-
LocSymTableInfo()
|
|
463
|
-
{
|
|
464
|
-
}
|
|
465
|
-
/// Destructor
|
|
466
|
-
virtual ~LocSymTableInfo()
|
|
467
|
-
{
|
|
468
|
-
}
|
|
469
|
-
/// Compute gep offset
|
|
470
|
-
virtual bool computeGepOffset(const User *V, LocationSet& ls);
|
|
471
|
-
/// Given an offset from a Gep Instruction, return it modulus offset by considering memory layout
|
|
472
|
-
virtual LocationSet getModulusOffset(const MemObj* obj, const LocationSet& ls);
|
|
473
|
-
|
|
474
|
-
/// Verify struct size construction
|
|
475
|
-
void verifyStructSize(StInfo *stInfo, u32_t structSize);
|
|
476
|
-
|
|
477
|
-
protected:
|
|
478
|
-
/// Collect the struct info
|
|
479
|
-
virtual void collectStructInfo(const StructType *T);
|
|
480
|
-
/// Collect the array info
|
|
481
|
-
virtual void collectArrayInfo(const ArrayType *T);
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
class LocObjTypeInfo : public ObjTypeInfo
|
|
486
|
-
{
|
|
487
|
-
|
|
488
|
-
public:
|
|
489
|
-
/// Constructor
|
|
490
|
-
LocObjTypeInfo(const Value* val, Type* t, Size_t max) : ObjTypeInfo(val,t,max)
|
|
491
|
-
{
|
|
492
|
-
|
|
493
|
-
}
|
|
494
|
-
/// Destructor
|
|
495
|
-
virtual ~LocObjTypeInfo()
|
|
496
|
-
{
|
|
497
|
-
|
|
498
|
-
}
|
|
499
|
-
/// Get the size of this object
|
|
500
|
-
u32_t getObjSize(const Value* val);
|
|
501
|
-
|
|
502
|
-
};
|
|
503
|
-
|
|
504
462
|
} // End namespace SVF
|
|
505
463
|
|
|
506
464
|
#endif /* INCLUDE_SVF_FE_SYMBOLTABLEINFO_H_ */
|
|
@@ -53,19 +53,14 @@ class AndersenBase: public WPAConstraintSolver, public BVDataPTAImpl
|
|
|
53
53
|
public:
|
|
54
54
|
|
|
55
55
|
/// Constructor
|
|
56
|
-
|
|
56
|
+
AndersenBase(PAG* _pag, PTATY type = Andersen_BASE, bool alias_check = true)
|
|
57
57
|
: BVDataPTAImpl(_pag, type, alias_check), consCG(nullptr)
|
|
58
58
|
{
|
|
59
59
|
iterationForPrintStat = OnTheFlyIterBudgetForStat;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
/// Destructor
|
|
63
|
-
|
|
64
|
-
{
|
|
65
|
-
if (consCG != nullptr)
|
|
66
|
-
delete consCG;
|
|
67
|
-
consCG = nullptr;
|
|
68
|
-
}
|
|
63
|
+
~AndersenBase() override;
|
|
69
64
|
|
|
70
65
|
/// Andersen analysis
|
|
71
66
|
virtual void analyze() override;
|