svf-lib 1.0.1277 → 1.0.1279
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/DDA/DDAVFSolver.h +1 -2
- package/SVF-linux/include/Graphs/ICFG.h +16 -16
- package/SVF-linux/include/Graphs/ICFGEdge.h +6 -6
- package/SVF-linux/include/Graphs/ICFGNode.h +16 -16
- package/SVF-linux/include/Graphs/IRGraph.h +6 -6
- package/SVF-linux/include/Graphs/ThreadCallGraph.h +2 -2
- package/SVF-linux/include/Graphs/VFGNode.h +1 -1
- package/SVF-linux/include/MSSA/MSSAMuChi.h +11 -11
- package/SVF-linux/include/MSSA/MemRegion.h +2 -2
- package/SVF-linux/include/MSSA/MemSSA.h +13 -13
- package/SVF-linux/include/MTA/FSMPTA.h +1 -1
- package/SVF-linux/include/MTA/LockAnalysis.h +33 -33
- package/SVF-linux/include/MTA/LockResultValidator.h +7 -6
- package/SVF-linux/include/MTA/MHP.h +46 -46
- package/SVF-linux/include/MTA/MTA.h +4 -4
- package/SVF-linux/include/MTA/MTAAnnotator.h +6 -4
- package/SVF-linux/include/MTA/MTAResultValidator.h +51 -44
- package/SVF-linux/include/MTA/PCG.h +22 -27
- package/SVF-linux/include/MTA/TCT.h +28 -37
- package/SVF-linux/include/MemoryModel/SVFStatements.h +11 -6
- package/SVF-linux/include/MemoryModel/SVFVariables.h +4 -4
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +13 -19
- package/SVF-linux/include/SABER/ProgSlice.h +5 -5
- package/SVF-linux/include/SABER/SaberCheckerAPI.h +4 -4
- package/SVF-linux/include/SABER/SaberCondAllocator.h +32 -35
- package/SVF-linux/include/SVF-FE/BasicTypes.h +10 -0
- package/SVF-linux/include/SVF-FE/CPPUtil.h +9 -8
- package/SVF-linux/include/SVF-FE/DCHG.h +4 -4
- package/SVF-linux/include/SVF-FE/DataFlowUtil.h +1 -1
- package/SVF-linux/include/SVF-FE/GEPTypeBridgeIterator.h +1 -1
- package/SVF-linux/include/SVF-FE/ICFGBuilder.h +9 -9
- package/SVF-linux/include/SVF-FE/IRAnnotator.h +9 -9
- package/SVF-linux/include/SVF-FE/LLVMModule.h +119 -22
- package/SVF-linux/include/SVF-FE/LLVMUtil.h +31 -52
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +14 -20
- package/SVF-linux/include/SVF-FE/SymbolTableBuilder.h +8 -8
- package/SVF-linux/include/Util/Annotator.h +22 -22
- package/SVF-linux/include/Util/BasicTypes.h +476 -72
- package/SVF-linux/include/Util/Casting.h +1 -1
- package/SVF-linux/include/Util/CxtStmt.h +13 -12
- package/SVF-linux/include/Util/SVFBasicTypes.h +0 -78
- package/SVF-linux/include/Util/SVFInstruction.h +40 -0
- package/SVF-linux/include/Util/SVFModule.h +58 -124
- package/SVF-linux/include/Util/SVFUtil.h +48 -39
- package/SVF-linux/include/Util/ThreadAPI.h +17 -28
- package/SVF-linux/include/WPA/WPAPass.h +4 -4
- package/SVF-osx/Release-build/lib/libSvf.a +0 -0
- package/SVF-osx/include/DDA/DDAVFSolver.h +1 -2
- package/SVF-osx/include/Graphs/ICFG.h +16 -16
- package/SVF-osx/include/Graphs/ICFGEdge.h +6 -6
- package/SVF-osx/include/Graphs/ICFGNode.h +16 -16
- package/SVF-osx/include/Graphs/IRGraph.h +6 -6
- package/SVF-osx/include/Graphs/ThreadCallGraph.h +2 -2
- package/SVF-osx/include/Graphs/VFGNode.h +1 -1
- package/SVF-osx/include/MSSA/MSSAMuChi.h +11 -11
- package/SVF-osx/include/MSSA/MemRegion.h +2 -2
- package/SVF-osx/include/MSSA/MemSSA.h +13 -13
- package/SVF-osx/include/MTA/FSMPTA.h +1 -1
- package/SVF-osx/include/MTA/LockAnalysis.h +33 -33
- package/SVF-osx/include/MTA/LockResultValidator.h +7 -6
- package/SVF-osx/include/MTA/MHP.h +46 -46
- package/SVF-osx/include/MTA/MTA.h +4 -4
- package/SVF-osx/include/MTA/MTAAnnotator.h +6 -4
- package/SVF-osx/include/MTA/MTAResultValidator.h +51 -44
- package/SVF-osx/include/MTA/PCG.h +22 -27
- package/SVF-osx/include/MTA/TCT.h +28 -37
- package/SVF-osx/include/MemoryModel/SVFStatements.h +11 -6
- package/SVF-osx/include/MemoryModel/SVFVariables.h +4 -4
- package/SVF-osx/include/MemoryModel/SymbolTableInfo.h +13 -19
- package/SVF-osx/include/SABER/ProgSlice.h +5 -5
- package/SVF-osx/include/SABER/SaberCheckerAPI.h +4 -4
- package/SVF-osx/include/SABER/SaberCondAllocator.h +32 -35
- package/SVF-osx/include/SVF-FE/BasicTypes.h +10 -0
- package/SVF-osx/include/SVF-FE/CPPUtil.h +9 -8
- package/SVF-osx/include/SVF-FE/DCHG.h +4 -4
- package/SVF-osx/include/SVF-FE/DataFlowUtil.h +1 -1
- package/SVF-osx/include/SVF-FE/GEPTypeBridgeIterator.h +1 -1
- package/SVF-osx/include/SVF-FE/ICFGBuilder.h +9 -9
- package/SVF-osx/include/SVF-FE/IRAnnotator.h +9 -9
- package/SVF-osx/include/SVF-FE/LLVMModule.h +119 -22
- package/SVF-osx/include/SVF-FE/LLVMUtil.h +31 -52
- package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +14 -20
- package/SVF-osx/include/SVF-FE/SymbolTableBuilder.h +8 -8
- package/SVF-osx/include/Util/Annotator.h +22 -22
- package/SVF-osx/include/Util/BasicTypes.h +476 -72
- package/SVF-osx/include/Util/Casting.h +1 -1
- package/SVF-osx/include/Util/CxtStmt.h +13 -12
- package/SVF-osx/include/Util/SVFBasicTypes.h +0 -78
- package/SVF-osx/include/Util/SVFInstruction.h +40 -0
- package/SVF-osx/include/Util/SVFModule.h +58 -124
- package/SVF-osx/include/Util/SVFUtil.h +48 -39
- package/SVF-osx/include/Util/ThreadAPI.h +17 -28
- package/SVF-osx/include/WPA/WPAPass.h +4 -4
- package/package.json +1 -1
|
@@ -334,7 +334,7 @@ inline typename cast_retty<X, std::unique_ptr<Y>>::ret_type
|
|
|
334
334
|
// be used to test for a type as well as cast if successful. This should be
|
|
335
335
|
// used in the context of an if statement like this:
|
|
336
336
|
//
|
|
337
|
-
// if (const Instruction
|
|
337
|
+
// if (const Instruction* I = dyn_cast<Instruction>(myVal)) { ... }
|
|
338
338
|
//
|
|
339
339
|
|
|
340
340
|
template <class X, class Y>
|
|
@@ -42,7 +42,7 @@ class CxtStmt
|
|
|
42
42
|
{
|
|
43
43
|
public:
|
|
44
44
|
/// Constructor
|
|
45
|
-
CxtStmt(const CallStrCxt& c, const
|
|
45
|
+
CxtStmt(const CallStrCxt& c, const SVFInstruction* f) :cxt(c), inst(f)
|
|
46
46
|
{
|
|
47
47
|
}
|
|
48
48
|
/// Copy constructor
|
|
@@ -59,7 +59,7 @@ public:
|
|
|
59
59
|
return cxt;
|
|
60
60
|
}
|
|
61
61
|
/// Return current statement
|
|
62
|
-
inline const
|
|
62
|
+
inline const SVFInstruction* getStmt() const
|
|
63
63
|
{
|
|
64
64
|
return inst;
|
|
65
65
|
}
|
|
@@ -108,12 +108,12 @@ public:
|
|
|
108
108
|
/// Dump CxtStmt
|
|
109
109
|
inline void dump() const
|
|
110
110
|
{
|
|
111
|
-
SVFUtil::outs() << "[ Current Stmt: " << SVFUtil::getSourceLoc(inst) << " " << SVFUtil::value2String(inst) << "\t Contexts: " << cxtToStr() << " ]\n";
|
|
111
|
+
SVFUtil::outs() << "[ Current Stmt: " << SVFUtil::getSourceLoc(inst->getLLVMInstruction()) << " " << SVFUtil::value2String(inst->getLLVMInstruction()) << "\t Contexts: " << cxtToStr() << " ]\n";
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
protected:
|
|
115
115
|
CallStrCxt cxt;
|
|
116
|
-
const
|
|
116
|
+
const SVFInstruction* inst;
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
|
|
@@ -124,7 +124,7 @@ class CxtThreadStmt : public CxtStmt
|
|
|
124
124
|
{
|
|
125
125
|
public:
|
|
126
126
|
/// Constructor
|
|
127
|
-
CxtThreadStmt(NodeID t, const CallStrCxt& c, const
|
|
127
|
+
CxtThreadStmt(NodeID t, const CallStrCxt& c, const SVFInstruction* f) :CxtStmt(c,f), tid(t)
|
|
128
128
|
{
|
|
129
129
|
}
|
|
130
130
|
/// Copy constructor
|
|
@@ -174,7 +174,7 @@ public:
|
|
|
174
174
|
/// Dump CxtThreadStmt
|
|
175
175
|
inline void dump() const
|
|
176
176
|
{
|
|
177
|
-
SVFUtil::outs() << "[ Current Thread id: " << tid << " Stmt: " << SVFUtil::getSourceLoc(inst) << " " << SVFUtil::value2String(inst) << "\t Contexts: " << cxtToStr() << " ]\n";
|
|
177
|
+
SVFUtil::outs() << "[ Current Thread id: " << tid << " Stmt: " << SVFUtil::getSourceLoc(inst->getLLVMInstruction()) << " " << SVFUtil::value2String(inst->getLLVMInstruction()) << "\t Contexts: " << cxtToStr() << " ]\n";
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
private:
|
|
@@ -189,7 +189,7 @@ class CxtThread
|
|
|
189
189
|
{
|
|
190
190
|
public:
|
|
191
191
|
/// Constructor
|
|
192
|
-
CxtThread(const CallStrCxt& c, const
|
|
192
|
+
CxtThread(const CallStrCxt& c, const SVFInstruction* fork) : cxt(c), forksite(fork), inloop(false), incycle(false)
|
|
193
193
|
{
|
|
194
194
|
}
|
|
195
195
|
/// Copy constructor
|
|
@@ -207,7 +207,7 @@ public:
|
|
|
207
207
|
return cxt;
|
|
208
208
|
}
|
|
209
209
|
/// Return forksite
|
|
210
|
-
inline const
|
|
210
|
+
inline const SVFInstruction* getThread() const
|
|
211
211
|
{
|
|
212
212
|
return forksite;
|
|
213
213
|
}
|
|
@@ -282,7 +282,8 @@ public:
|
|
|
282
282
|
|
|
283
283
|
if(forksite)
|
|
284
284
|
{
|
|
285
|
-
SVFUtil::outs() << "[ Thread: $" << SVFUtil::getSourceLoc(forksite) << "$ "
|
|
285
|
+
SVFUtil::outs() << "[ Thread: $" << SVFUtil::getSourceLoc(forksite->getLLVMInstruction()) << "$ "
|
|
286
|
+
<< SVFUtil::value2String(forksite->getLLVMInstruction()) << "\t Contexts: " << cxtToStr()
|
|
286
287
|
<< loop << cycle <<" ]\n";
|
|
287
288
|
}
|
|
288
289
|
else
|
|
@@ -293,7 +294,7 @@ public:
|
|
|
293
294
|
}
|
|
294
295
|
protected:
|
|
295
296
|
CallStrCxt cxt;
|
|
296
|
-
const
|
|
297
|
+
const SVFInstruction* forksite;
|
|
297
298
|
bool inloop;
|
|
298
299
|
bool incycle;
|
|
299
300
|
};
|
|
@@ -483,8 +484,8 @@ template <> struct std::hash<SVF::CxtStmt>
|
|
|
483
484
|
{
|
|
484
485
|
size_t operator()(const SVF::CxtStmt& cs) const
|
|
485
486
|
{
|
|
486
|
-
std::hash<SVF::
|
|
487
|
-
SVF::
|
|
487
|
+
std::hash<SVF::SVFInstruction*> h;
|
|
488
|
+
SVF::SVFInstruction* inst = const_cast<SVF::SVFInstruction*> (cs.getStmt());
|
|
488
489
|
return h(inst);
|
|
489
490
|
}
|
|
490
491
|
};
|
|
@@ -196,84 +196,6 @@ enum AliasResult
|
|
|
196
196
|
PartialAlias,
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
-
class SVFValue
|
|
200
|
-
{
|
|
201
|
-
|
|
202
|
-
public:
|
|
203
|
-
typedef s64_t GNodeK;
|
|
204
|
-
|
|
205
|
-
enum SVFValKind
|
|
206
|
-
{
|
|
207
|
-
SVFVal,
|
|
208
|
-
SVFFunc,
|
|
209
|
-
SVFGlob,
|
|
210
|
-
SVFBB,
|
|
211
|
-
SVFInst,
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
private:
|
|
215
|
-
const std::string value;
|
|
216
|
-
GNodeK kind; ///< Type of this SVFValue
|
|
217
|
-
public:
|
|
218
|
-
/// Constructor
|
|
219
|
-
SVFValue(const std::string& val, SVFValKind k): value(val), kind(k)
|
|
220
|
-
{
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
/// Get the type of this SVFValue
|
|
224
|
-
inline GNodeK getKind() const
|
|
225
|
-
{
|
|
226
|
-
return kind;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
/// Add the hash function for std::set (we also can overload operator< to implement this)
|
|
230
|
-
// and duplicated elements in the set are not inserted (binary tree comparison)
|
|
231
|
-
//@{
|
|
232
|
-
bool operator()(const SVFValue* lhs, const SVFValue* rhs) const
|
|
233
|
-
{
|
|
234
|
-
return lhs->value < rhs->value;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
inline bool operator==(SVFValue* rhs) const
|
|
238
|
-
{
|
|
239
|
-
return value == rhs->value;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
inline bool operator!=(SVFValue* rhs) const
|
|
243
|
-
{
|
|
244
|
-
return value != rhs->value;
|
|
245
|
-
}
|
|
246
|
-
//@}
|
|
247
|
-
|
|
248
|
-
const std::string getName() const
|
|
249
|
-
{
|
|
250
|
-
return value;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
const std::string& getValue() const
|
|
254
|
-
{
|
|
255
|
-
return value;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/// Overloading operator << for dumping ICFG node ID
|
|
259
|
-
//@{
|
|
260
|
-
friend OutStream& operator<< (OutStream &o, const SVFValue &node)
|
|
261
|
-
{
|
|
262
|
-
o << node.getName();
|
|
263
|
-
return o;
|
|
264
|
-
}
|
|
265
|
-
//@}
|
|
266
|
-
|
|
267
|
-
static inline bool classof(const SVFValue *node)
|
|
268
|
-
{
|
|
269
|
-
return node->getKind() == SVFValue::SVFVal ||
|
|
270
|
-
node->getKind() == SVFValue::SVFFunc ||
|
|
271
|
-
node->getKind() == SVFValue::SVFGlob ||
|
|
272
|
-
node->getKind() == SVFValue::SVFBB ||
|
|
273
|
-
node->getKind() == SVFValue::SVFInst;
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
|
|
277
199
|
} // End namespace SVF
|
|
278
200
|
|
|
279
201
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#ifndef SVFINSTRUCTION_H_
|
|
2
|
+
#define SVFINSTRUCTION_H_
|
|
3
|
+
|
|
4
|
+
#include "Util/BasicTypes.h"
|
|
5
|
+
|
|
6
|
+
namespace SVF
|
|
7
|
+
{
|
|
8
|
+
class SVFFunction;
|
|
9
|
+
|
|
10
|
+
class SVFInstruction: public SVFValue
|
|
11
|
+
{
|
|
12
|
+
private:
|
|
13
|
+
const BasicBlock* parentBB;
|
|
14
|
+
bool isCallBase;
|
|
15
|
+
|
|
16
|
+
public:
|
|
17
|
+
SVFInstruction(const std::string instructionName, const BasicBlock* parentBB): SVFValue(instructionName,SVFValue::SVFInst), parentBB(parentBB)
|
|
18
|
+
{
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
inline const BasicBlock* getParent() const
|
|
22
|
+
{
|
|
23
|
+
return parentBB;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
inline const bool isCallBase() const
|
|
27
|
+
{
|
|
28
|
+
return isCallBase;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
inline const void setIsCallBase(const bool isCallBase)
|
|
32
|
+
{
|
|
33
|
+
this->isCallBase = isCallBase;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
#endif
|
|
@@ -42,38 +42,37 @@ class SVFModule
|
|
|
42
42
|
{
|
|
43
43
|
public:
|
|
44
44
|
typedef std::vector<const SVFFunction*> FunctionSetType;
|
|
45
|
-
typedef std::vector<Function*> LLVMFunctionSetType;
|
|
46
|
-
typedef std::vector<
|
|
47
|
-
typedef std::vector<
|
|
48
|
-
typedef
|
|
45
|
+
typedef std::vector<const Function*> LLVMFunctionSetType;
|
|
46
|
+
typedef std::vector<SVFGlobalValue*> GlobalSetType;
|
|
47
|
+
typedef std::vector<SVFGlobalValue*> AliasSetType;
|
|
48
|
+
typedef std::vector<SVFConstantData*> ConstantDataType;
|
|
49
|
+
typedef std::vector<SVFOtherValue*> OtherValueType;
|
|
49
50
|
|
|
50
51
|
/// Iterators type def
|
|
51
52
|
typedef FunctionSetType::iterator iterator;
|
|
52
53
|
typedef FunctionSetType::const_iterator const_iterator;
|
|
53
|
-
typedef LLVMFunctionSetType::iterator llvm_iterator;
|
|
54
|
-
typedef LLVMFunctionSetType::const_iterator llvm_const_iterator;
|
|
55
54
|
typedef GlobalSetType::iterator global_iterator;
|
|
56
55
|
typedef GlobalSetType::const_iterator const_global_iterator;
|
|
57
56
|
typedef AliasSetType::iterator alias_iterator;
|
|
58
57
|
typedef AliasSetType::const_iterator const_alias_iterator;
|
|
58
|
+
typedef ConstantDataType::iterator cdata_iterator;
|
|
59
|
+
typedef ConstantDataType::const_iterator const_cdata_iterator;
|
|
60
|
+
typedef OtherValueType::iterator ovalue_iterator;
|
|
61
|
+
typedef OtherValueType::const_iterator const_ovalue_iterator;
|
|
59
62
|
|
|
60
63
|
private:
|
|
61
64
|
static std::string pagReadFromTxt;
|
|
62
65
|
std::string moduleIdentifier;
|
|
63
66
|
FunctionSetType FunctionSet; ///< The Functions in the module
|
|
64
|
-
LLVMFunctionSetType LLVMFunctionSet; ///< The Functions in the module
|
|
65
67
|
GlobalSetType GlobalSet; ///< The Global Variables in the module
|
|
66
68
|
AliasSetType AliasSet; ///< The Aliases in the module
|
|
67
|
-
|
|
69
|
+
ConstantDataType ConstantDataSet; ///< The ConstantData in the module
|
|
70
|
+
OtherValueType OtherValueSet; ///< All other values in the module
|
|
71
|
+
|
|
68
72
|
Set<const Value*> argsOfUncalledFunction;
|
|
69
|
-
Set<const Instruction*> returnInsts;
|
|
70
|
-
Set<const Value*> nullPtrSyms;
|
|
71
73
|
Set<const Value*> blackholeSyms;
|
|
72
74
|
Set<const Value*> ptrsInUncalledFunctions;
|
|
73
|
-
Map<const BasicBlock*, const u32_t> bbSuccessorNumMap;
|
|
74
75
|
Map<const PointerType*, const Type*> ptrElementTypeMap;
|
|
75
|
-
Map<const BasicBlock*, const Map<const BasicBlock*, const u32_t>> bbSuccessorPosMap;
|
|
76
|
-
Map<const BasicBlock*, const Map<const BasicBlock*, const u32_t>> bbPredecessorPosMap;
|
|
77
76
|
|
|
78
77
|
public:
|
|
79
78
|
/// Constructors
|
|
@@ -81,14 +80,7 @@ public:
|
|
|
81
80
|
{
|
|
82
81
|
}
|
|
83
82
|
|
|
84
|
-
~SVFModule()
|
|
85
|
-
{
|
|
86
|
-
for (auto * f : FunctionSet)
|
|
87
|
-
delete f;
|
|
88
|
-
NodeIDAllocator::unset();
|
|
89
|
-
ThreadAPI::destroy();
|
|
90
|
-
ExtAPI::destory();
|
|
91
|
-
}
|
|
83
|
+
~SVFModule();
|
|
92
84
|
|
|
93
85
|
static inline void setPagFromTXT(std::string txt)
|
|
94
86
|
{
|
|
@@ -114,45 +106,28 @@ public:
|
|
|
114
106
|
inline void addFunctionSet(SVFFunction* svfFunc)
|
|
115
107
|
{
|
|
116
108
|
FunctionSet.push_back(svfFunc);
|
|
117
|
-
LLVMFunctionSet.push_back(svfFunc->getLLVMFun());
|
|
118
|
-
LLVMFunc2SVFFunc[svfFunc->getLLVMFun()] = svfFunc;
|
|
119
109
|
}
|
|
120
|
-
inline void addGlobalSet(
|
|
110
|
+
inline void addGlobalSet(SVFGlobalValue* glob)
|
|
121
111
|
{
|
|
122
112
|
GlobalSet.push_back(glob);
|
|
123
113
|
}
|
|
124
|
-
inline void addAliasSet(
|
|
114
|
+
inline void addAliasSet(SVFGlobalValue* alias)
|
|
125
115
|
{
|
|
126
116
|
AliasSet.push_back(alias);
|
|
127
117
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
inline const SVFFunction* getSVFFunction(const Function* fun) const
|
|
131
|
-
{
|
|
132
|
-
LLVMFun2SVFFunMap::const_iterator it = LLVMFunc2SVFFunc.find(fun);
|
|
133
|
-
assert(it!=LLVMFunc2SVFFunc.end() && "SVF Function not found!");
|
|
134
|
-
return it->second;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/// Iterators
|
|
138
|
-
///@{
|
|
139
|
-
llvm_iterator llvmFunBegin()
|
|
140
|
-
{
|
|
141
|
-
return LLVMFunctionSet.begin();
|
|
142
|
-
}
|
|
143
|
-
llvm_const_iterator llvmFunBegin() const
|
|
144
|
-
{
|
|
145
|
-
return LLVMFunctionSet.begin();
|
|
146
|
-
}
|
|
147
|
-
llvm_iterator llvmFunEnd()
|
|
118
|
+
inline void addConstantData(SVFConstantData* cd)
|
|
148
119
|
{
|
|
149
|
-
|
|
120
|
+
ConstantDataSet.push_back(cd);
|
|
150
121
|
}
|
|
151
|
-
|
|
122
|
+
inline void addOtherValue(SVFOtherValue* ov)
|
|
152
123
|
{
|
|
153
|
-
|
|
124
|
+
OtherValueSet.push_back(ov);
|
|
154
125
|
}
|
|
155
126
|
|
|
127
|
+
///@}
|
|
128
|
+
|
|
129
|
+
/// Iterators
|
|
130
|
+
///@{
|
|
156
131
|
iterator begin()
|
|
157
132
|
{
|
|
158
133
|
return FunctionSet.begin();
|
|
@@ -203,13 +178,30 @@ public:
|
|
|
203
178
|
{
|
|
204
179
|
return AliasSet.end();
|
|
205
180
|
}
|
|
181
|
+
|
|
182
|
+
cdata_iterator cdata_begin()
|
|
183
|
+
{
|
|
184
|
+
return ConstantDataSet.begin();
|
|
185
|
+
}
|
|
186
|
+
const_cdata_iterator cdata_begin() const
|
|
187
|
+
{
|
|
188
|
+
return ConstantDataSet.begin();
|
|
189
|
+
}
|
|
190
|
+
cdata_iterator cdata_end()
|
|
191
|
+
{
|
|
192
|
+
return ConstantDataSet.end();
|
|
193
|
+
}
|
|
194
|
+
const_cdata_iterator cdata_end() const
|
|
195
|
+
{
|
|
196
|
+
return ConstantDataSet.end();
|
|
197
|
+
}
|
|
206
198
|
///@}
|
|
207
199
|
|
|
208
200
|
const std::string& getModuleIdentifier() const
|
|
209
201
|
{
|
|
210
202
|
if (pagReadFromTxt.empty())
|
|
211
203
|
{
|
|
212
|
-
assert(moduleIdentifier.empty()==false && "No
|
|
204
|
+
assert(moduleIdentifier.empty()==false && "No module found! Are you reading from a file other than LLVM-IR?");
|
|
213
205
|
return moduleIdentifier;
|
|
214
206
|
}
|
|
215
207
|
else
|
|
@@ -222,45 +214,36 @@ public:
|
|
|
222
214
|
{
|
|
223
215
|
return FunctionSet;
|
|
224
216
|
}
|
|
225
|
-
|
|
226
|
-
inline const Set<const Value*>& getNullPtrSyms() const
|
|
217
|
+
inline const ConstantDataType& getConstantDataSet() const
|
|
227
218
|
{
|
|
228
|
-
return
|
|
219
|
+
return ConstantDataSet;
|
|
229
220
|
}
|
|
230
|
-
|
|
231
|
-
inline const Set<const Value*>& getBlackholeSyms() const
|
|
221
|
+
inline const GlobalSetType& getGlobalSet() const
|
|
232
222
|
{
|
|
233
|
-
return
|
|
223
|
+
return GlobalSet;
|
|
234
224
|
}
|
|
235
|
-
|
|
236
|
-
inline const Set<const Value*>& getArgsOfUncalledFunction() const
|
|
225
|
+
inline const AliasSetType& getAliasSet() const
|
|
237
226
|
{
|
|
238
|
-
return
|
|
227
|
+
return AliasSet;
|
|
239
228
|
}
|
|
240
|
-
|
|
241
|
-
inline const Set<const Instruction*>& getReturns() const
|
|
229
|
+
inline const OtherValueType& getOtherValueSet() const
|
|
242
230
|
{
|
|
243
|
-
return
|
|
231
|
+
return OtherValueSet;
|
|
244
232
|
}
|
|
245
233
|
|
|
246
|
-
inline const Set<const Value*>&
|
|
247
|
-
{
|
|
248
|
-
return ptrsInUncalledFunctions;
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
inline const Map<const BasicBlock*, const u32_t>& getBBSuccessorNumMap()
|
|
234
|
+
inline const Set<const Value*>& getBlackholeSyms() const
|
|
252
235
|
{
|
|
253
|
-
return
|
|
236
|
+
return blackholeSyms;
|
|
254
237
|
}
|
|
255
238
|
|
|
256
|
-
inline const
|
|
239
|
+
inline const Set<const Value*>& getArgsOfUncalledFunction() const
|
|
257
240
|
{
|
|
258
|
-
return
|
|
241
|
+
return argsOfUncalledFunction;
|
|
259
242
|
}
|
|
260
243
|
|
|
261
|
-
inline const
|
|
244
|
+
inline const Set<const Value*>& getPtrsInUncalledFunctions() const
|
|
262
245
|
{
|
|
263
|
-
return
|
|
246
|
+
return ptrsInUncalledFunctions;
|
|
264
247
|
}
|
|
265
248
|
|
|
266
249
|
inline const Map<const PointerType*, const Type*>& getPtrElementTypeMap()
|
|
@@ -268,75 +251,26 @@ public:
|
|
|
268
251
|
return ptrElementTypeMap;
|
|
269
252
|
}
|
|
270
253
|
|
|
271
|
-
inline void addBBSuccessorNum(const BasicBlock *bb, const u32_t num)
|
|
272
|
-
{
|
|
273
|
-
bbSuccessorNumMap.insert({bb,num});
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
inline void addBBSuccessorPos(const BasicBlock *bb, const BasicBlock* succ,const u32_t pos)
|
|
277
|
-
{
|
|
278
|
-
Map<const BasicBlock*, const Map<const BasicBlock*, const u32_t>>::iterator bbSuccessorPosMapIter = bbSuccessorPosMap.find(bb);
|
|
279
|
-
if(bbSuccessorPosMapIter != bbSuccessorPosMap.end())
|
|
280
|
-
{
|
|
281
|
-
Map<const BasicBlock*, const u32_t> foundValue = bbSuccessorPosMapIter->second;
|
|
282
|
-
foundValue.insert({succ,pos});
|
|
283
|
-
bbSuccessorPosMap.insert({bb,foundValue});
|
|
284
|
-
}
|
|
285
|
-
else
|
|
286
|
-
{
|
|
287
|
-
Map<const BasicBlock*, const u32_t> valueMap;
|
|
288
|
-
valueMap.insert({succ,pos});
|
|
289
|
-
bbSuccessorPosMap.insert({bb,valueMap});
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
inline void addBBPredecessorPos(const BasicBlock *bb, const BasicBlock* Pred,const u32_t pos)
|
|
294
|
-
{
|
|
295
|
-
Map<const BasicBlock*, const Map<const BasicBlock*, const u32_t>>::iterator bbPredecessorPosMapIter = bbPredecessorPosMap.find(bb);
|
|
296
|
-
if(bbPredecessorPosMapIter != bbPredecessorPosMap.end())
|
|
297
|
-
{
|
|
298
|
-
Map<const BasicBlock*, const u32_t> foundValue = bbPredecessorPosMapIter->second;
|
|
299
|
-
foundValue.insert({Pred,pos});
|
|
300
|
-
bbPredecessorPosMap.insert({bb,foundValue});
|
|
301
|
-
}
|
|
302
|
-
else
|
|
303
|
-
{
|
|
304
|
-
Map<const BasicBlock*, const u32_t> valueMap;
|
|
305
|
-
valueMap.insert({Pred,pos});
|
|
306
|
-
bbPredecessorPosMap.insert({bb,valueMap});
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
254
|
inline void addptrElementType(const PointerType* ptrType, const Type* type)
|
|
311
255
|
{
|
|
312
256
|
ptrElementTypeMap.insert({ptrType, type});
|
|
313
257
|
}
|
|
314
258
|
|
|
315
|
-
inline void addPtrInUncalledFunction (const Value
|
|
259
|
+
inline void addPtrInUncalledFunction (const Value* value)
|
|
316
260
|
{
|
|
317
261
|
ptrsInUncalledFunctions.insert(value);
|
|
318
262
|
}
|
|
319
263
|
|
|
320
|
-
inline void
|
|
321
|
-
{
|
|
322
|
-
nullPtrSyms.insert(val);
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
inline void addBlackholeSyms(const Value *val)
|
|
264
|
+
inline void addBlackholeSyms(const Value* val)
|
|
326
265
|
{
|
|
327
266
|
blackholeSyms.insert(val);
|
|
328
267
|
}
|
|
329
268
|
|
|
330
|
-
inline void addArgsOfUncalledFunction(const Value
|
|
269
|
+
inline void addArgsOfUncalledFunction(const Value* val)
|
|
331
270
|
{
|
|
332
271
|
argsOfUncalledFunction.insert(val);
|
|
333
272
|
}
|
|
334
273
|
|
|
335
|
-
inline void addReturn(const Instruction* inst)
|
|
336
|
-
{
|
|
337
|
-
returnInsts.insert(inst);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
274
|
};
|
|
341
275
|
|
|
342
276
|
} // End namespace SVF
|