svf-lib 1.0.1258 → 1.0.1260
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-osx/Release-build/lib/libSvf.a +0 -0
- package/SVF-osx/include/CFL/CFLAlias.h +2 -3
- package/SVF-osx/include/CFL/CFLGrammar.h +2 -0
- package/SVF-osx/include/CFL/CFLGrammar.txt +28 -28
- package/SVF-osx/include/CFL/PEGGrammar.txt +7 -7
- package/SVF-osx/include/CFL/VFG.txt +3 -3
- package/SVF-osx/include/SVF-FE/BasicTypes.h +3 -0
- package/SVF-osx/include/Util/BasicTypes.h +8 -101
- package/package.json +1 -1
|
Binary file
|
|
@@ -107,10 +107,9 @@ public:
|
|
|
107
107
|
if (edge != nullptr )
|
|
108
108
|
{
|
|
109
109
|
return false;
|
|
110
|
-
|
|
111
110
|
}
|
|
112
|
-
CFLGrammar::Kind copyKind = grammar->str2Kind("
|
|
113
|
-
CFLGrammar::Kind copybarKind = grammar->str2Kind("
|
|
111
|
+
CFLGrammar::Kind copyKind = grammar->str2Kind("copy");
|
|
112
|
+
CFLGrammar::Kind copybarKind = grammar->str2Kind("copybar");
|
|
114
113
|
solver->pushIntoWorklist(graph->addCFLEdge(graph->getGNode(src),graph->getGNode(dst), copyKind));
|
|
115
114
|
solver->pushIntoWorklist(graph->addCFLEdge(graph->getGNode(dst),graph->getGNode(src), copybarKind));
|
|
116
115
|
return true;
|
|
@@ -246,6 +246,8 @@ public:
|
|
|
246
246
|
|
|
247
247
|
Symbol insertNonTerminalSymbol(std::string strLit);
|
|
248
248
|
|
|
249
|
+
Symbol insertTerminalSymbol(std::string strLit);
|
|
250
|
+
|
|
249
251
|
void insertAttribute(Kind kind, Attribute a);
|
|
250
252
|
|
|
251
253
|
inline static Kind getAttributedKind(Attribute attribute, Kind kind)
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
Start:
|
|
2
2
|
V
|
|
3
3
|
Terminal:
|
|
4
|
-
|
|
4
|
+
addr copy store load gep vgep
|
|
5
5
|
Productions:
|
|
6
6
|
F -> epsilon;
|
|
7
|
-
F -> F
|
|
8
|
-
F ->
|
|
9
|
-
F -> F
|
|
10
|
-
F ->
|
|
7
|
+
F -> F copy;
|
|
8
|
+
F -> addr Memflow;
|
|
9
|
+
F -> F store V load;
|
|
10
|
+
F -> store Memflow load;
|
|
11
11
|
Fbar -> epsilon;
|
|
12
|
-
Fbar ->
|
|
13
|
-
Fbar -> Memflowbar
|
|
14
|
-
Fbar ->
|
|
15
|
-
Fbar ->
|
|
12
|
+
Fbar -> copybar Fbar;
|
|
13
|
+
Fbar -> Memflowbar addrbar;
|
|
14
|
+
Fbar -> loadbar V storebar Fbar;
|
|
15
|
+
Fbar -> loadbar Memflowbar storebar;
|
|
16
16
|
V -> Fbar V F;
|
|
17
|
-
V ->
|
|
18
|
-
V ->
|
|
19
|
-
V ->
|
|
20
|
-
V ->
|
|
21
|
-
V ->
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Memflow ->
|
|
17
|
+
V -> addrbar addr;
|
|
18
|
+
V -> gepbar_i V gep_i;
|
|
19
|
+
V -> gepbarpath V gep_0;
|
|
20
|
+
V -> gepbar_i F gep_i;
|
|
21
|
+
V -> gepbar_i Fbar gep_i;
|
|
22
|
+
copy -> vgep;
|
|
23
|
+
copybar -> vgepbar;
|
|
24
|
+
gep_1 -> gep_0 F gep_1;
|
|
25
|
+
gepbar_1 -> gepbar_1 Fbar gepbar_0;
|
|
26
|
+
gep_1 -> gep_0 F vgep;
|
|
27
|
+
gepbar_1 -> vgepbar Fbar gepbar_0;
|
|
28
|
+
gepbarpath -> gepbar_0 gepbar_0;
|
|
29
|
+
gepbarpath -> gepbarpath gepbar_0;
|
|
30
|
+
Memflow -> load store;
|
|
31
31
|
Memflow -> Fbar Memflow;
|
|
32
32
|
Memflow -> F Memflow Fbar;
|
|
33
|
-
Memflow ->
|
|
34
|
-
Memflow ->
|
|
35
|
-
Memflowbar ->
|
|
33
|
+
Memflow -> gep_i Memflow gepbar_i;
|
|
34
|
+
Memflow -> gepbar_i Memflow gep_i;
|
|
35
|
+
Memflowbar -> storebar loadbar;
|
|
36
36
|
Memflowbar -> Memflowbar F;
|
|
37
37
|
Memflowbar -> F Memflowbar Fbar;
|
|
38
|
-
Memflowbar ->
|
|
39
|
-
Memflowbar ->
|
|
38
|
+
Memflowbar -> gep_i Memflowbar gepbar_i;
|
|
39
|
+
Memflowbar -> gepbar_i Memflowbar gep_i;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Start:
|
|
2
2
|
V
|
|
3
3
|
Terminal:
|
|
4
|
-
|
|
4
|
+
addr copy store load gep
|
|
5
5
|
Productions:
|
|
6
|
-
F -> (
|
|
7
|
-
Fbar -> ( M ?
|
|
8
|
-
M ->
|
|
9
|
-
V -> Fbar V F |
|
|
10
|
-
ArrayPath ->
|
|
11
|
-
Memcpy ->
|
|
6
|
+
F -> ( copy M ? ) *;
|
|
7
|
+
Fbar -> ( M ? copybar ) *;
|
|
8
|
+
M -> addr V addrbar;
|
|
9
|
+
V -> Fbar V F | gepbar_i V gep_i | M | epsilon | gepbar_i Memcpy gep_i | gep_i Memcpy gepbar_i | ArrayPath V gep_0;
|
|
10
|
+
ArrayPath -> gepbar_0 gepbar_0 | ArrayPath gepbar_0;
|
|
11
|
+
Memcpy -> addrbar V addr | gep_i Memcpy gepbar_i | F Memcpy Fbar;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Start:
|
|
2
2
|
A
|
|
3
3
|
Terminal:
|
|
4
|
-
a
|
|
4
|
+
a call ret
|
|
5
5
|
Productions:
|
|
6
|
-
A -> A A | a |
|
|
7
|
-
Abar -> Abar Abar | abar |
|
|
6
|
+
A -> A A | a | call_i A ret_i | epsilon;
|
|
7
|
+
Abar -> Abar Abar | abar | retbar_i Abar callbar_i | epsilon;
|
|
@@ -188,6 +188,9 @@ typedef llvm::SCEVConstant SCEVConstant;
|
|
|
188
188
|
typedef llvm::ScalarEvolution ScalarEvolution;
|
|
189
189
|
typedef llvm::SCEV SCEV;
|
|
190
190
|
|
|
191
|
+
/// LLVM outputs
|
|
192
|
+
typedef llvm::raw_fd_ostream raw_fd_ostream;
|
|
193
|
+
|
|
191
194
|
// LLVM Types.
|
|
192
195
|
typedef llvm::VectorType VectorType;
|
|
193
196
|
#if (LLVM_VERSION_MAJOR >= 9)
|
|
@@ -76,7 +76,6 @@ typedef llvm::GlobalVariable GlobalVariable;
|
|
|
76
76
|
|
|
77
77
|
/// LLVM outputs
|
|
78
78
|
typedef llvm::raw_string_ostream raw_string_ostream;
|
|
79
|
-
typedef llvm::raw_fd_ostream raw_fd_ostream;
|
|
80
79
|
|
|
81
80
|
/// LLVM types
|
|
82
81
|
typedef llvm::StructType StructType;
|
|
@@ -214,17 +213,7 @@ public:
|
|
|
214
213
|
return bb2LoopMap.find(bb)!=bb2LoopMap.end();
|
|
215
214
|
}
|
|
216
215
|
|
|
217
|
-
|
|
218
|
-
{
|
|
219
|
-
Map<const BasicBlock*, std::vector<const BasicBlock*>>::const_iterator mapIter = bb2LoopMap.find(bb);
|
|
220
|
-
if(mapIter != bb2LoopMap.end())
|
|
221
|
-
return mapIter->second;
|
|
222
|
-
else
|
|
223
|
-
{
|
|
224
|
-
assert(hasLoopInfo(bb) && "loopinfo does not exit(bb not in a loop)");
|
|
225
|
-
abort();
|
|
226
|
-
}
|
|
227
|
-
}
|
|
216
|
+
const std::vector<const BasicBlock*>& getLoopInfo(const BasicBlock* bb) const;
|
|
228
217
|
|
|
229
218
|
inline void addToBB2LoopMap(const BasicBlock* bb, const BasicBlock* loopBB)
|
|
230
219
|
{
|
|
@@ -266,95 +255,13 @@ public:
|
|
|
266
255
|
return this->exitBB;
|
|
267
256
|
}
|
|
268
257
|
|
|
269
|
-
void getExitBlocksOfLoop(const BasicBlock* bb, Set<const BasicBlock*>& exitbbs) const
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
{
|
|
277
|
-
for (succ_const_iterator succIt = succ_begin(block); succIt != succ_end(block); succIt++)
|
|
278
|
-
{
|
|
279
|
-
const BasicBlock* succ = *succIt;
|
|
280
|
-
if ((std::find(blocks.begin(), blocks.end(), succ)==blocks.end()))
|
|
281
|
-
exitbbs.insert(succ);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
bool isLoopHeader(const BasicBlock* bb) const
|
|
288
|
-
{
|
|
289
|
-
if (hasLoopInfo(bb))
|
|
290
|
-
{
|
|
291
|
-
const std::vector<const BasicBlock*>& blocks = getLoopInfo(bb);
|
|
292
|
-
assert(!blocks.empty() && "no available loop info?");
|
|
293
|
-
return blocks.front() == bb;
|
|
294
|
-
}
|
|
295
|
-
return false;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
bool dominate(const BasicBlock* bbKey, const BasicBlock* bbValue) const
|
|
299
|
-
{
|
|
300
|
-
if (bbKey == bbValue)
|
|
301
|
-
return true;
|
|
302
|
-
|
|
303
|
-
// An unreachable node is dominated by anything.
|
|
304
|
-
if (isUnreachable(bbValue))
|
|
305
|
-
{
|
|
306
|
-
return true;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
// And dominates nothing.
|
|
310
|
-
if (isUnreachable(bbKey))
|
|
311
|
-
{
|
|
312
|
-
return false;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
const Map<const BasicBlock*,Set<const BasicBlock*>>& dtBBsMap = getDomTreeMap();
|
|
316
|
-
Map<const BasicBlock*,Set<const BasicBlock*>>::const_iterator mapIter = dtBBsMap.find(bbKey);
|
|
317
|
-
if (mapIter != dtBBsMap.end())
|
|
318
|
-
{
|
|
319
|
-
const Set<const BasicBlock*> & dtBBs = mapIter->second;
|
|
320
|
-
if (dtBBs.find(bbValue) != dtBBs.end())
|
|
321
|
-
{
|
|
322
|
-
return true;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
return false;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
bool postDominate(const BasicBlock* bbKey, const BasicBlock* bbValue) const
|
|
330
|
-
{
|
|
331
|
-
if (bbKey == bbValue)
|
|
332
|
-
return true;
|
|
333
|
-
|
|
334
|
-
// An unreachable node is dominated by anything.
|
|
335
|
-
if (isUnreachable(bbValue))
|
|
336
|
-
{
|
|
337
|
-
return true;
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
// And dominates nothing.
|
|
341
|
-
if (isUnreachable(bbKey))
|
|
342
|
-
{
|
|
343
|
-
return false;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
const Map<const BasicBlock*,Set<const BasicBlock*>>& dtBBsMap = getPostDomTreeMap();
|
|
347
|
-
Map<const BasicBlock*,Set<const BasicBlock*>>::const_iterator mapIter = dtBBsMap.find(bbKey);
|
|
348
|
-
if (mapIter != dtBBsMap.end())
|
|
349
|
-
{
|
|
350
|
-
const Set<const BasicBlock*> & dtBBs = mapIter->second;
|
|
351
|
-
if (dtBBs.find(bbValue) != dtBBs.end())
|
|
352
|
-
{
|
|
353
|
-
return true;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
return false;
|
|
357
|
-
}
|
|
258
|
+
void getExitBlocksOfLoop(const BasicBlock* bb, Set<const BasicBlock*>& exitbbs) const;
|
|
259
|
+
|
|
260
|
+
bool isLoopHeader(const BasicBlock* bb) const;
|
|
261
|
+
|
|
262
|
+
bool dominate(const BasicBlock* bbKey, const BasicBlock* bbValue) const;
|
|
263
|
+
|
|
264
|
+
bool postDominate(const BasicBlock* bbKey, const BasicBlock* bbValue) const;
|
|
358
265
|
|
|
359
266
|
// Dump Control Flow Graph of llvm function, with instructions
|
|
360
267
|
void viewCFG();
|