svf-lib 1.0.1293 → 1.0.1295
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/CFLGraph.h +6 -6
- package/SVF-linux/include/Graphs/CHG.h +6 -6
- package/SVF-linux/include/Graphs/ConsG.h +6 -6
- package/SVF-linux/include/Graphs/DOTGraphTraits.h +3 -3
- package/SVF-linux/include/Graphs/GenericGraph.h +10 -9
- package/SVF-linux/include/Graphs/GraphPrinter.h +2 -2
- package/SVF-linux/include/Graphs/GraphTraits.h +29 -29
- package/SVF-linux/include/Graphs/GraphWriter.h +6 -6
- package/SVF-linux/include/Graphs/ICFG.h +6 -6
- package/SVF-linux/include/Graphs/IRGraph.h +6 -7
- package/SVF-linux/include/Graphs/PTACallGraph.h +6 -6
- package/SVF-linux/include/Graphs/SVFG.h +6 -6
- package/SVF-linux/include/Graphs/VFG.h +6 -6
- package/SVF-linux/include/MTA/TCT.h +6 -6
- package/SVF-linux/include/SABER/SrcSnkSolver.h +2 -2
- package/SVF-linux/include/SVF-LLVM/DCHG.h +6 -6
- package/SVF-linux/include/SVF-LLVM/LLVMUtil.h +5 -0
- package/SVF-linux/include/SVF-LLVM/SymbolTableBuilder.h +0 -3
- package/SVF-linux/include/SVFIR/SVFValue.h +2 -11
- package/SVF-linux/include/SVFIR/SVFVariables.h +5 -5
- package/SVF-linux/include/Util/GraphReachSolver.h +2 -2
- package/SVF-linux/include/Util/SCC.h +1 -1
- package/SVF-linux/include/Util/iterator.h +32 -32
- package/SVF-linux/include/Util/iterator_range.h +11 -11
- package/SVF-linux/include/WPA/WPASolver.h +1 -1
- package/SVF-osx/Release-build/lib/libSvf.a +0 -0
- package/SVF-osx/include/Graphs/CFLGraph.h +6 -6
- package/SVF-osx/include/Graphs/CHG.h +6 -6
- package/SVF-osx/include/Graphs/ConsG.h +6 -6
- package/SVF-osx/include/Graphs/DOTGraphTraits.h +3 -3
- package/SVF-osx/include/Graphs/GenericGraph.h +10 -9
- package/SVF-osx/include/Graphs/GraphPrinter.h +2 -2
- package/SVF-osx/include/Graphs/GraphTraits.h +29 -29
- package/SVF-osx/include/Graphs/GraphWriter.h +6 -6
- package/SVF-osx/include/Graphs/ICFG.h +6 -6
- package/SVF-osx/include/Graphs/IRGraph.h +6 -7
- package/SVF-osx/include/Graphs/PTACallGraph.h +6 -6
- package/SVF-osx/include/Graphs/SVFG.h +6 -6
- package/SVF-osx/include/Graphs/VFG.h +6 -6
- package/SVF-osx/include/MTA/TCT.h +6 -6
- package/SVF-osx/include/SABER/SrcSnkSolver.h +2 -2
- package/SVF-osx/include/SVF-LLVM/DCHG.h +6 -6
- package/SVF-osx/include/SVF-LLVM/LLVMUtil.h +5 -0
- package/SVF-osx/include/SVF-LLVM/SymbolTableBuilder.h +0 -3
- package/SVF-osx/include/SVFIR/SVFValue.h +2 -11
- package/SVF-osx/include/SVFIR/SVFVariables.h +5 -5
- package/SVF-osx/include/Util/GraphReachSolver.h +2 -2
- package/SVF-osx/include/Util/SCC.h +1 -1
- package/SVF-osx/include/Util/iterator.h +32 -32
- package/SVF-osx/include/Util/iterator_range.h +11 -11
- package/SVF-osx/include/WPA/WPASolver.h +1 -1
- package/package.json +1 -1
|
Binary file
|
|
@@ -189,23 +189,23 @@ private:
|
|
|
189
189
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
namespace
|
|
192
|
+
namespace SVF
|
|
193
193
|
{
|
|
194
194
|
/* !
|
|
195
|
-
*
|
|
195
|
+
* GenericGraphTraits specializations for generic graph algorithms.
|
|
196
196
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
197
197
|
*/
|
|
198
|
-
template<> struct
|
|
198
|
+
template<> struct GenericGraphTraits<SVF::CFLNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::CFLNode,SVF::CFLEdge>* >
|
|
199
199
|
{
|
|
200
200
|
};
|
|
201
201
|
|
|
202
|
-
/// Inverse
|
|
202
|
+
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
203
203
|
template<>
|
|
204
|
-
struct
|
|
204
|
+
struct GenericGraphTraits<Inverse<SVF::CFLNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::CFLNode,SVF::CFLEdge>* > >
|
|
205
205
|
{
|
|
206
206
|
};
|
|
207
207
|
|
|
208
|
-
template<> struct
|
|
208
|
+
template<> struct GenericGraphTraits<SVF::CFLGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::CFLNode,SVF::CFLEdge>* >
|
|
209
209
|
{
|
|
210
210
|
typedef SVF::CFLNode *NodeRef;
|
|
211
211
|
};
|
|
@@ -325,23 +325,23 @@ private:
|
|
|
325
325
|
|
|
326
326
|
} // End namespace SVF
|
|
327
327
|
|
|
328
|
-
namespace
|
|
328
|
+
namespace SVF
|
|
329
329
|
{
|
|
330
330
|
/* !
|
|
331
|
-
*
|
|
331
|
+
* GenericGraphTraits specializations for generic graph algorithms.
|
|
332
332
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
333
333
|
*/
|
|
334
|
-
template<> struct
|
|
334
|
+
template<> struct GenericGraphTraits<SVF::CHNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::CHNode,SVF::CHEdge>* >
|
|
335
335
|
{
|
|
336
336
|
};
|
|
337
337
|
|
|
338
|
-
/// Inverse
|
|
338
|
+
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
339
339
|
template<>
|
|
340
|
-
struct
|
|
340
|
+
struct GenericGraphTraits<Inverse<SVF::CHNode*> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::CHNode,SVF::CHEdge>* > >
|
|
341
341
|
{
|
|
342
342
|
};
|
|
343
343
|
|
|
344
|
-
template<> struct
|
|
344
|
+
template<> struct GenericGraphTraits<SVF::CHGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::CHNode,SVF::CHEdge>* >
|
|
345
345
|
{
|
|
346
346
|
typedef SVF::CHNode *NodeRef;
|
|
347
347
|
};
|
|
@@ -382,23 +382,23 @@ public:
|
|
|
382
382
|
|
|
383
383
|
} // End namespace SVF
|
|
384
384
|
|
|
385
|
-
namespace
|
|
385
|
+
namespace SVF
|
|
386
386
|
{
|
|
387
387
|
/* !
|
|
388
|
-
*
|
|
388
|
+
* GenericGraphTraits specializations for the generic graph algorithms.
|
|
389
389
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
390
390
|
*/
|
|
391
|
-
template<> struct
|
|
391
|
+
template<> struct GenericGraphTraits<SVF::ConstraintNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::ConstraintNode,SVF::ConstraintEdge>* >
|
|
392
392
|
{
|
|
393
393
|
};
|
|
394
394
|
|
|
395
|
-
/// Inverse
|
|
395
|
+
/// Inverse GenericGraphTraits specializations for Value flow node, it is used for inverse traversal.
|
|
396
396
|
template<>
|
|
397
|
-
struct
|
|
397
|
+
struct GenericGraphTraits<Inverse<SVF::ConstraintNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::ConstraintNode,SVF::ConstraintEdge>* > >
|
|
398
398
|
{
|
|
399
399
|
};
|
|
400
400
|
|
|
401
|
-
template<> struct
|
|
401
|
+
template<> struct GenericGraphTraits<SVF::ConstraintGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::ConstraintNode,SVF::ConstraintEdge>* >
|
|
402
402
|
{
|
|
403
403
|
typedef SVF::ConstraintNode *NodeRef;
|
|
404
404
|
};
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
//
|
|
14
14
|
//===----------------------------------------------------------------------===//
|
|
15
15
|
|
|
16
|
-
#ifndef
|
|
17
|
-
#define
|
|
16
|
+
#ifndef GRAPHS_DOTGRAPHTRAITS_H
|
|
17
|
+
#define GRAPHS_DOTGRAPHTRAITS_H
|
|
18
18
|
|
|
19
19
|
#include <string>
|
|
20
20
|
|
|
21
|
-
namespace
|
|
21
|
+
namespace SVF
|
|
22
22
|
{
|
|
23
23
|
|
|
24
24
|
/// DefaultDOTGraphTraits - This class provides the default implementations of
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
#include "SVFIR/SVFValue.h"
|
|
34
34
|
#include "Util/iterator.h"
|
|
35
|
+
#include "Graphs/GraphTraits.h"
|
|
35
36
|
|
|
36
37
|
namespace SVF
|
|
37
38
|
{
|
|
@@ -447,10 +448,10 @@ public:
|
|
|
447
448
|
} // End namespace SVF
|
|
448
449
|
|
|
449
450
|
/* !
|
|
450
|
-
*
|
|
451
|
+
* GenericGraphTraits specializations for generic graph algorithms.
|
|
451
452
|
* Provide graph traits for tranversing from a node using standard graph traversals.
|
|
452
453
|
*/
|
|
453
|
-
namespace
|
|
454
|
+
namespace SVF
|
|
454
455
|
{
|
|
455
456
|
|
|
456
457
|
// mapped_iter - This is a simple iterator adapter that causes a function to
|
|
@@ -460,14 +461,14 @@ template <typename ItTy, typename FuncTy,
|
|
|
460
461
|
typename FuncReturnTy =
|
|
461
462
|
decltype(std::declval<FuncTy>()(*std::declval<ItTy>()))>
|
|
462
463
|
class mapped_iter
|
|
463
|
-
: public
|
|
464
|
+
: public iter_adaptor_base<
|
|
464
465
|
mapped_iter<ItTy, FuncTy>, ItTy,
|
|
465
466
|
typename std::iterator_traits<ItTy>::iterator_category,
|
|
466
467
|
typename std::remove_reference<FuncReturnTy>::type>
|
|
467
468
|
{
|
|
468
469
|
public:
|
|
469
470
|
mapped_iter(ItTy U, FuncTy F)
|
|
470
|
-
: mapped_iter::
|
|
471
|
+
: mapped_iter::iter_adaptor_base(std::move(U)), F(std::move(F)) {}
|
|
471
472
|
|
|
472
473
|
ItTy getCurrent()
|
|
473
474
|
{
|
|
@@ -492,9 +493,9 @@ inline mapped_iter<ItTy, FuncTy> map_iter(ItTy I, FuncTy F)
|
|
|
492
493
|
}
|
|
493
494
|
|
|
494
495
|
/*!
|
|
495
|
-
*
|
|
496
|
+
* GenericGraphTraits for nodes
|
|
496
497
|
*/
|
|
497
|
-
template<class NodeTy,class EdgeTy> struct
|
|
498
|
+
template<class NodeTy,class EdgeTy> struct GenericGraphTraits<SVF::GenericNode<NodeTy,EdgeTy>* >
|
|
498
499
|
{
|
|
499
500
|
typedef NodeTy NodeType;
|
|
500
501
|
typedef EdgeTy EdgeType;
|
|
@@ -531,10 +532,10 @@ template<class NodeTy,class EdgeTy> struct GraphTraits<SVF::GenericNode<NodeTy,E
|
|
|
531
532
|
};
|
|
532
533
|
|
|
533
534
|
/*!
|
|
534
|
-
* Inverse
|
|
535
|
+
* Inverse GenericGraphTraits for node which is used for inverse traversal.
|
|
535
536
|
*/
|
|
536
537
|
template<class NodeTy,class EdgeTy>
|
|
537
|
-
struct
|
|
538
|
+
struct GenericGraphTraits<Inverse<SVF::GenericNode<NodeTy,EdgeTy>* > >
|
|
538
539
|
{
|
|
539
540
|
typedef NodeTy NodeType;
|
|
540
541
|
typedef EdgeTy EdgeType;
|
|
@@ -570,7 +571,7 @@ struct GraphTraits<Inverse<SVF::GenericNode<NodeTy,EdgeTy>* > >
|
|
|
570
571
|
/*!
|
|
571
572
|
* GraphTraints
|
|
572
573
|
*/
|
|
573
|
-
template<class NodeTy,class EdgeTy> struct
|
|
574
|
+
template<class NodeTy,class EdgeTy> struct GenericGraphTraits<SVF::GenericGraph<NodeTy,EdgeTy>* > : public GenericGraphTraits<SVF::GenericNode<NodeTy,EdgeTy>* >
|
|
574
575
|
{
|
|
575
576
|
typedef SVF::GenericGraph<NodeTy,EdgeTy> GenericGraphTy;
|
|
576
577
|
typedef NodeTy NodeType;
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
#include "Graphs/GraphWriter.h" // for graph write
|
|
36
36
|
#include <fstream>
|
|
37
37
|
|
|
38
|
-
namespace
|
|
38
|
+
namespace SVF
|
|
39
39
|
{
|
|
40
40
|
|
|
41
41
|
/*
|
|
@@ -80,7 +80,7 @@ public:
|
|
|
80
80
|
const GraphType >)
|
|
81
81
|
{
|
|
82
82
|
///Define the GTraits and node iterator for printing
|
|
83
|
-
typedef
|
|
83
|
+
typedef GenericGraphTraits<GraphType> GTraits;
|
|
84
84
|
|
|
85
85
|
typedef typename GTraits::NodeRef NodeRef;
|
|
86
86
|
typedef typename GTraits::nodes_iterator node_iterator;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//===- llvm/ADT/
|
|
1
|
+
//===- llvm/ADT/GenericGraphTraits.h - Graph traits template -----------*- C++ -*-===//
|
|
2
2
|
//
|
|
3
3
|
// From the LLVM Project with some modifications, under the Apache License v2.0
|
|
4
4
|
// with LLVM Exceptions. See https://llvm.org/LICENSE.txt for license information.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
//===----------------------------------------------------------------------===//
|
|
8
8
|
//
|
|
9
|
-
// This file defines the little
|
|
9
|
+
// This file defines the little GenericGraphTraits<X> template class that should be
|
|
10
10
|
// specialized by classes that want to be iteratable by generic graph iterators.
|
|
11
11
|
//
|
|
12
12
|
// This file also defines the marker class Inverse that is used to iterate over
|
|
@@ -14,26 +14,26 @@
|
|
|
14
14
|
//
|
|
15
15
|
//===----------------------------------------------------------------------===//
|
|
16
16
|
|
|
17
|
-
#ifndef
|
|
18
|
-
#define
|
|
17
|
+
#ifndef GRAPHS_GRAPHTRAITS_H
|
|
18
|
+
#define GRAPHS_GRAPHTRAITS_H
|
|
19
19
|
|
|
20
20
|
#include "Util/iterator_range.h"
|
|
21
21
|
|
|
22
|
-
namespace
|
|
22
|
+
namespace SVF
|
|
23
23
|
{
|
|
24
24
|
|
|
25
|
-
//
|
|
25
|
+
// GenericGraphTraits - This class should be specialized by different graph types...
|
|
26
26
|
// which is why the default version is empty.
|
|
27
27
|
//
|
|
28
28
|
// This template evolved from supporting `BasicBlock` to also later supporting
|
|
29
29
|
// more complex types (e.g. CFG and DomTree).
|
|
30
30
|
//
|
|
31
|
-
//
|
|
31
|
+
// GenericGraphTraits can be used to create a view over a graph interpreting it
|
|
32
32
|
// differently without requiring a copy of the original graph. This could
|
|
33
33
|
// be achieved by carrying more data in NodeRef. See LoopBodyTraits for one
|
|
34
34
|
// example.
|
|
35
35
|
template<class GraphType>
|
|
36
|
-
struct
|
|
36
|
+
struct GenericGraphTraits
|
|
37
37
|
{
|
|
38
38
|
// Elements to provide:
|
|
39
39
|
|
|
@@ -73,7 +73,7 @@ struct GraphTraits
|
|
|
73
73
|
|
|
74
74
|
// If anyone tries to use this class without having an appropriate
|
|
75
75
|
// specialization, make an error. If you get this error, it's because you
|
|
76
|
-
// need to include the appropriate specialization of
|
|
76
|
+
// need to include the appropriate specialization of GenericGraphTraits<> for your
|
|
77
77
|
// graph, or you need to define it for a new graph type. Either that or
|
|
78
78
|
// your argument to XXX_begin(...) is unknown or needs to have the proper .h
|
|
79
79
|
// file #include'd.
|
|
@@ -101,48 +101,48 @@ struct Inverse
|
|
|
101
101
|
inline Inverse(const GraphType &G) : Graph(G) {}
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
// Provide a partial specialization of
|
|
104
|
+
// Provide a partial specialization of GenericGraphTraits so that the inverse of an
|
|
105
105
|
// inverse falls back to the original graph.
|
|
106
|
-
template <class T> struct
|
|
106
|
+
template <class T> struct GenericGraphTraits<Inverse<Inverse<T>>> : GenericGraphTraits<T> {};
|
|
107
107
|
|
|
108
108
|
// Provide iterator ranges for the graph traits nodes and children
|
|
109
109
|
template <class GraphType>
|
|
110
|
-
|
|
110
|
+
iter_range<typename GenericGraphTraits<GraphType>::nodes_iterator>
|
|
111
111
|
nodes(const GraphType &G)
|
|
112
112
|
{
|
|
113
|
-
return make_range(
|
|
114
|
-
|
|
113
|
+
return make_range(GenericGraphTraits<GraphType>::nodes_begin(G),
|
|
114
|
+
GenericGraphTraits<GraphType>::nodes_end(G));
|
|
115
115
|
}
|
|
116
116
|
template <class GraphType>
|
|
117
|
-
|
|
117
|
+
iter_range<typename GenericGraphTraits<Inverse<GraphType>>::nodes_iterator>
|
|
118
118
|
inverse_nodes(const GraphType &G)
|
|
119
119
|
{
|
|
120
|
-
return make_range(
|
|
121
|
-
|
|
120
|
+
return make_range(GenericGraphTraits<Inverse<GraphType>>::nodes_begin(G),
|
|
121
|
+
GenericGraphTraits<Inverse<GraphType>>::nodes_end(G));
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
template <class GraphType>
|
|
125
|
-
|
|
126
|
-
children(const typename
|
|
125
|
+
iter_range<typename GenericGraphTraits<GraphType>::ChildIteratorType>
|
|
126
|
+
children(const typename GenericGraphTraits<GraphType>::NodeRef &G)
|
|
127
127
|
{
|
|
128
|
-
return make_range(
|
|
129
|
-
|
|
128
|
+
return make_range(GenericGraphTraits<GraphType>::child_begin(G),
|
|
129
|
+
GenericGraphTraits<GraphType>::child_end(G));
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
template <class GraphType>
|
|
133
|
-
|
|
134
|
-
inverse_children(const typename
|
|
133
|
+
iter_range<typename GenericGraphTraits<Inverse<GraphType>>::ChildIteratorType>
|
|
134
|
+
inverse_children(const typename GenericGraphTraits<GraphType>::NodeRef &G)
|
|
135
135
|
{
|
|
136
|
-
return make_range(
|
|
137
|
-
|
|
136
|
+
return make_range(GenericGraphTraits<Inverse<GraphType>>::child_begin(G),
|
|
137
|
+
GenericGraphTraits<Inverse<GraphType>>::child_end(G));
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
template <class GraphType>
|
|
141
|
-
|
|
142
|
-
children_edges(const typename
|
|
141
|
+
iter_range<typename GenericGraphTraits<GraphType>::ChildEdgeIteratorType>
|
|
142
|
+
children_edges(const typename GenericGraphTraits<GraphType>::NodeRef &G)
|
|
143
143
|
{
|
|
144
|
-
return make_range(
|
|
145
|
-
|
|
144
|
+
return make_range(GenericGraphTraits<GraphType>::child_edge_begin(G),
|
|
145
|
+
GenericGraphTraits<GraphType>::child_edge_end(G));
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
} // end namespace llvm
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
//
|
|
20
20
|
//===----------------------------------------------------------------------===//
|
|
21
21
|
|
|
22
|
-
#ifndef
|
|
23
|
-
#define
|
|
22
|
+
#ifndef GRAPHS_GRAPHWRITER_H
|
|
23
|
+
#define GRAPHS_GRAPHWRITER_H
|
|
24
24
|
|
|
25
25
|
#include "Graphs/GraphTraits.h"
|
|
26
26
|
#include "Graphs/DOTGraphTraits.h"
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
#include <sstream>
|
|
35
35
|
#include <iostream>
|
|
36
36
|
|
|
37
|
-
namespace
|
|
37
|
+
namespace SVF
|
|
38
38
|
{
|
|
39
39
|
|
|
40
40
|
namespace DOT // Private functions...
|
|
@@ -65,7 +65,7 @@ class GraphWriter
|
|
|
65
65
|
const GraphType &G;
|
|
66
66
|
|
|
67
67
|
using DOTTraits = DOTGraphTraits<GraphType>;
|
|
68
|
-
using GTraits =
|
|
68
|
+
using GTraits = GenericGraphTraits<GraphType>;
|
|
69
69
|
using NodeRef = typename GTraits::NodeRef;
|
|
70
70
|
using node_iterator = typename GTraits::nodes_iterator;
|
|
71
71
|
using child_iterator = typename GTraits::ChildIteratorType;
|
|
@@ -356,7 +356,7 @@ std::string WriteGraph(const GraphType &G,
|
|
|
356
356
|
return "";
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
|
|
359
|
+
SVF::WriteGraph(O, G, ShortNames);
|
|
360
360
|
O.close();
|
|
361
361
|
|
|
362
362
|
std::cerr << " done. \n";
|
|
@@ -372,7 +372,7 @@ void ViewGraph(const GraphType &G,const std::string& name,
|
|
|
372
372
|
bool ShortNames = false,
|
|
373
373
|
GraphProgram::Name Program = GraphProgram::DOT)
|
|
374
374
|
{
|
|
375
|
-
|
|
375
|
+
SVF::WriteGraph(G, ShortNames);
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
} // end namespace llvm
|
|
@@ -305,23 +305,23 @@ private:
|
|
|
305
305
|
|
|
306
306
|
} // End namespace SVF
|
|
307
307
|
|
|
308
|
-
namespace
|
|
308
|
+
namespace SVF
|
|
309
309
|
{
|
|
310
310
|
/* !
|
|
311
|
-
*
|
|
311
|
+
* GenericGraphTraits specializations for generic graph algorithms.
|
|
312
312
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
313
313
|
*/
|
|
314
|
-
template<> struct
|
|
314
|
+
template<> struct GenericGraphTraits<SVF::ICFGNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::ICFGNode,SVF::ICFGEdge>* >
|
|
315
315
|
{
|
|
316
316
|
};
|
|
317
317
|
|
|
318
|
-
/// Inverse
|
|
318
|
+
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
319
319
|
template<>
|
|
320
|
-
struct
|
|
320
|
+
struct GenericGraphTraits<Inverse<SVF::ICFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::ICFGNode,SVF::ICFGEdge>* > >
|
|
321
321
|
{
|
|
322
322
|
};
|
|
323
323
|
|
|
324
|
-
template<> struct
|
|
324
|
+
template<> struct GenericGraphTraits<SVF::ICFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::ICFGNode,SVF::ICFGEdge>* >
|
|
325
325
|
{
|
|
326
326
|
typedef SVF::ICFGNode *NodeRef;
|
|
327
327
|
};
|
|
@@ -218,24 +218,23 @@ public:
|
|
|
218
218
|
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
|
|
222
|
-
namespace llvm
|
|
221
|
+
namespace SVF
|
|
223
222
|
{
|
|
224
223
|
|
|
225
224
|
/* !
|
|
226
|
-
*
|
|
225
|
+
* GenericGraphTraits specializations of SVFIR to be used for the generic graph algorithms.
|
|
227
226
|
* Provide graph traits for tranversing from a SVFIR node using standard graph traversals.
|
|
228
227
|
*/
|
|
229
|
-
template<> struct
|
|
228
|
+
template<> struct GenericGraphTraits<SVF::SVFVar*> : public GenericGraphTraits<SVF::GenericNode<SVF::SVFVar,SVF::SVFStmt>* >
|
|
230
229
|
{
|
|
231
230
|
};
|
|
232
231
|
|
|
233
|
-
/// Inverse
|
|
234
|
-
template<> struct
|
|
232
|
+
/// Inverse GenericGraphTraits specializations for SVFIR node, it is used for inverse traversal.
|
|
233
|
+
template<> struct GenericGraphTraits<Inverse<SVF::SVFVar *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::SVFVar,SVF::SVFStmt>* > >
|
|
235
234
|
{
|
|
236
235
|
};
|
|
237
236
|
|
|
238
|
-
template<> struct
|
|
237
|
+
template<> struct GenericGraphTraits<SVF::IRGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::SVFVar,SVF::SVFStmt>* >
|
|
239
238
|
{
|
|
240
239
|
typedef SVF::SVFVar *NodeRef;
|
|
241
240
|
};
|
|
@@ -445,23 +445,23 @@ public:
|
|
|
445
445
|
|
|
446
446
|
} // End namespace SVF
|
|
447
447
|
|
|
448
|
-
namespace
|
|
448
|
+
namespace SVF
|
|
449
449
|
{
|
|
450
450
|
/* !
|
|
451
|
-
*
|
|
451
|
+
* GenericGraphTraits specializations for generic graph algorithms.
|
|
452
452
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
453
453
|
*/
|
|
454
|
-
template<> struct
|
|
454
|
+
template<> struct GenericGraphTraits<SVF::PTACallGraphNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::PTACallGraphNode,SVF::PTACallGraphEdge>* >
|
|
455
455
|
{
|
|
456
456
|
};
|
|
457
457
|
|
|
458
|
-
/// Inverse
|
|
458
|
+
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
459
459
|
template<>
|
|
460
|
-
struct
|
|
460
|
+
struct GenericGraphTraits<Inverse<SVF::PTACallGraphNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::PTACallGraphNode,SVF::PTACallGraphEdge>* > >
|
|
461
461
|
{
|
|
462
462
|
};
|
|
463
463
|
|
|
464
|
-
template<> struct
|
|
464
|
+
template<> struct GenericGraphTraits<SVF::PTACallGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::PTACallGraphNode,SVF::PTACallGraphEdge>* >
|
|
465
465
|
{
|
|
466
466
|
typedef SVF::PTACallGraphNode *NodeRef;
|
|
467
467
|
};
|
|
@@ -461,21 +461,21 @@ protected:
|
|
|
461
461
|
|
|
462
462
|
} // End namespace SVF
|
|
463
463
|
|
|
464
|
-
namespace
|
|
464
|
+
namespace SVF
|
|
465
465
|
{
|
|
466
466
|
/* !
|
|
467
|
-
*
|
|
467
|
+
* GenericGraphTraits specializations for SVFG to be used for generic graph algorithms.
|
|
468
468
|
* Provide graph traits for traversing from a SVFG node using standard graph traversals.
|
|
469
469
|
*/
|
|
470
|
-
//template<> struct
|
|
470
|
+
//template<> struct GenericGraphTraits<SVF::SVFGNode*>: public GenericGraphTraits<SVF::GenericNode<SVF::SVFGNode,SVF::SVFGEdge>* > {
|
|
471
471
|
//};
|
|
472
472
|
//
|
|
473
|
-
///// Inverse
|
|
473
|
+
///// Inverse GenericGraphTraits specializations for Value flow node, it is used for inverse traversal.
|
|
474
474
|
//template<>
|
|
475
|
-
//struct
|
|
475
|
+
//struct GenericGraphTraits<Inverse<SVF::SVFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::SVFGNode,SVF::SVFGEdge>* > > {
|
|
476
476
|
//};
|
|
477
477
|
|
|
478
|
-
template<> struct
|
|
478
|
+
template<> struct GenericGraphTraits<SVF::SVFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::SVFGNode,SVF::SVFGEdge>* >
|
|
479
479
|
{
|
|
480
480
|
typedef SVF::SVFGNode *NodeRef;
|
|
481
481
|
};
|
|
@@ -638,23 +638,23 @@ protected:
|
|
|
638
638
|
|
|
639
639
|
} // End namespace SVF
|
|
640
640
|
|
|
641
|
-
namespace
|
|
641
|
+
namespace SVF
|
|
642
642
|
{
|
|
643
643
|
/* !
|
|
644
|
-
*
|
|
644
|
+
* GenericGraphTraits specializations for generic graph algorithms.
|
|
645
645
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
646
646
|
*/
|
|
647
|
-
template<> struct
|
|
647
|
+
template<> struct GenericGraphTraits<SVF::VFGNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::VFGNode,SVF::VFGEdge>* >
|
|
648
648
|
{
|
|
649
649
|
};
|
|
650
650
|
|
|
651
|
-
/// Inverse
|
|
651
|
+
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
652
652
|
template<>
|
|
653
|
-
struct
|
|
653
|
+
struct GenericGraphTraits<Inverse<SVF::VFGNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::VFGNode,SVF::VFGEdge>* > >
|
|
654
654
|
{
|
|
655
655
|
};
|
|
656
656
|
|
|
657
|
-
template<> struct
|
|
657
|
+
template<> struct GenericGraphTraits<SVF::VFG*> : public GenericGraphTraits<SVF::GenericGraph<SVF::VFGNode,SVF::VFGEdge>* >
|
|
658
658
|
{
|
|
659
659
|
typedef SVF::VFGNode *NodeRef;
|
|
660
660
|
};
|
|
@@ -572,24 +572,24 @@ private:
|
|
|
572
572
|
|
|
573
573
|
} // End namespace SVF
|
|
574
574
|
|
|
575
|
-
namespace
|
|
575
|
+
namespace SVF
|
|
576
576
|
{
|
|
577
577
|
/* !
|
|
578
|
-
*
|
|
578
|
+
* GenericGraphTraits specializations for constraint graph so that they can be treated as
|
|
579
579
|
* graphs by the generic graph algorithms.
|
|
580
580
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
581
581
|
*/
|
|
582
|
-
template<> struct
|
|
582
|
+
template<> struct GenericGraphTraits<SVF::TCTNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::TCTNode,SVF::TCTEdge>* >
|
|
583
583
|
{
|
|
584
584
|
};
|
|
585
585
|
|
|
586
|
-
/// Inverse
|
|
586
|
+
/// Inverse GenericGraphTraits specializations for Value flow node, it is used for inverse traversal.
|
|
587
587
|
template<>
|
|
588
|
-
struct
|
|
588
|
+
struct GenericGraphTraits<Inverse<SVF::TCTNode *> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::TCTNode,SVF::TCTEdge>* > >
|
|
589
589
|
{
|
|
590
590
|
};
|
|
591
591
|
|
|
592
|
-
template<> struct
|
|
592
|
+
template<> struct GenericGraphTraits<SVF::TCT*> : public GenericGraphTraits<SVF::GenericGraph<SVF::TCTNode,SVF::TCTEdge>* >
|
|
593
593
|
{
|
|
594
594
|
typedef SVF::TCTNode *NodeRef;
|
|
595
595
|
};
|
|
@@ -46,14 +46,14 @@ class SrcSnkSolver
|
|
|
46
46
|
|
|
47
47
|
public:
|
|
48
48
|
///Define the GTraits and node iterator
|
|
49
|
-
typedef
|
|
49
|
+
typedef SVF::GraphTraits<GraphType> GTraits;
|
|
50
50
|
typedef typename GTraits::NodeType GNODE;
|
|
51
51
|
typedef typename GTraits::EdgeType GEDGE;
|
|
52
52
|
typedef typename GTraits::nodes_iterator node_iterator;
|
|
53
53
|
typedef typename GTraits::ChildIteratorType child_iterator;
|
|
54
54
|
|
|
55
55
|
/// Define inverse GTraits and note iterator
|
|
56
|
-
typedef
|
|
56
|
+
typedef SVF::GraphTraits<SVF::Inverse<GNODE *> > InvGTraits;
|
|
57
57
|
typedef typename InvGTraits::ChildIteratorType inv_child_iterator;
|
|
58
58
|
|
|
59
59
|
/// Define worklist
|
|
@@ -455,23 +455,23 @@ private:
|
|
|
455
455
|
|
|
456
456
|
} // End namespace SVF
|
|
457
457
|
|
|
458
|
-
namespace
|
|
458
|
+
namespace SVF
|
|
459
459
|
{
|
|
460
460
|
/* !
|
|
461
|
-
*
|
|
461
|
+
* GenericGraphTraits specializations for generic graph algorithms.
|
|
462
462
|
* Provide graph traits for traversing from a constraint node using standard graph traversals.
|
|
463
463
|
*/
|
|
464
|
-
template<> struct
|
|
464
|
+
template<> struct GenericGraphTraits<SVF::DCHNode*> : public GenericGraphTraits<SVF::GenericNode<SVF::DCHNode,SVF::DCHEdge>* >
|
|
465
465
|
{
|
|
466
466
|
};
|
|
467
467
|
|
|
468
|
-
/// Inverse
|
|
468
|
+
/// Inverse GenericGraphTraits specializations for call graph node, it is used for inverse traversal.
|
|
469
469
|
template<>
|
|
470
|
-
struct
|
|
470
|
+
struct GenericGraphTraits<Inverse<SVF::DCHNode*> > : public GenericGraphTraits<Inverse<SVF::GenericNode<SVF::DCHNode,SVF::DCHEdge>* > >
|
|
471
471
|
{
|
|
472
472
|
};
|
|
473
473
|
|
|
474
|
-
template<> struct
|
|
474
|
+
template<> struct GenericGraphTraits<SVF::DCHGraph*> : public GenericGraphTraits<SVF::GenericGraph<SVF::DCHNode,SVF::DCHEdge>* >
|
|
475
475
|
{
|
|
476
476
|
typedef SVF::DCHNode *NodeRef;
|
|
477
477
|
};
|
|
@@ -391,6 +391,11 @@ inline const Value* getGlobalRep(const Value* val)
|
|
|
391
391
|
return val;
|
|
392
392
|
}
|
|
393
393
|
|
|
394
|
+
/// Check whether this value points-to a constant object
|
|
395
|
+
bool isConstantObjSym(const SVFValue* val);
|
|
396
|
+
|
|
397
|
+
/// Check whether this value points-to a constant object
|
|
398
|
+
bool isConstantObjSym(const Value* val);
|
|
394
399
|
|
|
395
400
|
// Dump Control Flow Graph of llvm function, with instructions
|
|
396
401
|
void viewCFG(const Function* fun);
|