svf-lib 1.0.992 → 1.0.993
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/CFL/CFGNormalizer.h +6 -3
- package/SVF-linux/include/CFL/CFLAlias.h +26 -15
- package/SVF-linux/include/CFL/CFLGrammar.h +30 -16
- package/SVF-linux/include/CFL/CFLSolver.h +9 -5
- package/SVF-linux/include/CFL/GrammarBuilder.h +10 -7
- package/SVF-linux/include/CUDD/cudd.h +20 -11
- package/SVF-linux/include/CUDD/cuddInt.h +48 -31
- package/SVF-linux/include/CUDD/epd.h +35 -29
- package/SVF-linux/include/CUDD/mtr.h +4 -3
- package/SVF-linux/include/CUDD/st.h +7 -4
- package/SVF-linux/include/CUDD/util.h +6 -6
- package/SVF-linux/include/FastCluster/fastcluster.h +13 -12
- package/SVF-linux/include/Graphs/CFLGraph.h +16 -10
- package/SVF-linux/include/Graphs/CHG.h +2 -2
- package/SVF-linux/include/Graphs/ConsG.h +2 -1
- package/SVF-linux/include/Graphs/GenericGraph.h +3 -3
- package/SVF-linux/include/Graphs/ICFG.h +2 -2
- package/SVF-linux/include/Graphs/ICFGEdge.h +16 -9
- package/SVF-linux/include/Graphs/ICFGNode.h +2 -2
- package/SVF-linux/include/Graphs/IRGraph.h +10 -6
- package/SVF-linux/include/Graphs/PTACallGraph.h +1 -1
- package/SVF-linux/include/Graphs/SVFG.h +4 -3
- package/SVF-linux/include/Graphs/SVFGNode.h +14 -8
- package/SVF-linux/include/Graphs/ThreadCallGraph.h +4 -2
- package/SVF-linux/include/Graphs/VFG.h +45 -39
- package/SVF-linux/include/Graphs/VFGNode.h +8 -4
- package/SVF-linux/include/MSSA/MemSSA.h +1 -1
- package/SVF-linux/include/MTA/FSMPTA.h +55 -44
- package/SVF-linux/include/MTA/LockAnalysis.h +11 -9
- package/SVF-linux/include/MTA/LockResultValidator.h +64 -54
- package/SVF-linux/include/MTA/MHP.h +17 -13
- package/SVF-linux/include/MTA/MTAResultValidator.h +24 -20
- package/SVF-linux/include/MTA/PCG.h +9 -7
- package/SVF-linux/include/MTA/TCT.h +27 -22
- package/SVF-linux/include/MemoryModel/LocationSet.h +5 -3
- package/SVF-linux/include/MemoryModel/PersistentPointsToCache.h +28 -13
- package/SVF-linux/include/MemoryModel/PersistentPointsToDS.h +2 -2
- package/SVF-linux/include/MemoryModel/PointerAnalysis.h +5 -4
- package/SVF-linux/include/MemoryModel/PointsTo.h +8 -2
- package/SVF-linux/include/MemoryModel/SVFIR.h +6 -5
- package/SVF-linux/include/MemoryModel/SVFStatements.h +65 -45
- package/SVF-linux/include/MemoryModel/SVFVariables.h +6 -5
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +18 -15
- package/SVF-linux/include/SABER/PathCondAllocator.h +14 -7
- package/SVF-linux/include/SABER/ProgSlice.h +2 -1
- package/SVF-linux/include/SABER/SaberSVFGBuilder.h +1 -1
- package/SVF-linux/include/SABER/SrcSnkDDA.h +8 -4
- package/SVF-linux/include/SVF-FE/CHGBuilder.h +4 -2
- package/SVF-linux/include/SVF-FE/DataFlowUtil.h +10 -9
- package/SVF-linux/include/SVF-FE/IRAnnotator.h +8 -8
- package/SVF-linux/include/SVF-FE/LLVMModule.h +13 -12
- package/SVF-linux/include/SVF-FE/LLVMUtil.h +4 -4
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +13 -9
- package/SVF-linux/include/SVF-FE/SymbolTableBuilder.h +3 -2
- package/SVF-linux/include/Util/BDDExpr.h +32 -16
- package/SVF-linux/include/Util/BasicTypes.h +77 -25
- package/SVF-linux/include/Util/CoreBitVector.h +2 -1
- package/SVF-linux/include/Util/CxtStmt.h +37 -27
- package/SVF-linux/include/Util/ExeState.h +42 -22
- package/SVF-linux/include/Util/ExtAPI.h +1 -1
- package/SVF-linux/include/Util/NodeIDAllocator.h +7 -4
- package/SVF-linux/include/Util/Options.h +3 -3
- package/SVF-linux/include/Util/SVFBasicTypes.h +49 -40
- package/SVF-linux/include/Util/SVFModule.h +5 -5
- package/SVF-linux/include/Util/SVFUtil.h +12 -9
- package/SVF-linux/include/Util/Z3Expr.h +191 -144
- package/SVF-linux/include/WPA/Andersen.h +11 -11
- package/SVF-linux/include/WPA/VersionedFlowSensitive.h +4 -1
- package/package.json +1 -1
|
@@ -31,12 +31,14 @@
|
|
|
31
31
|
#include "Util/Z3Expr.h"
|
|
32
32
|
#include "MemoryModel/SVFVariables.h"
|
|
33
33
|
|
|
34
|
-
namespace SVF
|
|
34
|
+
namespace SVF
|
|
35
|
+
{
|
|
35
36
|
|
|
36
37
|
#define AddressMask 0x7f000000
|
|
37
38
|
#define FlippedAddressMask (AddressMask^0xffffffff)
|
|
38
39
|
|
|
39
|
-
class ExeState
|
|
40
|
+
class ExeState
|
|
41
|
+
{
|
|
40
42
|
public:
|
|
41
43
|
typedef Map<u32_t, Z3Expr> VarToValMap;
|
|
42
44
|
typedef VarToValMap LocToValMap;
|
|
@@ -50,11 +52,12 @@ public:
|
|
|
50
52
|
ExeState() : pathConstraint(getContext().bool_val(true)) {}
|
|
51
53
|
|
|
52
54
|
ExeState(const Z3Expr &_pc, VarToValMap &_varToValMap, LocToValMap &_locToValMap) : varToVal(_varToValMap),
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
locToVal(_locToValMap),
|
|
56
|
+
pathConstraint(_pc) {}
|
|
55
57
|
|
|
56
58
|
ExeState(const ExeState &rhs) : varToVal(rhs.getVarToVal()), locToVal(rhs.getLocToVal()),
|
|
57
|
-
|
|
59
|
+
pathConstraint(rhs.getPathConstraint())
|
|
60
|
+
{
|
|
58
61
|
|
|
59
62
|
}
|
|
60
63
|
|
|
@@ -66,7 +69,8 @@ public:
|
|
|
66
69
|
bool operator==(const ExeState &rhs) const;
|
|
67
70
|
|
|
68
71
|
/// Overloading Operator!=
|
|
69
|
-
inline bool operator!=(const ExeState &rhs) const
|
|
72
|
+
inline bool operator!=(const ExeState &rhs) const
|
|
73
|
+
{
|
|
70
74
|
return !(*this == rhs);
|
|
71
75
|
}
|
|
72
76
|
|
|
@@ -75,27 +79,33 @@ public:
|
|
|
75
79
|
|
|
76
80
|
|
|
77
81
|
|
|
78
|
-
z3::context &getContext()
|
|
82
|
+
z3::context &getContext()
|
|
83
|
+
{
|
|
79
84
|
return Z3Expr::getContext();
|
|
80
85
|
}
|
|
81
86
|
|
|
82
|
-
const VarToValMap &getVarToVal() const
|
|
87
|
+
const VarToValMap &getVarToVal() const
|
|
88
|
+
{
|
|
83
89
|
return varToVal;
|
|
84
90
|
}
|
|
85
91
|
|
|
86
|
-
const LocToValMap &getLocToVal() const
|
|
92
|
+
const LocToValMap &getLocToVal() const
|
|
93
|
+
{
|
|
87
94
|
return locToVal;
|
|
88
95
|
}
|
|
89
96
|
|
|
90
|
-
const Z3Expr &getPathConstraint() const
|
|
97
|
+
const Z3Expr &getPathConstraint() const
|
|
98
|
+
{
|
|
91
99
|
return pathConstraint;
|
|
92
100
|
}
|
|
93
101
|
|
|
94
|
-
void setPathConstraint(const Z3Expr &pc)
|
|
102
|
+
void setPathConstraint(const Z3Expr &pc)
|
|
103
|
+
{
|
|
95
104
|
pathConstraint = pc.simplify();
|
|
96
105
|
}
|
|
97
106
|
|
|
98
|
-
inline Z3Expr &operator[](u32_t varId)
|
|
107
|
+
inline Z3Expr &operator[](u32_t varId)
|
|
108
|
+
{
|
|
99
109
|
return getZ3Expr(varId);
|
|
100
110
|
}
|
|
101
111
|
|
|
@@ -115,22 +125,26 @@ public:
|
|
|
115
125
|
Z3Expr &load(const Z3Expr &loc);
|
|
116
126
|
|
|
117
127
|
/// The physical address starts with 0x7f...... + idx
|
|
118
|
-
inline u32_t getVirtualMemAddress(u32_t idx) const
|
|
128
|
+
inline u32_t getVirtualMemAddress(u32_t idx) const
|
|
129
|
+
{
|
|
119
130
|
return AddressMask + idx;
|
|
120
131
|
}
|
|
121
132
|
|
|
122
133
|
/// Check bit value of val start with 0x7F000000, filter by 0xFF000000
|
|
123
|
-
inline bool isVirtualMemAddress(u32_t val)
|
|
134
|
+
inline bool isVirtualMemAddress(u32_t val)
|
|
135
|
+
{
|
|
124
136
|
return (val & 0xff000000) == AddressMask;
|
|
125
137
|
}
|
|
126
138
|
|
|
127
139
|
/// Return the internal index if idx is an address otherwise return the value of idx
|
|
128
|
-
inline u32_t getInternalID(u32_t idx) const
|
|
140
|
+
inline u32_t getInternalID(u32_t idx) const
|
|
141
|
+
{
|
|
129
142
|
return (idx & FlippedAddressMask);
|
|
130
143
|
}
|
|
131
144
|
|
|
132
145
|
/// Return int value from an expression if it is a numeral, otherwise return an approximate value
|
|
133
|
-
inline s32_t z3Expr2NumValue(const Z3Expr &e)
|
|
146
|
+
inline s32_t z3Expr2NumValue(const Z3Expr &e)
|
|
147
|
+
{
|
|
134
148
|
assert(e.is_numeral() && "not numeral?");
|
|
135
149
|
return e.get_numeral_int64();
|
|
136
150
|
}
|
|
@@ -142,30 +156,36 @@ private:
|
|
|
142
156
|
bool eqVarToValMap(const VarToValMap &lhs, const VarToValMap &rhs) const;
|
|
143
157
|
bool lessThanVarToValMap(const VarToValMap &lhs, const VarToValMap &rhs) const;
|
|
144
158
|
protected:
|
|
145
|
-
inline void store(u32_t objId, const Z3Expr &z3Expr)
|
|
159
|
+
inline void store(u32_t objId, const Z3Expr &z3Expr)
|
|
160
|
+
{
|
|
146
161
|
locToVal[objId] = z3Expr.simplify();
|
|
147
162
|
}
|
|
148
163
|
|
|
149
|
-
inline Z3Expr &load(u32_t objId)
|
|
164
|
+
inline Z3Expr &load(u32_t objId)
|
|
165
|
+
{
|
|
150
166
|
return locToVal[objId];
|
|
151
167
|
}
|
|
152
168
|
};
|
|
153
169
|
}
|
|
154
170
|
|
|
155
171
|
template<>
|
|
156
|
-
struct std::hash<SVF::ExeState>
|
|
157
|
-
|
|
172
|
+
struct std::hash<SVF::ExeState>
|
|
173
|
+
{
|
|
174
|
+
size_t operator()(const SVF::ExeState &exeState) const
|
|
175
|
+
{
|
|
158
176
|
|
|
159
177
|
size_t h = exeState.getVarToVal().size() * 2;
|
|
160
178
|
SVF::Hash<SVF::u32_t> hf;
|
|
161
|
-
for (const auto &t: exeState.getVarToVal())
|
|
179
|
+
for (const auto &t: exeState.getVarToVal())
|
|
180
|
+
{
|
|
162
181
|
h ^= hf(t.first) + 0x9e3779b9 + (h << 6) + (h >> 2);
|
|
163
182
|
h ^= hf(t.second.id()) + 0x9e3779b9 + (h << 6) + (h >> 2);
|
|
164
183
|
}
|
|
165
184
|
|
|
166
185
|
size_t h2 = exeState.getVarToVal().size() * 2;
|
|
167
186
|
|
|
168
|
-
for (const auto &t: exeState.getLocToVal())
|
|
187
|
+
for (const auto &t: exeState.getLocToVal())
|
|
188
|
+
{
|
|
169
189
|
h2 ^= hf(t.first) + 0x9e3779b9 + (h2 << 6) + (h2 >> 2);
|
|
170
190
|
h2 ^= hf(t.second.id()) + 0x9e3779b9 + (h2 << 6) + (h2 >> 2);
|
|
171
191
|
}
|
|
@@ -74,7 +74,10 @@ public:
|
|
|
74
74
|
NodeID endSymbolAllocation(void);
|
|
75
75
|
|
|
76
76
|
/// Returns the total number of memory objects.
|
|
77
|
-
NodeID getNumObjects(void) const
|
|
77
|
+
NodeID getNumObjects(void) const
|
|
78
|
+
{
|
|
79
|
+
return numObjects;
|
|
80
|
+
}
|
|
78
81
|
|
|
79
82
|
private:
|
|
80
83
|
/// Builds a node ID allocator with the strategy specified on the command line.
|
|
@@ -135,7 +138,7 @@ public:
|
|
|
135
138
|
/// based on the points-to sets in pta accessed through keys.
|
|
136
139
|
/// The second part of the keys pairs are the number of (potential) occurrences of that points-to set
|
|
137
140
|
/// or a subset, depending on the client's wish.
|
|
138
|
-
/// TODO: interfaces are getting unwieldy, an initialised object may be better.
|
|
141
|
+
/// TODO: interfaces are getting unwieldy, an initialised object may be better.
|
|
139
142
|
/// TODO: kind of sucks pta can't be const here because getPts isn't.
|
|
140
143
|
static std::vector<NodeID> cluster(BVDataPTAImpl *pta, const std::vector<std::pair<NodeID, unsigned>> keys, std::vector<std::pair<hclust_fast_methods, std::vector<NodeID>>> &candidates, std::string evalSubtitle="");
|
|
141
144
|
|
|
@@ -180,8 +183,8 @@ public:
|
|
|
180
183
|
|
|
181
184
|
// From all the candidates, returns the best mapping for pointsToSets (points-to set -> # occurences).
|
|
182
185
|
static inline std::pair<hclust_fast_methods, std::vector<NodeID>> determineBestMapping(
|
|
183
|
-
|
|
184
|
-
|
|
186
|
+
const std::vector<std::pair<hclust_fast_methods, std::vector<NodeID>>> &candidates,
|
|
187
|
+
Map<PointsTo, unsigned> pointsToSets, const std::string &evalSubtitle, double &evalTime);
|
|
185
188
|
|
|
186
189
|
};
|
|
187
190
|
};
|
|
@@ -120,7 +120,7 @@ public:
|
|
|
120
120
|
// Sparse value-flow graph (VFG.cpp)
|
|
121
121
|
static const llvm::cl::opt<bool> DumpVFG;
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
// Location set for modeling abstract memory object (LocationSet.cpp)
|
|
124
124
|
static const llvm::cl::opt<bool> SingleStride;
|
|
125
125
|
|
|
126
126
|
// Base class of pointer analyses (PointerAnalysis.cpp)
|
|
@@ -180,8 +180,8 @@ public:
|
|
|
180
180
|
|
|
181
181
|
// MTAResultValidator.cpp
|
|
182
182
|
static const llvm::cl::opt<bool> PrintValidRes;
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
|
|
184
|
+
static const llvm::cl::opt<bool> LockValid;
|
|
185
185
|
//MTAStat.cpp
|
|
186
186
|
static const llvm::cl::opt<bool> AllPairMHP;
|
|
187
187
|
|
|
@@ -55,22 +55,26 @@ namespace SVF
|
|
|
55
55
|
/// provide extra hash function for std::pair handling
|
|
56
56
|
template <class T> struct Hash;
|
|
57
57
|
|
|
58
|
-
template <class S, class T> struct Hash<std::pair<S, T>>
|
|
58
|
+
template <class S, class T> struct Hash<std::pair<S, T>>
|
|
59
|
+
{
|
|
59
60
|
// Pairing function from: http://szudzik.com/ElegantPairing.pdf
|
|
60
61
|
static size_t szudzik(size_t a, size_t b)
|
|
61
62
|
{
|
|
62
63
|
return a > b ? b * b + a : a * a + a + b;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
size_t operator()(const std::pair<S, T> &t) const
|
|
66
|
+
size_t operator()(const std::pair<S, T> &t) const
|
|
67
|
+
{
|
|
66
68
|
Hash<decltype(t.first)> first;
|
|
67
69
|
Hash<decltype(t.second)> second;
|
|
68
70
|
return szudzik(first(t.first), second(t.second));
|
|
69
71
|
}
|
|
70
72
|
};
|
|
71
73
|
|
|
72
|
-
template <class T> struct Hash
|
|
73
|
-
|
|
74
|
+
template <class T> struct Hash
|
|
75
|
+
{
|
|
76
|
+
size_t operator()(const T &t) const
|
|
77
|
+
{
|
|
74
78
|
std::hash<T> h;
|
|
75
79
|
return h(t);
|
|
76
80
|
}
|
|
@@ -97,45 +101,46 @@ typedef PointsTo AliasSet;
|
|
|
97
101
|
typedef unsigned PointsToID;
|
|
98
102
|
|
|
99
103
|
template <typename Key, typename Hash = Hash<Key>, typename KeyEqual = std::equal_to<Key>,
|
|
100
|
-
typename Allocator = std::allocator<Key>>
|
|
104
|
+
typename Allocator = std::allocator<Key>>
|
|
101
105
|
using Set = std::unordered_set<Key, Hash, KeyEqual, Allocator>;
|
|
102
106
|
|
|
103
107
|
template<typename Key, typename Value, typename Hash = Hash<Key>,
|
|
104
|
-
|
|
105
|
-
typename Allocator = std::allocator<std::pair<const Key, Value>>>
|
|
106
|
-
using Map = std::unordered_map<Key, Value, Hash, KeyEqual, Allocator>;
|
|
107
|
-
|
|
108
|
-
template<typename Key, typename Compare = std::less<Key>, typename Allocator = std::allocator<Key>>
|
|
109
|
-
using OrderedSet = std::set<Key, Compare, Allocator>;
|
|
110
|
-
|
|
111
|
-
template<typename Key, typename Value, typename Compare = std::less<Key>,
|
|
108
|
+
typename KeyEqual = std::equal_to<Key>,
|
|
112
109
|
typename Allocator = std::allocator<std::pair<const Key, Value>>>
|
|
113
|
-
using
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
typedef
|
|
123
|
-
typedef std::
|
|
124
|
-
typedef
|
|
125
|
-
typedef
|
|
126
|
-
typedef
|
|
127
|
-
typedef
|
|
128
|
-
typedef
|
|
129
|
-
|
|
130
|
-
typedef
|
|
131
|
-
typedef
|
|
132
|
-
typedef std::
|
|
133
|
-
typedef
|
|
110
|
+
using Map = std::unordered_map<Key, Value, Hash, KeyEqual, Allocator>;
|
|
111
|
+
|
|
112
|
+
template<typename Key, typename Compare = std::less<Key>, typename Allocator = std::allocator<Key>>
|
|
113
|
+
using OrderedSet = std::set<Key, Compare, Allocator>;
|
|
114
|
+
|
|
115
|
+
template<typename Key, typename Value, typename Compare = std::less<Key>,
|
|
116
|
+
typename Allocator = std::allocator<std::pair<const Key, Value>>>
|
|
117
|
+
using OrderedMap = std::map<Key, Value, Compare, Allocator>;
|
|
118
|
+
|
|
119
|
+
typedef llvm::SmallVector<llvm::BasicBlock*, 8> SmallBBVector;
|
|
120
|
+
typedef std::pair<NodeID, NodeID> NodePair;
|
|
121
|
+
typedef OrderedSet<NodeID> OrderedNodeSet;
|
|
122
|
+
typedef Set<NodeID> NodeSet;
|
|
123
|
+
typedef Set<NodePair> NodePairSet;
|
|
124
|
+
typedef Map<NodePair,NodeID> NodePairMap;
|
|
125
|
+
typedef std::vector<NodeID> NodeVector;
|
|
126
|
+
typedef std::vector<EdgeID> EdgeVector;
|
|
127
|
+
typedef std::stack<NodeID> NodeStack;
|
|
128
|
+
typedef std::list<NodeID> NodeList;
|
|
129
|
+
typedef std::deque<NodeID> NodeDeque;
|
|
130
|
+
typedef NodeSet EdgeSet;
|
|
131
|
+
typedef std::vector<u32_t> CallStrCxt;
|
|
132
|
+
typedef llvm::StringMap<u32_t> StringMap;
|
|
133
|
+
|
|
134
|
+
typedef unsigned Version;
|
|
135
|
+
typedef Set<Version> VersionSet;
|
|
136
|
+
typedef std::pair<NodeID, Version> VersionedVar;
|
|
137
|
+
typedef Set<VersionedVar> VersionedVarSet;
|
|
134
138
|
|
|
135
139
|
// TODO: be explicit that this is a pair of 32-bit unsigneds?
|
|
136
|
-
template <> struct Hash<NodePair>
|
|
140
|
+
template <> struct Hash<NodePair>
|
|
137
141
|
{
|
|
138
|
-
size_t operator()(const NodePair &p) const
|
|
142
|
+
size_t operator()(const NodePair &p) const
|
|
143
|
+
{
|
|
139
144
|
// Make sure our assumptions are sound: use u32_t
|
|
140
145
|
// and u64_t. If NodeID is not actually u32_t or size_t
|
|
141
146
|
// is not u64_t we should be fine since we get a
|
|
@@ -278,8 +283,10 @@ public:
|
|
|
278
283
|
} // End namespace SVF
|
|
279
284
|
|
|
280
285
|
|
|
281
|
-
template <> struct std::hash<SVF::NodePair>
|
|
282
|
-
|
|
286
|
+
template <> struct std::hash<SVF::NodePair>
|
|
287
|
+
{
|
|
288
|
+
size_t operator()(const SVF::NodePair &p) const
|
|
289
|
+
{
|
|
283
290
|
// Make sure our assumptions are sound: use u32_t
|
|
284
291
|
// and u64_t. If NodeID is not actually u32_t or size_t
|
|
285
292
|
// is not u64_t we should be fine since we get a
|
|
@@ -294,7 +301,8 @@ template <> struct std::hash<SVF::NodePair> {
|
|
|
294
301
|
template <unsigned N>
|
|
295
302
|
struct std::hash<llvm::SparseBitVector<N>>
|
|
296
303
|
{
|
|
297
|
-
size_t operator()(const llvm::SparseBitVector<N> &sbv) const
|
|
304
|
+
size_t operator()(const llvm::SparseBitVector<N> &sbv) const
|
|
305
|
+
{
|
|
298
306
|
SVF::Hash<std::pair<std::pair<size_t, size_t>, size_t>> h;
|
|
299
307
|
return h(std::make_pair(std::make_pair(sbv.count(), sbv.find_first()), sbv.find_last()));
|
|
300
308
|
}
|
|
@@ -303,7 +311,8 @@ struct std::hash<llvm::SparseBitVector<N>>
|
|
|
303
311
|
template <typename T>
|
|
304
312
|
struct std::hash<std::vector<T>>
|
|
305
313
|
{
|
|
306
|
-
size_t operator()(const std::vector<T> &v) const
|
|
314
|
+
size_t operator()(const std::vector<T> &v) const
|
|
315
|
+
{
|
|
307
316
|
// TODO: repetition with CBV.
|
|
308
317
|
size_t h = v.size();
|
|
309
318
|
|
|
@@ -73,11 +73,11 @@ public:
|
|
|
73
73
|
|
|
74
74
|
~SVFModule()
|
|
75
75
|
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
for (auto * f : FunctionSet)
|
|
77
|
+
delete f;
|
|
78
|
+
NodeIDAllocator::unset();
|
|
79
|
+
ThreadAPI::destroy();
|
|
80
|
+
ExtAPI::destory();
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
static inline void setPagFromTXT(std::string txt)
|
|
@@ -170,8 +170,9 @@ inline bool isIntrinsicFun(const Function* func)
|
|
|
170
170
|
func->getIntrinsicID() == llvm::Intrinsic::dbg_addr ||
|
|
171
171
|
func->getIntrinsicID() == llvm::Intrinsic::dbg_declare ||
|
|
172
172
|
func->getIntrinsicID() == llvm::Intrinsic::dbg_label ||
|
|
173
|
-
func->getIntrinsicID() == llvm::Intrinsic::dbg_value))
|
|
174
|
-
|
|
173
|
+
func->getIntrinsicID() == llvm::Intrinsic::dbg_value))
|
|
174
|
+
{
|
|
175
|
+
return true;
|
|
175
176
|
}
|
|
176
177
|
return false;
|
|
177
178
|
}
|
|
@@ -179,9 +180,11 @@ inline bool isIntrinsicFun(const Function* func)
|
|
|
179
180
|
/// Return true if it is an intrinsic instruction
|
|
180
181
|
inline bool isIntrinsicInst(const Instruction* inst)
|
|
181
182
|
{
|
|
182
|
-
if (const llvm::CallBase* call = llvm::dyn_cast<llvm::CallBase>(inst))
|
|
183
|
+
if (const llvm::CallBase* call = llvm::dyn_cast<llvm::CallBase>(inst))
|
|
184
|
+
{
|
|
183
185
|
const Function* func = call->getCalledFunction();
|
|
184
|
-
if (isIntrinsicFun(func))
|
|
186
|
+
if (isIntrinsicFun(func))
|
|
187
|
+
{
|
|
185
188
|
return true;
|
|
186
189
|
}
|
|
187
190
|
}
|
|
@@ -197,10 +200,10 @@ inline bool isCallSite(const Instruction* inst)
|
|
|
197
200
|
/// Whether an instruction is a call or invoke instruction
|
|
198
201
|
inline bool isCallSite(const Value* val)
|
|
199
202
|
{
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
203
|
+
if(const Instruction* inst = SVFUtil::dyn_cast<Instruction>(val))
|
|
204
|
+
return SVFUtil::isCallSite(inst);
|
|
205
|
+
else
|
|
206
|
+
return false;
|
|
204
207
|
}
|
|
205
208
|
/// Whether an instruction is a callsite in the application code, excluding llvm intrinsic calls
|
|
206
209
|
inline bool isNonInstricCallSite(const Instruction* inst)
|
|
@@ -237,7 +240,7 @@ inline const SVFFunction* getFunction(StringRef name)
|
|
|
237
240
|
}
|
|
238
241
|
|
|
239
242
|
/// find the unique defined global across multiple modules
|
|
240
|
-
inline const Value* getGlobalRep(const Value* val)
|
|
243
|
+
inline const Value* getGlobalRep(const Value* val)
|
|
241
244
|
{
|
|
242
245
|
if(const GlobalVariable* gvar = SVFUtil::dyn_cast<GlobalVariable>(val))
|
|
243
246
|
{
|