svf-lib 1.0.1734 → 1.0.1736
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/svf/libSvfCore.a +0 -0
- package/SVF-linux/Release-build/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-linux/svf/include/MemoryModel/AccessPath.h +12 -3
- package/SVF-osx/Release-build/svf/libSvfCore.a +0 -0
- package/SVF-osx/Release-build/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-osx/svf/include/Graphs/ConsGEdge.h +1 -1
- package/SVF-osx/svf/include/MemoryModel/AccessPath.h +2 -2
- package/SVF-osx/svf/include/SVFIR/SVFStatements.h +2 -2
- package/SVF-osx/svf/include/SVFIR/SVFVariables.h +1 -1
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
@@ -65,12 +65,13 @@ public:
|
|
|
65
65
|
typedef std::vector<IdxOperandPair> IdxOperandPairs;
|
|
66
66
|
|
|
67
67
|
/// Constructor
|
|
68
|
-
AccessPath(APOffset o = 0) : fldIdx(o) {}
|
|
68
|
+
AccessPath(APOffset o = 0, const SVFType* srcTy = nullptr) : fldIdx(o), gepSourceElementType(srcTy) {}
|
|
69
69
|
|
|
70
70
|
/// Copy Constructor
|
|
71
71
|
AccessPath(const AccessPath& ap)
|
|
72
72
|
: fldIdx(ap.fldIdx),
|
|
73
|
-
idxOperandPairs(ap.getIdxOperandPairVec())
|
|
73
|
+
idxOperandPairs(ap.getIdxOperandPairVec()),
|
|
74
|
+
gepSourceElementType(ap.getGepSourceElementType())
|
|
74
75
|
{
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -84,12 +85,13 @@ public:
|
|
|
84
85
|
{
|
|
85
86
|
fldIdx = rhs.fldIdx;
|
|
86
87
|
idxOperandPairs = rhs.getIdxOperandPairVec();
|
|
88
|
+
gepSourceElementType = rhs.gepSourceElementType;
|
|
87
89
|
return *this;
|
|
88
90
|
}
|
|
89
91
|
inline bool operator==(const AccessPath& rhs) const
|
|
90
92
|
{
|
|
91
93
|
return this->fldIdx == rhs.fldIdx &&
|
|
92
|
-
this->idxOperandPairs == rhs.idxOperandPairs;
|
|
94
|
+
this->idxOperandPairs == rhs.idxOperandPairs && this->gepSourceElementType == rhs.gepSourceElementType;
|
|
93
95
|
}
|
|
94
96
|
//@}
|
|
95
97
|
|
|
@@ -107,6 +109,10 @@ public:
|
|
|
107
109
|
{
|
|
108
110
|
return idxOperandPairs;
|
|
109
111
|
}
|
|
112
|
+
inline const SVFType* getGepSourceElementType() const
|
|
113
|
+
{
|
|
114
|
+
return gepSourceElementType;
|
|
115
|
+
}
|
|
110
116
|
//@}
|
|
111
117
|
|
|
112
118
|
/**
|
|
@@ -167,6 +173,9 @@ private:
|
|
|
167
173
|
|
|
168
174
|
APOffset fldIdx; ///< Accumulated Constant Offsets
|
|
169
175
|
IdxOperandPairs idxOperandPairs; ///< a vector of actual offset in the form of <SVF Var, iterator type>
|
|
176
|
+
const SVFType* gepSourceElementType; /// source element type in gep instruction,
|
|
177
|
+
/// e.g., %f1 = getelementptr inbounds %struct.MyStruct, %struct.MyStruct* %arrayidx, i32 0, i32 0
|
|
178
|
+
/// the source element type is %struct.MyStruct
|
|
170
179
|
};
|
|
171
180
|
|
|
172
181
|
} // End namespace SVF
|
|
Binary file
|
|
Binary file
|
|
@@ -91,7 +91,7 @@ public:
|
|
|
91
91
|
|
|
92
92
|
/// Get methods
|
|
93
93
|
//@{
|
|
94
|
-
inline APOffset
|
|
94
|
+
inline APOffset getConstantStructFldIdx() const
|
|
95
95
|
{
|
|
96
96
|
return fldIdx;
|
|
97
97
|
}
|
|
@@ -172,7 +172,7 @@ template <> struct std::hash<SVF::AccessPath>
|
|
|
172
172
|
{
|
|
173
173
|
SVF::Hash<std::pair<SVF::NodeID, SVF::NodeID>> h;
|
|
174
174
|
std::hash<SVF::AccessPath::IdxOperandPairs> v;
|
|
175
|
-
return h(std::make_pair(ap.
|
|
175
|
+
return h(std::make_pair(ap.getConstantStructFldIdx(),
|
|
176
176
|
v(ap.getIdxOperandPairVec())));
|
|
177
177
|
}
|
|
178
178
|
};
|
|
@@ -516,10 +516,10 @@ public:
|
|
|
516
516
|
return getAccessPath().computeConstantOffset();
|
|
517
517
|
}
|
|
518
518
|
/// Field index of the gep statement if it access the field of a struct
|
|
519
|
-
inline APOffset
|
|
519
|
+
inline APOffset getConstantStructFldIdx() const
|
|
520
520
|
{
|
|
521
521
|
assert(isVariantFieldGep()==false && "Can't retrieve the AccessPath if using a variable field index (pointer arithmetic) for struct field access ");
|
|
522
|
-
return getAccessPath().
|
|
522
|
+
return getAccessPath().getConstantStructFldIdx();
|
|
523
523
|
}
|
|
524
524
|
/// Gep statement with a variant field index (pointer arithmetic) for struct field access
|
|
525
525
|
inline bool isVariantFieldGep() const
|