svf-lib 1.0.863 → 1.0.867
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 -24
- package/SVF-linux/include/MemoryModel/SVFVariables.h +1 -1
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +11 -10
- 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/LocationSet.h +0 -24
- package/SVF-osx/include/MemoryModel/SVFVariables.h +1 -1
- package/SVF-osx/include/MemoryModel/SymbolTableInfo.h +11 -10
- package/package.json +1 -1
|
Binary file
|
|
@@ -39,30 +39,6 @@
|
|
|
39
39
|
namespace SVF
|
|
40
40
|
{
|
|
41
41
|
|
|
42
|
-
/*!
|
|
43
|
-
* Field information of an aggregate object
|
|
44
|
-
*/
|
|
45
|
-
class FlattenedFieldInfo
|
|
46
|
-
{
|
|
47
|
-
private:
|
|
48
|
-
u32_t flattenedFldIdx;
|
|
49
|
-
const Type* flattenedElemTy;
|
|
50
|
-
public:
|
|
51
|
-
FlattenedFieldInfo(u32_t idx, const Type* ty) :
|
|
52
|
-
flattenedFldIdx(idx), flattenedElemTy(ty)
|
|
53
|
-
{
|
|
54
|
-
}
|
|
55
|
-
inline u32_t getFlattenFldIdx() const
|
|
56
|
-
{
|
|
57
|
-
return flattenedFldIdx;
|
|
58
|
-
}
|
|
59
|
-
inline const Type* getFlattenElemTy() const
|
|
60
|
-
{
|
|
61
|
-
return flattenedElemTy;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
|
|
66
42
|
/*
|
|
67
43
|
* Location set represents a set of locations in a memory block with following offsets:
|
|
68
44
|
* { offset + \sum_{i=0}^N (stride_i * j_i) | 0 \leq j_i < M_i }
|
|
@@ -503,7 +503,7 @@ public:
|
|
|
503
503
|
/// Return the type of this gep object
|
|
504
504
|
inline virtual const Type* getType() const
|
|
505
505
|
{
|
|
506
|
-
return SymbolTableInfo::SymbolInfo()->
|
|
506
|
+
return SymbolTableInfo::SymbolInfo()->getFlatternedElemType(mem->getType(), ls.accumulateConstantFieldIdx());
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
/// Return name of a LLVM value
|
|
@@ -358,13 +358,12 @@ public:
|
|
|
358
358
|
/// Flatterned element idx of an array or struct by considering stride
|
|
359
359
|
u32_t getFlattenedElemIdx(const Type *T, s64_t origId);
|
|
360
360
|
|
|
361
|
-
const std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec(const Type *T);
|
|
362
|
-
|
|
363
361
|
/// struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;
|
|
364
|
-
///
|
|
365
|
-
///
|
|
366
|
-
const Type*
|
|
367
|
-
|
|
362
|
+
/// OriginalElemType of b with field_idx 1 : Struct A
|
|
363
|
+
/// FlatternedElemType of b with field_idx 1 : int
|
|
364
|
+
const Type* getOriginalElemType(const Type* baseType, u32_t origId);
|
|
365
|
+
/// Return the type of a flattened element given a flattened index
|
|
366
|
+
const Type* getFlatternedElemType(const Type* baseType, u32_t flatten_idx);
|
|
368
367
|
//@}
|
|
369
368
|
|
|
370
369
|
/// Collect type info
|
|
@@ -381,6 +380,9 @@ public:
|
|
|
381
380
|
virtual void dump();
|
|
382
381
|
|
|
383
382
|
protected:
|
|
383
|
+
/// Return the flattened field type for struct type only
|
|
384
|
+
const std::vector<const Type*>& getFlattenFieldTypes(const StructType *T);
|
|
385
|
+
|
|
384
386
|
/// Collect the struct info
|
|
385
387
|
virtual void collectStructInfo(const StructType *T);
|
|
386
388
|
/// Collect the array info
|
|
@@ -507,7 +509,7 @@ private:
|
|
|
507
509
|
/// Types of all fields of a struct
|
|
508
510
|
Map<u32_t, const Type*> fldIdx2TypeMap;
|
|
509
511
|
/// All field infos after flattening a struct
|
|
510
|
-
std::vector<
|
|
512
|
+
std::vector<const Type*> finfo;
|
|
511
513
|
/// stride represents the number of repetitive elements if this StInfo represent an ArrayType. stride is 1 by default.
|
|
512
514
|
u32_t stride;
|
|
513
515
|
/// number of elements after flattenning (including array elements)
|
|
@@ -547,8 +549,7 @@ public:
|
|
|
547
549
|
/// OriginalFieldType of b with field_idx 1 : Struct A
|
|
548
550
|
/// FlatternedFieldType of b with field_idx 1 : int
|
|
549
551
|
//{@
|
|
550
|
-
const Type*
|
|
551
|
-
const Type* getFlatternedFieldType(u32_t fldIdx);
|
|
552
|
+
const Type* getOriginalElemType(u32_t fldIdx);
|
|
552
553
|
|
|
553
554
|
inline std::vector<u32_t>& getFlattenedFieldIdxVec()
|
|
554
555
|
{
|
|
@@ -562,7 +563,7 @@ public:
|
|
|
562
563
|
{
|
|
563
564
|
return flattenElementTypes;
|
|
564
565
|
}
|
|
565
|
-
inline std::vector<
|
|
566
|
+
inline std::vector<const Type*>& getFlattenFieldTypes()
|
|
566
567
|
{
|
|
567
568
|
return finfo;
|
|
568
569
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -39,30 +39,6 @@
|
|
|
39
39
|
namespace SVF
|
|
40
40
|
{
|
|
41
41
|
|
|
42
|
-
/*!
|
|
43
|
-
* Field information of an aggregate object
|
|
44
|
-
*/
|
|
45
|
-
class FlattenedFieldInfo
|
|
46
|
-
{
|
|
47
|
-
private:
|
|
48
|
-
u32_t flattenedFldIdx;
|
|
49
|
-
const Type* flattenedElemTy;
|
|
50
|
-
public:
|
|
51
|
-
FlattenedFieldInfo(u32_t idx, const Type* ty) :
|
|
52
|
-
flattenedFldIdx(idx), flattenedElemTy(ty)
|
|
53
|
-
{
|
|
54
|
-
}
|
|
55
|
-
inline u32_t getFlattenFldIdx() const
|
|
56
|
-
{
|
|
57
|
-
return flattenedFldIdx;
|
|
58
|
-
}
|
|
59
|
-
inline const Type* getFlattenElemTy() const
|
|
60
|
-
{
|
|
61
|
-
return flattenedElemTy;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
|
|
66
42
|
/*
|
|
67
43
|
* Location set represents a set of locations in a memory block with following offsets:
|
|
68
44
|
* { offset + \sum_{i=0}^N (stride_i * j_i) | 0 \leq j_i < M_i }
|
|
@@ -503,7 +503,7 @@ public:
|
|
|
503
503
|
/// Return the type of this gep object
|
|
504
504
|
inline virtual const Type* getType() const
|
|
505
505
|
{
|
|
506
|
-
return SymbolTableInfo::SymbolInfo()->
|
|
506
|
+
return SymbolTableInfo::SymbolInfo()->getFlatternedElemType(mem->getType(), ls.accumulateConstantFieldIdx());
|
|
507
507
|
}
|
|
508
508
|
|
|
509
509
|
/// Return name of a LLVM value
|
|
@@ -358,13 +358,12 @@ public:
|
|
|
358
358
|
/// Flatterned element idx of an array or struct by considering stride
|
|
359
359
|
u32_t getFlattenedElemIdx(const Type *T, s64_t origId);
|
|
360
360
|
|
|
361
|
-
const std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec(const Type *T);
|
|
362
|
-
|
|
363
361
|
/// struct A { int id; int salary; }; struct B { char name[20]; struct A a;} B b;
|
|
364
|
-
///
|
|
365
|
-
///
|
|
366
|
-
const Type*
|
|
367
|
-
|
|
362
|
+
/// OriginalElemType of b with field_idx 1 : Struct A
|
|
363
|
+
/// FlatternedElemType of b with field_idx 1 : int
|
|
364
|
+
const Type* getOriginalElemType(const Type* baseType, u32_t origId);
|
|
365
|
+
/// Return the type of a flattened element given a flattened index
|
|
366
|
+
const Type* getFlatternedElemType(const Type* baseType, u32_t flatten_idx);
|
|
368
367
|
//@}
|
|
369
368
|
|
|
370
369
|
/// Collect type info
|
|
@@ -381,6 +380,9 @@ public:
|
|
|
381
380
|
virtual void dump();
|
|
382
381
|
|
|
383
382
|
protected:
|
|
383
|
+
/// Return the flattened field type for struct type only
|
|
384
|
+
const std::vector<const Type*>& getFlattenFieldTypes(const StructType *T);
|
|
385
|
+
|
|
384
386
|
/// Collect the struct info
|
|
385
387
|
virtual void collectStructInfo(const StructType *T);
|
|
386
388
|
/// Collect the array info
|
|
@@ -507,7 +509,7 @@ private:
|
|
|
507
509
|
/// Types of all fields of a struct
|
|
508
510
|
Map<u32_t, const Type*> fldIdx2TypeMap;
|
|
509
511
|
/// All field infos after flattening a struct
|
|
510
|
-
std::vector<
|
|
512
|
+
std::vector<const Type*> finfo;
|
|
511
513
|
/// stride represents the number of repetitive elements if this StInfo represent an ArrayType. stride is 1 by default.
|
|
512
514
|
u32_t stride;
|
|
513
515
|
/// number of elements after flattenning (including array elements)
|
|
@@ -547,8 +549,7 @@ public:
|
|
|
547
549
|
/// OriginalFieldType of b with field_idx 1 : Struct A
|
|
548
550
|
/// FlatternedFieldType of b with field_idx 1 : int
|
|
549
551
|
//{@
|
|
550
|
-
const Type*
|
|
551
|
-
const Type* getFlatternedFieldType(u32_t fldIdx);
|
|
552
|
+
const Type* getOriginalElemType(u32_t fldIdx);
|
|
552
553
|
|
|
553
554
|
inline std::vector<u32_t>& getFlattenedFieldIdxVec()
|
|
554
555
|
{
|
|
@@ -562,7 +563,7 @@ public:
|
|
|
562
563
|
{
|
|
563
564
|
return flattenElementTypes;
|
|
564
565
|
}
|
|
565
|
-
inline std::vector<
|
|
566
|
+
inline std::vector<const Type*>& getFlattenFieldTypes()
|
|
566
567
|
{
|
|
567
568
|
return finfo;
|
|
568
569
|
}
|