svf-lib 1.0.882 → 1.0.886
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/DDAPass.h +2 -14
- package/SVF-linux/include/Graphs/GraphPrinter.h +2 -2
- package/SVF-linux/include/Graphs/ICFGEdge.h +1 -1
- package/SVF-linux/include/Graphs/ICFGNode.h +1 -1
- package/SVF-linux/include/Graphs/ICFGStat.h +4 -4
- package/SVF-linux/include/Graphs/PTACallGraph.h +2 -2
- package/SVF-linux/include/Graphs/VFG.h +1 -1
- package/SVF-linux/include/Graphs/VFGEdge.h +1 -1
- package/SVF-linux/include/Graphs/VFGNode.h +1 -1
- package/SVF-linux/include/MSSA/MemSSA.h +1 -1
- package/SVF-linux/include/MTA/MTA.h +0 -8
- package/SVF-linux/include/MemoryModel/ConditionalPT.h +2 -3
- package/SVF-linux/include/MemoryModel/MutablePointsToDS.h +14 -15
- package/SVF-linux/include/MemoryModel/PersistentPointsToCache.h +19 -19
- package/SVF-linux/include/MemoryModel/PointerAnalysis.h +1 -1
- package/SVF-linux/include/MemoryModel/PointerAnalysisImpl.h +5 -5
- package/SVF-linux/include/MemoryModel/SVFStatements.h +1 -1
- package/SVF-linux/include/MemoryModel/SVFVariables.h +1 -1
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +0 -6
- package/SVF-linux/include/SABER/SaberCheckerAPI.h +1 -1
- package/SVF-linux/include/SVF-FE/BasicTypes.h +19 -0
- package/SVF-linux/include/SVF-FE/BreakConstantExpr.h +0 -11
- package/SVF-linux/include/SVF-FE/DataFlowUtil.h +0 -6
- package/SVF-linux/include/SVF-FE/LLVMUtil.h +15 -5
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +1 -0
- package/SVF-linux/include/Util/BasicTypes.h +1 -15
- package/SVF-linux/include/Util/Conditions.h +1 -1
- package/SVF-linux/include/Util/CxtStmt.h +7 -3
- package/SVF-linux/include/Util/DPItem.h +0 -1
- package/SVF-linux/include/Util/ExtAPI.h +4 -2
- package/SVF-linux/include/Util/IRAnnotator.h +2 -2
- package/SVF-linux/include/Util/SVFBasicTypes.h +21 -3
- package/SVF-linux/include/Util/SVFUtil.h +7 -7
- package/SVF-linux/include/Util/ThreadAPI.h +1 -1
- package/SVF-linux/include/WPA/WPAPass.h +2 -16
- 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/DDA/DDAPass.h +2 -14
- package/SVF-osx/include/Graphs/GraphPrinter.h +2 -2
- package/SVF-osx/include/Graphs/ICFGEdge.h +1 -1
- package/SVF-osx/include/Graphs/ICFGNode.h +1 -1
- package/SVF-osx/include/Graphs/ICFGStat.h +4 -4
- package/SVF-osx/include/Graphs/PTACallGraph.h +2 -2
- package/SVF-osx/include/Graphs/VFG.h +1 -1
- package/SVF-osx/include/Graphs/VFGEdge.h +1 -1
- package/SVF-osx/include/Graphs/VFGNode.h +1 -1
- package/SVF-osx/include/MSSA/MemSSA.h +1 -1
- package/SVF-osx/include/MTA/MTA.h +0 -8
- package/SVF-osx/include/MemoryModel/ConditionalPT.h +2 -3
- package/SVF-osx/include/MemoryModel/MutablePointsToDS.h +14 -15
- package/SVF-osx/include/MemoryModel/PersistentPointsToCache.h +19 -19
- package/SVF-osx/include/MemoryModel/PointerAnalysis.h +1 -1
- package/SVF-osx/include/MemoryModel/PointerAnalysisImpl.h +5 -5
- package/SVF-osx/include/MemoryModel/SVFStatements.h +1 -1
- package/SVF-osx/include/MemoryModel/SVFVariables.h +1 -1
- package/SVF-osx/include/MemoryModel/SymbolTableInfo.h +0 -6
- package/SVF-osx/include/SABER/SaberCheckerAPI.h +1 -1
- package/SVF-osx/include/SVF-FE/BasicTypes.h +19 -0
- package/SVF-osx/include/SVF-FE/BreakConstantExpr.h +0 -11
- package/SVF-osx/include/SVF-FE/DataFlowUtil.h +0 -6
- package/SVF-osx/include/SVF-FE/LLVMUtil.h +15 -5
- package/SVF-osx/include/SVF-FE/SVFIRBuilder.h +1 -0
- package/SVF-osx/include/Util/BasicTypes.h +1 -15
- package/SVF-osx/include/Util/Conditions.h +1 -1
- package/SVF-osx/include/Util/CxtStmt.h +7 -3
- package/SVF-osx/include/Util/DPItem.h +0 -1
- package/SVF-osx/include/Util/ExtAPI.h +5 -2
- package/SVF-osx/include/Util/IRAnnotator.h +2 -2
- package/SVF-osx/include/Util/SVFBasicTypes.h +21 -3
- package/SVF-osx/include/Util/SVFUtil.h +7 -7
- package/SVF-osx/include/Util/ThreadAPI.h +1 -1
- package/SVF-osx/include/WPA/WPAPass.h +2 -16
- package/package.json +1 -1
|
@@ -108,7 +108,7 @@ public:
|
|
|
108
108
|
/// Dump CxtStmt
|
|
109
109
|
inline void dump() const
|
|
110
110
|
{
|
|
111
|
-
SVFUtil::outs() << "[ Current Stmt: " << SVFUtil::getSourceLoc(inst) << " " <<
|
|
111
|
+
SVFUtil::outs() << "[ Current Stmt: " << SVFUtil::getSourceLoc(inst) << " " << SVFUtil::value2String(inst) << "\t Contexts: " << cxtToStr() << " ]\n";
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
protected:
|
|
@@ -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) << " " <<
|
|
177
|
+
SVFUtil::outs() << "[ Current Thread id: " << tid << " Stmt: " << SVFUtil::getSourceLoc(inst) << " " << SVFUtil::value2String(inst) << "\t Contexts: " << cxtToStr() << " ]\n";
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
private:
|
|
@@ -281,11 +281,15 @@ public:
|
|
|
281
281
|
std::string cycle = incycle?", incycle":"";
|
|
282
282
|
|
|
283
283
|
if(forksite)
|
|
284
|
-
|
|
284
|
+
{
|
|
285
|
+
SVFUtil::outs() << "[ Thread: $" << SVFUtil::getSourceLoc(forksite) << "$ " << SVFUtil::value2String(forksite) << "\t Contexts: " << cxtToStr()
|
|
285
286
|
<< loop << cycle <<" ]\n";
|
|
287
|
+
}
|
|
286
288
|
else
|
|
289
|
+
{
|
|
287
290
|
SVFUtil::outs() << "[ Thread: " << "main " << "\t Contexts: " << cxtToStr()
|
|
288
291
|
<< loop << cycle <<" ]\n";
|
|
292
|
+
}
|
|
289
293
|
}
|
|
290
294
|
protected:
|
|
291
295
|
CallStrCxt cxt;
|
|
@@ -134,10 +134,12 @@ public:
|
|
|
134
134
|
extf_t get_type(const SVFFunction* F) const
|
|
135
135
|
{
|
|
136
136
|
assert(F);
|
|
137
|
-
std::string funName = F->getName()
|
|
137
|
+
std::string funName = F->getName();
|
|
138
138
|
if(F->isIntrinsic())
|
|
139
139
|
{
|
|
140
|
-
|
|
140
|
+
unsigned start = funName.find('.');
|
|
141
|
+
unsigned end = funName.substr(start + 1).find('.');
|
|
142
|
+
funName = "llvm." + funName.substr(start + 1, end);
|
|
141
143
|
}
|
|
142
144
|
llvm::StringMap<extf_t>::const_iterator it= info.find(funName);
|
|
143
145
|
if(it == info.end())
|
|
@@ -138,8 +138,8 @@ private:
|
|
|
138
138
|
}
|
|
139
139
|
else
|
|
140
140
|
{
|
|
141
|
-
|
|
142
|
-
SVFUtil::outs() <<
|
|
141
|
+
SVFUtil::outs() << "Value is NOT a Instruction, Argument, Function, GlobalVariable, BasicBlock, Constant or InlineAsm" << std::endl;
|
|
142
|
+
SVFUtil::outs() << SVFUtil::value2String(value) << "\n";
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
#define INCLUDE_UTIL_SVFBASICTYPES_H_
|
|
33
33
|
|
|
34
34
|
#include <llvm/ADT/SparseBitVector.h> // for points-to
|
|
35
|
-
#include <llvm/Support/raw_ostream.h> // for output
|
|
36
35
|
#include <llvm/Support/CommandLine.h> // for command line options
|
|
37
36
|
#include <llvm/ADT/StringMap.h> // for StringMap
|
|
38
37
|
|
|
38
|
+
#include <iostream>
|
|
39
39
|
#include <vector>
|
|
40
40
|
#include <list>
|
|
41
41
|
#include <set>
|
|
@@ -72,6 +72,8 @@ template <class T> struct Hash {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
+
typedef std::ostream OutStream;
|
|
76
|
+
|
|
75
77
|
typedef unsigned u32_t;
|
|
76
78
|
typedef signed s32_t;
|
|
77
79
|
typedef unsigned long long u64_t;
|
|
@@ -179,6 +181,22 @@ template <> struct Hash<NodePair>
|
|
|
179
181
|
/// Size of native integer that we'll use for bit vectors, in bits.
|
|
180
182
|
#define NATIVE_INT_SIZE (sizeof(unsigned long long) * CHAR_BIT)
|
|
181
183
|
|
|
184
|
+
enum ModRefInfo
|
|
185
|
+
{
|
|
186
|
+
ModRef,
|
|
187
|
+
Ref,
|
|
188
|
+
Mod,
|
|
189
|
+
NoModRef,
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
enum AliasResult
|
|
193
|
+
{
|
|
194
|
+
MustAlias,
|
|
195
|
+
MayAlias,
|
|
196
|
+
PartialAlias,
|
|
197
|
+
NoAlias,
|
|
198
|
+
};
|
|
199
|
+
|
|
182
200
|
class SVFValue
|
|
183
201
|
{
|
|
184
202
|
|
|
@@ -228,7 +246,7 @@ public:
|
|
|
228
246
|
}
|
|
229
247
|
//@}
|
|
230
248
|
|
|
231
|
-
const
|
|
249
|
+
const std::string getName() const
|
|
232
250
|
{
|
|
233
251
|
return value;
|
|
234
252
|
}
|
|
@@ -240,7 +258,7 @@ public:
|
|
|
240
258
|
|
|
241
259
|
/// Overloading operator << for dumping ICFG node ID
|
|
242
260
|
//@{
|
|
243
|
-
friend
|
|
261
|
+
friend OutStream& operator<< (OutStream &o, const SVFValue &node)
|
|
244
262
|
{
|
|
245
263
|
o << node.getName();
|
|
246
264
|
return o;
|
|
@@ -46,20 +46,20 @@ namespace SVFUtil
|
|
|
46
46
|
{
|
|
47
47
|
|
|
48
48
|
/// Overwrite llvm::outs()
|
|
49
|
-
inline
|
|
49
|
+
inline std::ostream &outs()
|
|
50
50
|
{
|
|
51
|
-
return
|
|
51
|
+
return std::cout;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/// Overwrite llvm::errs()
|
|
55
|
-
inline
|
|
55
|
+
inline std::ostream &errs()
|
|
56
56
|
{
|
|
57
|
-
return
|
|
57
|
+
return std::cerr;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/// Dump sparse bitvector set
|
|
61
|
-
void dumpSet(NodeBS To,
|
|
62
|
-
void dumpSet(PointsTo To,
|
|
61
|
+
void dumpSet(NodeBS To, OutStream & O = SVFUtil::outs());
|
|
62
|
+
void dumpSet(PointsTo To, OutStream & O = SVFUtil::outs());
|
|
63
63
|
|
|
64
64
|
/// Dump points-to set
|
|
65
65
|
void dumpPointsToSet(unsigned node, NodeBS To) ;
|
|
@@ -89,7 +89,7 @@ std::string bugMsg3(std::string msg);
|
|
|
89
89
|
std::string pasMsg(std::string msg);
|
|
90
90
|
|
|
91
91
|
/// Print memory usage in KB.
|
|
92
|
-
void reportMemoryUsageKB(const std::string& infor,
|
|
92
|
+
void reportMemoryUsageKB(const std::string& infor, OutStream & O = SVFUtil::outs());
|
|
93
93
|
|
|
94
94
|
/// Get memory usage from system file. Return TRUE if succeed.
|
|
95
95
|
bool getMemoryUsageKB(u32_t* vmrss_kb, u32_t* vmsize_kb);
|
|
@@ -51,7 +51,7 @@ class SVFG;
|
|
|
51
51
|
*/
|
|
52
52
|
// excised ", public llvm::AliasAnalysis" as that has a very light interface
|
|
53
53
|
// and I want to see what breaks.
|
|
54
|
-
class WPAPass
|
|
54
|
+
class WPAPass
|
|
55
55
|
{
|
|
56
56
|
typedef std::vector<PointerAnalysis*> PTAVector;
|
|
57
57
|
|
|
@@ -67,7 +67,7 @@ public:
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
/// Constructor needs TargetLibraryInfo to be passed to the AliasAnalysis
|
|
70
|
-
WPAPass()
|
|
70
|
+
WPAPass()
|
|
71
71
|
{
|
|
72
72
|
|
|
73
73
|
}
|
|
@@ -75,20 +75,6 @@ public:
|
|
|
75
75
|
/// Destructor
|
|
76
76
|
virtual ~WPAPass();
|
|
77
77
|
|
|
78
|
-
/// LLVM analysis usage
|
|
79
|
-
virtual inline void getAnalysisUsage(AnalysisUsage &au) const
|
|
80
|
-
{
|
|
81
|
-
// declare your dependencies here.
|
|
82
|
-
/// do not intend to change the IR in this pass,
|
|
83
|
-
au.setPreservesAll();
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
/// Get adjusted analysis for alias analysis
|
|
87
|
-
virtual inline void* getAdjustedAnalysisPointer(AnalysisID)
|
|
88
|
-
{
|
|
89
|
-
return this;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
78
|
/// Interface expose to users of our pointer analysis, given Location infos
|
|
93
79
|
virtual inline AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
|
|
94
80
|
{
|
|
Binary file
|
|
Binary file
|
|
@@ -21,7 +21,7 @@ namespace SVF
|
|
|
21
21
|
* Demand-Driven Pointer Analysis.
|
|
22
22
|
* This class performs various pointer analysis on the given module.
|
|
23
23
|
*/
|
|
24
|
-
class DDAPass
|
|
24
|
+
class DDAPass
|
|
25
25
|
{
|
|
26
26
|
|
|
27
27
|
public:
|
|
@@ -31,21 +31,9 @@ public:
|
|
|
31
31
|
typedef OrderedSet<const SVFGEdge*> SVFGEdgeSet;
|
|
32
32
|
typedef std::vector<PointerAnalysis*> PTAVector;
|
|
33
33
|
|
|
34
|
-
DDAPass() :
|
|
34
|
+
DDAPass() : _pta(nullptr), _client(nullptr) {}
|
|
35
35
|
~DDAPass();
|
|
36
36
|
|
|
37
|
-
virtual inline void getAnalysisUsage(AnalysisUsage &au) const
|
|
38
|
-
{
|
|
39
|
-
// declare your dependencies here.
|
|
40
|
-
/// do not intend to change the IR in this pass,
|
|
41
|
-
au.setPreservesAll();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
virtual inline void* getAdjustedAnalysisPointer(AnalysisID)
|
|
45
|
-
{
|
|
46
|
-
return this;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
37
|
/// Interface expose to users of our pointer analysis, given Location infos
|
|
50
38
|
virtual inline AliasResult alias(const MemoryLocation &LocA, const MemoryLocation &LocB)
|
|
51
39
|
{
|
|
@@ -54,7 +54,7 @@ public:
|
|
|
54
54
|
* Write the graph into dot file for debugging purpose
|
|
55
55
|
*/
|
|
56
56
|
template<class GraphType>
|
|
57
|
-
static void WriteGraphToFile(
|
|
57
|
+
static void WriteGraphToFile(SVF::OutStream &O,
|
|
58
58
|
const std::string &GraphName, const GraphType >, bool simple = false)
|
|
59
59
|
{
|
|
60
60
|
// Filename of the output dot file
|
|
@@ -83,7 +83,7 @@ public:
|
|
|
83
83
|
* Print the graph to command line
|
|
84
84
|
*/
|
|
85
85
|
template<class GraphType>
|
|
86
|
-
static void PrintGraph(
|
|
86
|
+
static void PrintGraph(SVF::OutStream &O, const std::string &GraphName,
|
|
87
87
|
const GraphType >)
|
|
88
88
|
{
|
|
89
89
|
///Define the GTraits and node iterator for printing
|
|
@@ -96,7 +96,7 @@ public:
|
|
|
96
96
|
|
|
97
97
|
/// Overloading operator << for dumping ICFG node ID
|
|
98
98
|
//@{
|
|
99
|
-
friend
|
|
99
|
+
friend OutStream& operator<< (OutStream &o, const ICFGEdge &edge)
|
|
100
100
|
{
|
|
101
101
|
o << edge.toString();
|
|
102
102
|
return o;
|
|
@@ -145,16 +145,16 @@ public:
|
|
|
145
145
|
void printStat(string statname)
|
|
146
146
|
{
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
SVFUtil::outs() << "\n************ " << statname << " ***************\n";
|
|
149
|
+
SVFUtil::outs().flags(std::ios::left);
|
|
150
150
|
unsigned field_width = 20;
|
|
151
151
|
for(NUMStatMap::iterator it = PTNumStatMap.begin(), eit = PTNumStatMap.end(); it!=eit; ++it)
|
|
152
152
|
{
|
|
153
153
|
// format out put with width 20 space
|
|
154
|
-
|
|
154
|
+
SVFUtil::outs() << std::setw(field_width) << it->first << it->second << "\n";
|
|
155
155
|
}
|
|
156
156
|
PTNumStatMap.clear();
|
|
157
|
-
|
|
157
|
+
SVFUtil::outs().flush();
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
160
|
|
|
@@ -154,7 +154,7 @@ public:
|
|
|
154
154
|
|
|
155
155
|
/// Overloading operator << for dumping ICFG node ID
|
|
156
156
|
//@{
|
|
157
|
-
friend
|
|
157
|
+
friend OutStream& operator<< (OutStream &o, const PTACallGraphEdge &edge)
|
|
158
158
|
{
|
|
159
159
|
o << edge.toString();
|
|
160
160
|
return o;
|
|
@@ -201,7 +201,7 @@ public:
|
|
|
201
201
|
|
|
202
202
|
/// Overloading operator << for dumping ICFG node ID
|
|
203
203
|
//@{
|
|
204
|
-
friend
|
|
204
|
+
friend OutStream& operator<< (OutStream &o, const PTACallGraphNode &node)
|
|
205
205
|
{
|
|
206
206
|
o << node.toString();
|
|
207
207
|
return o;
|
|
@@ -555,7 +555,7 @@ protected:
|
|
|
555
555
|
/// we will set this phi node's def later
|
|
556
556
|
/// Ideally, every function uniqueFunRet should be a PhiNode (SVFIRBuilder.cpp), unless it does not have ret instruction
|
|
557
557
|
if (!pag->isPhiNode(uniqueFunRet)){
|
|
558
|
-
std::string warn = fun->getName()
|
|
558
|
+
std::string warn = fun->getName();
|
|
559
559
|
SVFUtil::writeWrnMsg(warn + " does not have any ret instruction!");
|
|
560
560
|
setDef(uniqueFunRet, sNode);
|
|
561
561
|
}
|
|
@@ -124,7 +124,7 @@ public:
|
|
|
124
124
|
|
|
125
125
|
/// Overloading operator << for dumping ICFG node ID
|
|
126
126
|
//@{
|
|
127
|
-
friend
|
|
127
|
+
friend OutStream& operator<< (OutStream &o, const VFGEdge &edge)
|
|
128
128
|
{
|
|
129
129
|
o << edge.toString();
|
|
130
130
|
return o;
|
|
@@ -68,14 +68,6 @@ public:
|
|
|
68
68
|
|
|
69
69
|
void dump(Module &module, MHP *mhp, LockAnalysis *lsa);
|
|
70
70
|
|
|
71
|
-
/// Get analysis usage
|
|
72
|
-
inline virtual void getAnalysisUsage(AnalysisUsage& au) const
|
|
73
|
-
{
|
|
74
|
-
/// do not intend to change the IR in this pass,
|
|
75
|
-
au.setPreservesAll();
|
|
76
|
-
au.addRequired<ScalarEvolutionWrapperPass>();
|
|
77
|
-
}
|
|
78
|
-
|
|
79
71
|
// Get ScalarEvolution for Function F.
|
|
80
72
|
static inline ScalarEvolution* getSE(const Function *F)
|
|
81
73
|
{
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
#define CONDVAR_H_
|
|
32
32
|
|
|
33
33
|
#include "Util/SVFUtil.h"
|
|
34
|
-
#include "llvm/Support/raw_ostream.h"
|
|
35
34
|
#include "MemoryModel/PointsTo.h"
|
|
36
35
|
|
|
37
36
|
namespace SVF
|
|
@@ -114,7 +113,7 @@ public:
|
|
|
114
113
|
return rawstr.str();
|
|
115
114
|
}
|
|
116
115
|
|
|
117
|
-
friend
|
|
116
|
+
friend OutStream& operator<< (OutStream &o, const CondVar<Cond> &cvar)
|
|
118
117
|
{
|
|
119
118
|
o << cvar.toString();
|
|
120
119
|
return o;
|
|
@@ -708,7 +707,7 @@ public:
|
|
|
708
707
|
|
|
709
708
|
// Print all points-to targets
|
|
710
709
|
//@{
|
|
711
|
-
inline void dump(
|
|
710
|
+
inline void dump(OutStream & O) const
|
|
712
711
|
{
|
|
713
712
|
CondPtsConstIter it = cptsBegin();
|
|
714
713
|
CondPtsConstIter eit = cptsEnd();
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
#ifndef MUTABLE_POINTSTO_H_
|
|
5
5
|
#define MUTABLE_POINTSTO_H_
|
|
6
6
|
|
|
7
|
+
#include<fstream>
|
|
8
|
+
|
|
7
9
|
#include "MemoryModel/AbstractPointsToDS.h"
|
|
8
10
|
#include "Util/SVFBasicTypes.h"
|
|
9
11
|
#include "Util/SVFUtil.h"
|
|
@@ -124,7 +126,7 @@ public:
|
|
|
124
126
|
///@}
|
|
125
127
|
|
|
126
128
|
protected:
|
|
127
|
-
virtual inline void dumpPts(const PtsMap & ptsSet,
|
|
129
|
+
virtual inline void dumpPts(const PtsMap & ptsSet,OutStream & O = SVFUtil::outs()) const
|
|
128
130
|
{
|
|
129
131
|
for (PtsMapConstIter nodeIt = ptsSet.begin(); nodeIt != ptsSet.end(); nodeIt++)
|
|
130
132
|
{
|
|
@@ -581,10 +583,9 @@ public:
|
|
|
581
583
|
mutPTData.dumpPTData();
|
|
582
584
|
/// dump points-to of address-taken variables
|
|
583
585
|
std::error_code ErrInfo;
|
|
584
|
-
|
|
585
|
-
if (
|
|
586
|
+
std::fstream f("svfg_pts.data", std::ios_base::out);
|
|
587
|
+
if (f.good())
|
|
586
588
|
{
|
|
587
|
-
raw_fd_ostream & osm = F.os();
|
|
588
589
|
NodeBS locs;
|
|
589
590
|
for(DFPtsMapconstIter it = dfInPtsMap.begin(), eit = dfInPtsMap.end(); it!=eit; ++it)
|
|
590
591
|
locs.set(it->first);
|
|
@@ -597,31 +598,29 @@ public:
|
|
|
597
598
|
LocID loc = *it;
|
|
598
599
|
if (this->hasDFInSet(loc))
|
|
599
600
|
{
|
|
600
|
-
|
|
601
|
-
this->dumpPts(this->getDFInPtsMap(loc),
|
|
602
|
-
|
|
601
|
+
f << "Loc:" << loc << " IN:{";
|
|
602
|
+
this->dumpPts(this->getDFInPtsMap(loc), f);
|
|
603
|
+
f << "}\n";
|
|
603
604
|
}
|
|
604
605
|
|
|
605
606
|
if (this->hasDFOutSet(loc))
|
|
606
607
|
{
|
|
607
|
-
|
|
608
|
-
this->dumpPts(this->getDFOutPtsMap(loc),
|
|
609
|
-
|
|
608
|
+
f << "Loc:" << loc << " OUT:{";
|
|
609
|
+
this->dumpPts(this->getDFOutPtsMap(loc), f);
|
|
610
|
+
f << "}\n";
|
|
610
611
|
}
|
|
611
612
|
}
|
|
612
|
-
|
|
613
|
-
if (
|
|
613
|
+
f.close();
|
|
614
|
+
if (f.good())
|
|
614
615
|
{
|
|
615
616
|
SVFUtil::outs() << "\n";
|
|
616
|
-
F.keep();
|
|
617
617
|
return;
|
|
618
618
|
}
|
|
619
619
|
}
|
|
620
620
|
SVFUtil::outs() << " error opening file for writing!\n";
|
|
621
|
-
F.os().clear_error();
|
|
622
621
|
}
|
|
623
622
|
|
|
624
|
-
virtual inline void dumpPts(const PtsMap & ptsSet,
|
|
623
|
+
virtual inline void dumpPts(const PtsMap & ptsSet,OutStream & O = SVFUtil::outs()) const
|
|
625
624
|
{
|
|
626
625
|
for (PtsMapConstIter nodeIt = ptsSet.begin(); nodeIt != ptsSet.end(); nodeIt++)
|
|
627
626
|
{
|
|
@@ -296,31 +296,31 @@ public:
|
|
|
296
296
|
void printStats(const std::string subtitle) const
|
|
297
297
|
{
|
|
298
298
|
static const unsigned fieldWidth = 25;
|
|
299
|
-
|
|
299
|
+
SVFUtil::outs().flags(std::ios::left);
|
|
300
300
|
|
|
301
|
-
|
|
301
|
+
SVFUtil::outs() << "****Persistent Points-To Cache Statistics: " << subtitle << "****\n";
|
|
302
302
|
|
|
303
|
-
|
|
303
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "UniquePointsToSets" << idToPts.size() << "\n";
|
|
304
304
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
305
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "TotalUnions" << totalUnions << "\n";
|
|
306
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "PropertyUnions" << propertyUnions << "\n";
|
|
307
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "UniqueUnions" << uniqueUnions << "\n";
|
|
308
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "LookupUnions" << lookupUnions << "\n";
|
|
309
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "PreemptiveUnions" << preemptiveUnions << "\n";
|
|
310
310
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
311
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "TotalComplements" << totalComplements << "\n";
|
|
312
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "PropertyComplements" << propertyComplements << "\n";
|
|
313
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "UniqueComplements" << uniqueComplements << "\n";
|
|
314
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "LookupComplements" << lookupComplements << "\n";
|
|
315
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "PreemptiveComplements" << preemptiveComplements << "\n";
|
|
316
316
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
317
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "TotalIntersections" << totalIntersections << "\n";
|
|
318
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "PropertyIntersections" << propertyIntersections << "\n";
|
|
319
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "UniqueIntersections" << uniqueIntersections << "\n";
|
|
320
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "LookupIntersections" << lookupIntersections << "\n";
|
|
321
|
+
SVFUtil::outs() << std::setw(fieldWidth) << "PreemptiveIntersections" << preemptiveIntersections << "\n";
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
SVFUtil::outs().flush();
|
|
324
324
|
}
|
|
325
325
|
|
|
326
326
|
/// Returns all points-to sets stored by this cache as keys to a map.
|
|
@@ -400,7 +400,7 @@ public:
|
|
|
400
400
|
//@}
|
|
401
401
|
|
|
402
402
|
/// Resolve indirect call edges
|
|
403
|
-
virtual void resolveIndCalls(const CallICFGNode* cs, const PointsTo& target, CallEdgeMap& newEdges
|
|
403
|
+
virtual void resolveIndCalls(const CallICFGNode* cs, const PointsTo& target, CallEdgeMap& newEdges);
|
|
404
404
|
/// Match arguments for callsite at caller and callee
|
|
405
405
|
bool matchArgs(const CallICFGNode* cs, const SVFFunction* callee);
|
|
406
406
|
|
|
@@ -536,15 +536,15 @@ public:
|
|
|
536
536
|
CPtSet cpts2;
|
|
537
537
|
expandFIObjs(pts2,cpts2);
|
|
538
538
|
if (containBlackHoleNode(cpts1) || containBlackHoleNode(cpts2))
|
|
539
|
-
return
|
|
539
|
+
return AliasResult::MayAlias;
|
|
540
540
|
else if(this->getAnalysisTy()==PathS_DDA && contains(cpts1,cpts2) && contains(cpts2,cpts1))
|
|
541
541
|
{
|
|
542
|
-
return
|
|
542
|
+
return AliasResult::MustAlias;
|
|
543
543
|
}
|
|
544
544
|
else if(overlap(cpts1,cpts2))
|
|
545
|
-
return
|
|
545
|
+
return AliasResult::MayAlias;
|
|
546
546
|
else
|
|
547
|
-
return
|
|
547
|
+
return AliasResult::NoAlias;
|
|
548
548
|
}
|
|
549
549
|
/// Test blk node for cpts
|
|
550
550
|
inline bool containBlackHoleNode(const CPtSet& cpts)
|
|
@@ -583,7 +583,7 @@ public:
|
|
|
583
583
|
}
|
|
584
584
|
else if (!SVFUtil::isa<DummyValVar>(node))
|
|
585
585
|
{
|
|
586
|
-
SVFUtil::outs() << "##<" << node->getValue()->getName() << "> ";
|
|
586
|
+
SVFUtil::outs() << "##<" << node->getValue()->getName().str() << "> ";
|
|
587
587
|
//SVFUtil::outs() << "Source Loc: " << SVFUtil::getSourceLoc(node->getValue());
|
|
588
588
|
}
|
|
589
589
|
|
|
@@ -167,7 +167,7 @@ public:
|
|
|
167
167
|
//@}
|
|
168
168
|
/// Overloading operator << for dumping SVFVar value
|
|
169
169
|
//@{
|
|
170
|
-
friend
|
|
170
|
+
friend OutStream& operator<< (OutStream &o, const SVFStmt &edge)
|
|
171
171
|
{
|
|
172
172
|
o << edge.toString();
|
|
173
173
|
return o;
|
|
@@ -250,7 +250,7 @@ public:
|
|
|
250
250
|
//@}
|
|
251
251
|
/// Overloading operator << for dumping SVFVar value
|
|
252
252
|
//@{
|
|
253
|
-
friend
|
|
253
|
+
friend OutStream& operator<< (OutStream &o, const SVFVar &node)
|
|
254
254
|
{
|
|
255
255
|
o << node.toString();
|
|
256
256
|
return o;
|
|
@@ -173,12 +173,6 @@ public:
|
|
|
173
173
|
return dl;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
/// Helper method to get the size of the type from target data layout
|
|
177
|
-
//@{
|
|
178
|
-
u32_t getTypeSizeInBytes(const Type* type);
|
|
179
|
-
u32_t getTypeSizeInBytes(const StructType *sty, u32_t field_index);
|
|
180
|
-
//@}
|
|
181
|
-
|
|
182
176
|
/// special value
|
|
183
177
|
// @{
|
|
184
178
|
static bool isNullPtrSym(const Value *val);
|