svf-lib 1.0.798 → 1.0.802
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/Graphs/CHG.h +6 -6
- package/SVF-linux/include/Graphs/ConsGEdge.h +1 -1
- package/SVF-linux/include/Graphs/ConsGNode.h +16 -16
- package/SVF-linux/include/Graphs/GenericGraph.h +4 -4
- package/SVF-linux/include/Graphs/IRGraph.h +5 -5
- package/SVF-linux/include/Graphs/PTACallGraph.h +2 -2
- package/SVF-linux/include/MSSA/MSSAMuChi.h +1 -1
- package/SVF-linux/include/MSSA/MemRegion.h +2 -2
- package/SVF-linux/include/MemoryModel/LocationSet.h +10 -48
- package/SVF-linux/include/MemoryModel/PAGBuilderFromFile.h +1 -1
- package/SVF-linux/include/MemoryModel/PointerAnalysis.h +1 -1
- package/SVF-linux/include/MemoryModel/SVFIR.h +3 -3
- package/SVF-linux/include/MemoryModel/SVFStatements.h +2 -2
- package/SVF-linux/include/MemoryModel/SVFVariables.h +2 -2
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +3 -3
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +2 -2
- package/SVF-linux/include/Util/IRAnnotator.h +2 -2
- package/SVF-linux/include/Util/SVFBasicTypes.h +3 -3
- package/SVF-linux/include/WPA/Andersen.h +11 -11
- package/SVF-linux/include/WPA/AndersenSFR.h +1 -1
- package/SVF-linux/include/WPA/CSC.h +1 -1
- package/SVF-linux/include/WPA/FlowSensitive.h +13 -13
- package/SVF-linux/include/WPA/VersionedFlowSensitive.h +2 -2
- 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/Graphs/CHG.h +6 -6
- package/SVF-osx/include/Graphs/ConsGEdge.h +1 -1
- package/SVF-osx/include/Graphs/ConsGNode.h +16 -16
- package/SVF-osx/include/Graphs/GenericGraph.h +4 -4
- package/SVF-osx/include/Graphs/IRGraph.h +5 -5
- package/SVF-osx/include/Graphs/PTACallGraph.h +2 -2
- package/SVF-osx/include/MSSA/MSSAMuChi.h +1 -1
- package/SVF-osx/include/MSSA/MemRegion.h +2 -2
- package/SVF-osx/include/MemoryModel/LocationSet.h +10 -48
- package/SVF-osx/include/MemoryModel/PAGBuilderFromFile.h +1 -1
- package/SVF-osx/include/MemoryModel/PointerAnalysis.h +1 -1
- package/SVF-osx/include/MemoryModel/SVFIR.h +3 -3
- package/SVF-osx/include/MemoryModel/SVFStatements.h +2 -2
- package/SVF-osx/include/MemoryModel/SVFVariables.h +2 -2
- package/SVF-osx/include/MemoryModel/SymbolTableInfo.h +3 -3
- package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +2 -2
- package/SVF-osx/include/Util/IRAnnotator.h +2 -2
- package/SVF-osx/include/Util/SVFBasicTypes.h +2 -3
- package/SVF-osx/include/WPA/Andersen.h +11 -11
- package/SVF-osx/include/WPA/AndersenSFR.h +1 -1
- package/SVF-osx/include/WPA/CSC.h +1 -1
- package/SVF-osx/include/WPA/FlowSensitive.h +13 -13
- package/SVF-osx/include/WPA/VersionedFlowSensitive.h +2 -2
- package/package.json +1 -1
|
Binary file
|
|
@@ -238,18 +238,18 @@ public:
|
|
|
238
238
|
void view();
|
|
239
239
|
void printCH();
|
|
240
240
|
|
|
241
|
-
inline
|
|
241
|
+
inline s64_t getVirtualFunctionID(const SVFFunction* vfn) const
|
|
242
242
|
{
|
|
243
|
-
Map<const SVFFunction*,
|
|
243
|
+
Map<const SVFFunction*, s64_t>::const_iterator it =
|
|
244
244
|
virtualFunctionToIDMap.find(vfn);
|
|
245
245
|
if (it != virtualFunctionToIDMap.end())
|
|
246
246
|
return it->second;
|
|
247
247
|
else
|
|
248
248
|
return -1;
|
|
249
249
|
}
|
|
250
|
-
inline const SVFFunction* getVirtualFunctionBasedonID(
|
|
250
|
+
inline const SVFFunction* getVirtualFunctionBasedonID(s64_t id) const
|
|
251
251
|
{
|
|
252
|
-
Map<const SVFFunction*,
|
|
252
|
+
Map<const SVFFunction*, s64_t>::const_iterator it, eit;
|
|
253
253
|
for (it = virtualFunctionToIDMap.begin(), eit =
|
|
254
254
|
virtualFunctionToIDMap.end(); it != eit; ++it)
|
|
255
255
|
{
|
|
@@ -309,7 +309,7 @@ public:
|
|
|
309
309
|
private:
|
|
310
310
|
SVFModule* svfMod;
|
|
311
311
|
u32_t classNum;
|
|
312
|
-
|
|
312
|
+
s64_t vfID;
|
|
313
313
|
double buildingCHGTime;
|
|
314
314
|
Map<std::string, CHNode *> classNameToNodeMap;
|
|
315
315
|
NameToCHNodesMap classNameToDescendantsMap;
|
|
@@ -318,7 +318,7 @@ private:
|
|
|
318
318
|
NameToCHNodesMap templateNameToInstancesMap;
|
|
319
319
|
CallSiteToCHNodesMap csToClassesMap;
|
|
320
320
|
|
|
321
|
-
Map<const SVFFunction*,
|
|
321
|
+
Map<const SVFFunction*, s64_t> virtualFunctionToIDMap;
|
|
322
322
|
CallSiteToVTableSetMap csToCHAVtblsMap;
|
|
323
323
|
CallSiteToVFunSetMap csToCHAVFnsMap;
|
|
324
324
|
};
|
|
@@ -364,15 +364,15 @@ public:
|
|
|
364
364
|
//{@
|
|
365
365
|
inline void removeOutgoingAddrEdge(AddrCGEdge* outEdge)
|
|
366
366
|
{
|
|
367
|
-
|
|
368
|
-
|
|
367
|
+
u32_t num1 = addressOutEdges.erase(outEdge);
|
|
368
|
+
u32_t num2 = removeOutgoingEdge(outEdge);
|
|
369
369
|
assert((num1 && num2) && "edge not in the set, can not remove!!!");
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
inline void removeIncomingAddrEdge(AddrCGEdge* inEdge)
|
|
373
373
|
{
|
|
374
|
-
|
|
375
|
-
|
|
374
|
+
u32_t num1 = addressInEdges.erase(inEdge);
|
|
375
|
+
u32_t num2 = removeIncomingEdge(inEdge);
|
|
376
376
|
assert((num1 && num2) && "edge not in the set, can not remove!!!");
|
|
377
377
|
}
|
|
378
378
|
|
|
@@ -382,8 +382,8 @@ public:
|
|
|
382
382
|
gepOutEdges.erase(outEdge);
|
|
383
383
|
else
|
|
384
384
|
copyOutEdges.erase(outEdge);
|
|
385
|
-
|
|
386
|
-
|
|
385
|
+
u32_t num1 = directOutEdges.erase(outEdge);
|
|
386
|
+
u32_t num2 = removeOutgoingEdge(outEdge);
|
|
387
387
|
assert((num1 && num2) && "edge not in the set, can not remove!!!");
|
|
388
388
|
}
|
|
389
389
|
|
|
@@ -393,36 +393,36 @@ public:
|
|
|
393
393
|
gepInEdges.erase(inEdge);
|
|
394
394
|
else
|
|
395
395
|
copyInEdges.erase(inEdge);
|
|
396
|
-
|
|
397
|
-
|
|
396
|
+
u32_t num1 = directInEdges.erase(inEdge);
|
|
397
|
+
u32_t num2 = removeIncomingEdge(inEdge);
|
|
398
398
|
assert((num1 && num2) && "edge not in the set, can not remove!!!");
|
|
399
399
|
}
|
|
400
400
|
|
|
401
401
|
inline void removeOutgoingLoadEdge(LoadCGEdge* outEdge)
|
|
402
402
|
{
|
|
403
|
-
|
|
404
|
-
|
|
403
|
+
u32_t num1 = loadOutEdges.erase(outEdge);
|
|
404
|
+
u32_t num2 = removeOutgoingEdge(outEdge);
|
|
405
405
|
assert((num1 && num2) && "edge not in the set, can not remove!!!");
|
|
406
406
|
}
|
|
407
407
|
|
|
408
408
|
inline void removeIncomingLoadEdge(LoadCGEdge* inEdge)
|
|
409
409
|
{
|
|
410
|
-
|
|
411
|
-
|
|
410
|
+
u32_t num1 = loadInEdges.erase(inEdge);
|
|
411
|
+
u32_t num2 = removeIncomingEdge(inEdge);
|
|
412
412
|
assert((num1 && num2) && "edge not in the set, can not remove!!!");
|
|
413
413
|
}
|
|
414
414
|
|
|
415
415
|
inline void removeOutgoingStoreEdge(StoreCGEdge* outEdge)
|
|
416
416
|
{
|
|
417
|
-
|
|
418
|
-
|
|
417
|
+
u32_t num1 = storeOutEdges.erase(outEdge);
|
|
418
|
+
u32_t num2 = removeOutgoingEdge(outEdge);
|
|
419
419
|
assert((num1 && num2) && "edge not in the set, can not remove!!!");
|
|
420
420
|
}
|
|
421
421
|
|
|
422
422
|
inline void removeIncomingStoreEdge(StoreCGEdge* inEdge)
|
|
423
423
|
{
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
u32_t num1 = storeInEdges.erase(inEdge);
|
|
425
|
+
u32_t num2 = removeIncomingEdge(inEdge);
|
|
426
426
|
assert((num1 && num2) && "edge not in the set, can not remove!!!");
|
|
427
427
|
}
|
|
428
428
|
//@}
|
|
@@ -50,7 +50,7 @@ public:
|
|
|
50
50
|
/// (1) 0-7 bits encode an edge kind (allow maximum 16 kinds)
|
|
51
51
|
/// (2) 8-63 bits encode a callsite instruction
|
|
52
52
|
typedef u64_t GEdgeFlag;
|
|
53
|
-
typedef
|
|
53
|
+
typedef s64_t GEdgeKind;
|
|
54
54
|
private:
|
|
55
55
|
NodeTy* src; ///< source node
|
|
56
56
|
NodeTy* dst; ///< destination node
|
|
@@ -132,7 +132,7 @@ public:
|
|
|
132
132
|
typedef NodeTy NodeType;
|
|
133
133
|
typedef EdgeTy EdgeType;
|
|
134
134
|
/// Edge kind
|
|
135
|
-
typedef
|
|
135
|
+
typedef s64_t GNodeK;
|
|
136
136
|
typedef OrderedSet<EdgeType*, typename EdgeType::equalGEdge> GEdgeSetTy;
|
|
137
137
|
/// Edge iterator
|
|
138
138
|
///@{
|
|
@@ -284,13 +284,13 @@ public:
|
|
|
284
284
|
|
|
285
285
|
/// Remove incoming and outgoing edges
|
|
286
286
|
///@{
|
|
287
|
-
inline
|
|
287
|
+
inline u32_t removeIncomingEdge(EdgeType* edge)
|
|
288
288
|
{
|
|
289
289
|
iterator it = InEdges.find(edge);
|
|
290
290
|
assert(it != InEdges.end() && "can not find in edge in SVFG node");
|
|
291
291
|
return InEdges.erase(edge);
|
|
292
292
|
}
|
|
293
|
-
inline
|
|
293
|
+
inline u32_t removeOutgoingEdge(EdgeType* edge)
|
|
294
294
|
{
|
|
295
295
|
iterator it = OutEdges.find(edge);
|
|
296
296
|
assert(it != OutEdges.end() && "can not find out edge in SVFG node");
|
|
@@ -166,11 +166,11 @@ public:
|
|
|
166
166
|
return symInfo->getConstantObj();
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
inline
|
|
169
|
+
inline u32_t getValueNodeNum() const
|
|
170
170
|
{
|
|
171
171
|
return symInfo->valSyms().size();
|
|
172
172
|
}
|
|
173
|
-
inline
|
|
173
|
+
inline u32_t getObjectNodeNum() const
|
|
174
174
|
{
|
|
175
175
|
return symInfo->idToObjMap().size();
|
|
176
176
|
}
|
|
@@ -183,15 +183,15 @@ public:
|
|
|
183
183
|
nodeNumAfterPAGBuild = num;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
inline
|
|
186
|
+
inline u32_t getPAGNodeNum() const
|
|
187
187
|
{
|
|
188
188
|
return nodeNum;
|
|
189
189
|
}
|
|
190
|
-
inline
|
|
190
|
+
inline u32_t getPAGEdgeNum() const
|
|
191
191
|
{
|
|
192
192
|
return edgeNum;
|
|
193
193
|
}
|
|
194
|
-
inline
|
|
194
|
+
inline u32_t getPTAPAGEdgeNum() const
|
|
195
195
|
{
|
|
196
196
|
return totalPTAPAGEdge;
|
|
197
197
|
}
|
|
@@ -251,7 +251,7 @@ protected:
|
|
|
251
251
|
CallInstToCallGraphEdgesMap callinstToCallGraphEdgesMap; ///< Map a call instruction to its corresponding call edges
|
|
252
252
|
|
|
253
253
|
NodeID callGraphNodeNum;
|
|
254
|
-
|
|
254
|
+
u32_t numOfResolvedIndCallEdge;
|
|
255
255
|
|
|
256
256
|
/// Clean up memory
|
|
257
257
|
void destroy();
|
|
@@ -297,7 +297,7 @@ public:
|
|
|
297
297
|
return totalCallSiteNum;
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
inline
|
|
300
|
+
inline u32_t getNumOfResolvedIndCallEdge() const
|
|
301
301
|
{
|
|
302
302
|
return numOfResolvedIndCallEdge;
|
|
303
303
|
}
|
|
@@ -55,7 +55,7 @@ public:
|
|
|
55
55
|
typedef bool Condition;
|
|
56
56
|
private:
|
|
57
57
|
/// region ID 0 is reserved
|
|
58
|
-
static
|
|
58
|
+
static u32_t totalMRNum;
|
|
59
59
|
MRID rid;
|
|
60
60
|
const NodeBS cptsSet;
|
|
61
61
|
|
|
@@ -413,7 +413,7 @@ protected:
|
|
|
413
413
|
//@}
|
|
414
414
|
|
|
415
415
|
public:
|
|
416
|
-
inline
|
|
416
|
+
inline u32_t getMRNum() const
|
|
417
417
|
{
|
|
418
418
|
return memRegSet.size();
|
|
419
419
|
}
|
|
@@ -78,10 +78,10 @@ public:
|
|
|
78
78
|
NonOverlap, Overlap, Subset, Superset, Same
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
typedef std::vector<const Value
|
|
81
|
+
typedef std::vector<std::pair<const Value*, const Type*> > OffsetValueVec;
|
|
82
82
|
|
|
83
83
|
/// Constructor
|
|
84
|
-
LocationSet(
|
|
84
|
+
LocationSet(s64_t o = 0) : fldIdx(o)
|
|
85
85
|
{}
|
|
86
86
|
|
|
87
87
|
/// Copy Constructor
|
|
@@ -98,50 +98,16 @@ public:
|
|
|
98
98
|
|
|
99
99
|
~LocationSet() {}
|
|
100
100
|
|
|
101
|
-
|
|
102
101
|
/// Overload operators
|
|
103
102
|
//@{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
LocationSet ls(rhs);
|
|
107
|
-
ls.fldIdx += accumulateConstantFieldIdx();
|
|
108
|
-
OffsetValueVec::const_iterator it = getOffsetValueVec().begin();
|
|
109
|
-
OffsetValueVec::const_iterator eit = getOffsetValueVec().end();
|
|
110
|
-
for (; it != eit; ++it)
|
|
111
|
-
ls.addOffsetValue(*it);
|
|
112
|
-
|
|
113
|
-
return ls;
|
|
114
|
-
}
|
|
103
|
+
LocationSet operator+ (const LocationSet& rhs) const;
|
|
104
|
+
bool operator< (const LocationSet& rhs) const;
|
|
115
105
|
inline const LocationSet& operator= (const LocationSet& rhs)
|
|
116
106
|
{
|
|
117
107
|
fldIdx = rhs.fldIdx;
|
|
118
108
|
offsetValues = rhs.getOffsetValueVec();
|
|
119
109
|
return *this;
|
|
120
110
|
}
|
|
121
|
-
inline bool operator< (const LocationSet& rhs) const
|
|
122
|
-
{
|
|
123
|
-
if (fldIdx != rhs.fldIdx)
|
|
124
|
-
return (fldIdx < rhs.fldIdx);
|
|
125
|
-
else
|
|
126
|
-
{
|
|
127
|
-
const OffsetValueVec& pairVec = getOffsetValueVec();
|
|
128
|
-
const OffsetValueVec& rhsPairVec = rhs.getOffsetValueVec();
|
|
129
|
-
if (pairVec.size() != rhsPairVec.size())
|
|
130
|
-
return (pairVec.size() < rhsPairVec.size());
|
|
131
|
-
else
|
|
132
|
-
{
|
|
133
|
-
OffsetValueVec::const_iterator it = pairVec.begin();
|
|
134
|
-
OffsetValueVec::const_iterator rhsIt = rhsPairVec.begin();
|
|
135
|
-
for (; it != pairVec.end() && rhsIt != rhsPairVec.end(); ++it, ++rhsIt)
|
|
136
|
-
{
|
|
137
|
-
return (*it) < (*rhsIt);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
111
|
inline bool operator==(const LocationSet& rhs) const
|
|
146
112
|
{
|
|
147
113
|
return this->fldIdx == rhs.fldIdx
|
|
@@ -151,11 +117,11 @@ public:
|
|
|
151
117
|
|
|
152
118
|
/// Get methods
|
|
153
119
|
//@{
|
|
154
|
-
inline
|
|
120
|
+
inline s64_t accumulateConstantFieldIdx() const
|
|
155
121
|
{
|
|
156
122
|
return fldIdx;
|
|
157
123
|
}
|
|
158
|
-
inline void setFldIdx(
|
|
124
|
+
inline void setFldIdx(s64_t idx)
|
|
159
125
|
{
|
|
160
126
|
fldIdx = idx;
|
|
161
127
|
}
|
|
@@ -165,7 +131,9 @@ public:
|
|
|
165
131
|
}
|
|
166
132
|
//@}
|
|
167
133
|
|
|
168
|
-
|
|
134
|
+
s64_t accumulateConstantOffset() const;
|
|
135
|
+
|
|
136
|
+
bool addOffsetValue(const Value* offsetValue, const Type* type);
|
|
169
137
|
|
|
170
138
|
/// Return TRUE if this is a constant location set.
|
|
171
139
|
bool isConstantOffset() const;
|
|
@@ -187,13 +155,7 @@ private:
|
|
|
187
155
|
/// Compute all possible locations according to offset and number-stride pairs.
|
|
188
156
|
NodeBS computeAllLocations() const;
|
|
189
157
|
|
|
190
|
-
|
|
191
|
-
inline unsigned gcd (unsigned n1, unsigned n2) const
|
|
192
|
-
{
|
|
193
|
-
return (n2 == 0) ? n1 : gcd (n2, n1 % n2);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
Size_t fldIdx; ///< Accumulated Constant Offsets
|
|
158
|
+
s64_t fldIdx; ///< Accumulated Constant Offsets
|
|
197
159
|
OffsetValueVec offsetValues; ///< a vector of actual offset in the form of Values
|
|
198
160
|
};
|
|
199
161
|
|
|
@@ -170,7 +170,7 @@ public:
|
|
|
170
170
|
return pag->getICFG();
|
|
171
171
|
}
|
|
172
172
|
/// Return number of resolved indirect call edges
|
|
173
|
-
inline
|
|
173
|
+
inline u32_t getNumOfResolvedIndCallEdge() const
|
|
174
174
|
{
|
|
175
175
|
return getPTACallGraph()->getNumOfResolvedIndCallEdge();
|
|
176
176
|
}
|
|
@@ -63,7 +63,7 @@ public:
|
|
|
63
63
|
typedef Map<const SVFFunction*,SVFStmtSet> FunToPAGEdgeSetMap;
|
|
64
64
|
typedef Map<const ICFGNode*,SVFStmtList> ICFGNode2SVFStmtsMap;
|
|
65
65
|
typedef Map<NodeID, NodeID> NodeToNodeMap;
|
|
66
|
-
typedef std::pair<NodeID,
|
|
66
|
+
typedef std::pair<NodeID, s64_t> NodeOffset;
|
|
67
67
|
typedef std::pair<NodeID, LocationSet> NodeLocationSet;
|
|
68
68
|
typedef Map<NodeOffset,NodeID> NodeOffsetMap;
|
|
69
69
|
typedef Map<NodeLocationSet,NodeID> NodeLocationSetMap;
|
|
@@ -281,11 +281,11 @@ public:
|
|
|
281
281
|
|
|
282
282
|
/// Node and edge statistics
|
|
283
283
|
//@{
|
|
284
|
-
inline
|
|
284
|
+
inline u32_t getFieldValNodeNum() const
|
|
285
285
|
{
|
|
286
286
|
return GepValObjMap.size();
|
|
287
287
|
}
|
|
288
|
-
inline
|
|
288
|
+
inline u32_t getFieldObjNodeNum() const
|
|
289
289
|
{
|
|
290
290
|
return GepObjVarMap.size();
|
|
291
291
|
}
|
|
@@ -62,7 +62,7 @@ private:
|
|
|
62
62
|
ICFGNode *icfgNode; ///< ICFGNode
|
|
63
63
|
EdgeID edgeId; ///< Edge ID
|
|
64
64
|
public:
|
|
65
|
-
static
|
|
65
|
+
static u32_t totalEdgeNum; ///< Total edge number
|
|
66
66
|
|
|
67
67
|
/// Constructor
|
|
68
68
|
SVFStmt(SVFVar* s, SVFVar* d, GEdgeFlag k);
|
|
@@ -489,7 +489,7 @@ public:
|
|
|
489
489
|
{}
|
|
490
490
|
|
|
491
491
|
/// offset of the gep edge
|
|
492
|
-
inline
|
|
492
|
+
inline s64_t getFieldOffset() const
|
|
493
493
|
{
|
|
494
494
|
return getLocationSet().accumulateConstantFieldIdx();
|
|
495
495
|
}
|
|
@@ -422,7 +422,7 @@ public:
|
|
|
422
422
|
}
|
|
423
423
|
|
|
424
424
|
/// offset of the base value variable
|
|
425
|
-
inline
|
|
425
|
+
inline s64_t getFieldOffset() const
|
|
426
426
|
{
|
|
427
427
|
return ls.accumulateConstantFieldIdx();
|
|
428
428
|
}
|
|
@@ -497,7 +497,7 @@ public:
|
|
|
497
497
|
}
|
|
498
498
|
|
|
499
499
|
/// offset of the mem object
|
|
500
|
-
inline
|
|
500
|
+
inline s64_t getFieldOffset() const
|
|
501
501
|
{
|
|
502
502
|
return ls.accumulateConstantFieldIdx();
|
|
503
503
|
}
|
|
@@ -302,7 +302,7 @@ public:
|
|
|
302
302
|
|
|
303
303
|
/// Statistics
|
|
304
304
|
//@{
|
|
305
|
-
inline
|
|
305
|
+
inline u32_t getTotalSymNum() const
|
|
306
306
|
{
|
|
307
307
|
return totalSymNum;
|
|
308
308
|
}
|
|
@@ -454,7 +454,7 @@ public:
|
|
|
454
454
|
const Type* getType() const;
|
|
455
455
|
|
|
456
456
|
/// Get max field offset limit
|
|
457
|
-
|
|
457
|
+
u32_t getMaxFieldOffsetLimit() const;
|
|
458
458
|
|
|
459
459
|
/// Return true if its field limit is 0
|
|
460
460
|
bool isFieldInsensitive() const;
|
|
@@ -601,7 +601,7 @@ private:
|
|
|
601
601
|
/// LLVM type
|
|
602
602
|
const Type* type;
|
|
603
603
|
/// Type flags
|
|
604
|
-
|
|
604
|
+
u32_t flags;
|
|
605
605
|
/// Max offset for flexible field sensitive analysis
|
|
606
606
|
/// maximum number of field object can be created
|
|
607
607
|
/// minimum number is 0 (field insensitive analysis)
|
|
@@ -73,7 +73,7 @@ public:
|
|
|
73
73
|
//@{
|
|
74
74
|
void initialiseNodes();
|
|
75
75
|
void addEdge(NodeID src, NodeID dst, PAGEdge::PEDGEK kind,
|
|
76
|
-
|
|
76
|
+
s64_t offset = 0, Instruction* cs = nullptr);
|
|
77
77
|
// @}
|
|
78
78
|
|
|
79
79
|
/// Sanity check for SVFIR
|
|
@@ -122,7 +122,7 @@ public:
|
|
|
122
122
|
void processCE(const Value *val);
|
|
123
123
|
|
|
124
124
|
/// Infer field index from byteoffset.
|
|
125
|
-
u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls,
|
|
125
|
+
u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s64_t idx);
|
|
126
126
|
|
|
127
127
|
/// Compute offset of a gep instruction or gep constant expression
|
|
128
128
|
bool computeGepOffset(const User *V, LocationSet& ls);
|
|
@@ -85,7 +85,7 @@ private:
|
|
|
85
85
|
{
|
|
86
86
|
std::string label = it->getName().str();
|
|
87
87
|
std::string toErase = "gepnode-";
|
|
88
|
-
SVF::
|
|
88
|
+
SVF::s64_t pos = label.find(toErase);
|
|
89
89
|
if (pos == std::string::npos)
|
|
90
90
|
{
|
|
91
91
|
continue;
|
|
@@ -96,7 +96,7 @@ private:
|
|
|
96
96
|
auto mdNode = it->getOperand(0);
|
|
97
97
|
|
|
98
98
|
SVF::NodeID baseNodeId = std::stoi(llvm::cast<llvm::MDString>(mdNode->getOperand(0))->getString().str());
|
|
99
|
-
SVF::
|
|
99
|
+
SVF::s64_t locationSetOffset = std::stoi(llvm::cast<llvm::MDString>(mdNode->getOperand(1))->getString().str());
|
|
100
100
|
|
|
101
101
|
LocationSet locationSet = LocationSet(locationSetOffset);
|
|
102
102
|
SVF::NodeID gepnodeId = pag->getGepObjVar(baseNodeId, locationSet);
|
|
@@ -73,9 +73,9 @@ template <class T> struct Hash {
|
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
typedef unsigned u32_t;
|
|
76
|
-
typedef unsigned long long u64_t;
|
|
77
76
|
typedef signed s32_t;
|
|
78
|
-
typedef
|
|
77
|
+
typedef unsigned long long u64_t;
|
|
78
|
+
typedef signed s64_t;
|
|
79
79
|
|
|
80
80
|
typedef u32_t NodeID;
|
|
81
81
|
typedef u32_t EdgeID;
|
|
@@ -183,7 +183,7 @@ class SVFValue
|
|
|
183
183
|
{
|
|
184
184
|
|
|
185
185
|
public:
|
|
186
|
-
typedef
|
|
186
|
+
typedef s64_t GNodeK;
|
|
187
187
|
|
|
188
188
|
enum SVFValKind
|
|
189
189
|
{
|
|
@@ -119,20 +119,20 @@ public:
|
|
|
119
119
|
|
|
120
120
|
/// Statistics
|
|
121
121
|
//@{
|
|
122
|
-
static
|
|
123
|
-
static
|
|
124
|
-
static
|
|
125
|
-
static
|
|
126
|
-
static
|
|
127
|
-
static
|
|
128
|
-
static
|
|
129
|
-
|
|
130
|
-
static
|
|
122
|
+
static u32_t numOfProcessedAddr; /// Number of processed Addr edge
|
|
123
|
+
static u32_t numOfProcessedCopy; /// Number of processed Copy edge
|
|
124
|
+
static u32_t numOfProcessedGep; /// Number of processed Gep edge
|
|
125
|
+
static u32_t numOfProcessedLoad; /// Number of processed Load edge
|
|
126
|
+
static u32_t numOfProcessedStore; /// Number of processed Store edge
|
|
127
|
+
static u32_t numOfSfrs;
|
|
128
|
+
static u32_t numOfFieldExpand;
|
|
129
|
+
|
|
130
|
+
static u32_t numOfSCCDetection;
|
|
131
131
|
static double timeOfSCCDetection;
|
|
132
132
|
static double timeOfSCCMerges;
|
|
133
133
|
static double timeOfCollapse;
|
|
134
|
-
static
|
|
135
|
-
static
|
|
134
|
+
static u32_t AveragePointsToSetSize;
|
|
135
|
+
static u32_t MaxPointsToSetSize;
|
|
136
136
|
static double timeOfProcessCopyGep;
|
|
137
137
|
static double timeOfProcessLoadStore;
|
|
138
138
|
static double timeOfUpdateCallGraph;
|
|
@@ -149,7 +149,7 @@ public:
|
|
|
149
149
|
protected:
|
|
150
150
|
void initialize();
|
|
151
151
|
void PWCDetect();
|
|
152
|
-
void fieldExpand(NodeSet& initials,
|
|
152
|
+
void fieldExpand(NodeSet& initials, s64_t offset, NodeBS& strides, PointsTo& expandPts);
|
|
153
153
|
bool processGepPts(PointsTo& pts, const GepCGEdge* edge);
|
|
154
154
|
bool mergeSrcToTgt(NodeID nodeId, NodeID newRepId);
|
|
155
155
|
|
|
@@ -288,19 +288,19 @@ protected:
|
|
|
288
288
|
|
|
289
289
|
/// Statistics.
|
|
290
290
|
//@{
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
291
|
+
u32_t numOfProcessedAddr; /// Number of processed Addr node
|
|
292
|
+
u32_t numOfProcessedCopy; /// Number of processed Copy node
|
|
293
|
+
u32_t numOfProcessedGep; /// Number of processed Gep node
|
|
294
|
+
u32_t numOfProcessedPhi; /// Number of processed Phi node
|
|
295
|
+
u32_t numOfProcessedLoad; /// Number of processed Load node
|
|
296
|
+
u32_t numOfProcessedStore; /// Number of processed Store node
|
|
297
|
+
u32_t numOfProcessedActualParam; /// Number of processed actual param node
|
|
298
|
+
u32_t numOfProcessedFormalRet; /// Number of processed formal ret node
|
|
299
|
+
u32_t numOfProcessedMSSANode; /// Number of processed mssa node
|
|
300
|
+
|
|
301
|
+
u32_t maxSCCSize;
|
|
302
|
+
u32_t numOfSCC;
|
|
303
|
+
u32_t numOfNodesInSCC;
|
|
304
304
|
|
|
305
305
|
double solveTime; ///< time of solve.
|
|
306
306
|
double sccTime; ///< time of SCC detection.
|
|
@@ -223,8 +223,8 @@ private:
|
|
|
223
223
|
|
|
224
224
|
/// Additional statistics.
|
|
225
225
|
//@{
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
u32_t numPrelabeledNodes; ///< Number of prelabeled nodes.
|
|
227
|
+
u32_t numPrelabelVersions; ///< Number of versions created during prelabeling.
|
|
228
228
|
|
|
229
229
|
double prelabelingTime; ///< Time to prelabel SVFG.
|
|
230
230
|
double meldLabelingTime; ///< Time to meld label SVFG.
|
|
Binary file
|
|
Binary file
|