svf-lib 1.0.2133 → 1.0.2135
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/bin/ae +0 -0
- package/SVF-linux/Release-build/bin/cfl +0 -0
- package/SVF-linux/Release-build/bin/dvf +0 -0
- package/SVF-linux/Release-build/bin/llvm2svf +0 -0
- package/SVF-linux/Release-build/bin/mta +0 -0
- package/SVF-linux/Release-build/bin/saber +0 -0
- package/SVF-linux/Release-build/bin/svf-ex +0 -0
- package/SVF-linux/Release-build/bin/wpa +0 -0
- package/SVF-linux/Release-build/include/AE/Svfexe/AbstractInterpretation.h +1 -1
- package/SVF-linux/Release-build/include/DDA/DDAVFSolver.h +5 -5
- package/SVF-linux/Release-build/include/Graphs/ICFG.h +2 -2
- package/SVF-linux/Release-build/include/Graphs/{CallGraph.h → PTACallGraph.h} +44 -42
- package/SVF-linux/Release-build/include/Graphs/ThreadCallGraph.h +28 -28
- package/SVF-linux/Release-build/include/Graphs/VFG.h +5 -5
- package/SVF-linux/Release-build/include/MSSA/MemRegion.h +4 -4
- package/SVF-linux/Release-build/include/MTA/LockAnalysis.h +1 -1
- package/SVF-linux/Release-build/include/MTA/MHP.h +2 -2
- package/SVF-linux/Release-build/include/MTA/TCT.h +6 -6
- package/SVF-linux/Release-build/include/MemoryModel/PointerAnalysis.h +9 -9
- package/SVF-linux/Release-build/include/SABER/SaberSVFGBuilder.h +1 -1
- package/SVF-linux/Release-build/include/SABER/SrcSnkDDA.h +2 -2
- package/SVF-linux/Release-build/include/SVF-LLVM/LLVMModule.h +1 -1
- package/SVF-linux/Release-build/include/SVF-LLVM/SVFIRBuilder.h +1 -1
- package/SVF-linux/Release-build/include/SVFIR/SVFIR.h +4 -4
- package/SVF-linux/Release-build/include/Util/CallGraphBuilder.h +2 -2
- package/SVF-linux/Release-build/lib/libSvfCore.a +0 -0
- package/SVF-linux/Release-build/lib/libSvfLLVM.a +0 -0
- package/SVF-osx/Release-build/bin/ae +0 -0
- package/SVF-osx/Release-build/bin/cfl +0 -0
- package/SVF-osx/Release-build/bin/dvf +0 -0
- package/SVF-osx/Release-build/bin/llvm2svf +0 -0
- package/SVF-osx/Release-build/bin/mta +0 -0
- package/SVF-osx/Release-build/bin/saber +0 -0
- package/SVF-osx/Release-build/bin/svf-ex +0 -0
- package/SVF-osx/Release-build/bin/wpa +0 -0
- package/SVF-osx/Release-build/include/AE/Svfexe/AbstractInterpretation.h +1 -1
- package/SVF-osx/Release-build/include/DDA/DDAVFSolver.h +5 -5
- package/SVF-osx/Release-build/include/Graphs/ICFG.h +2 -2
- package/SVF-osx/Release-build/include/Graphs/{CallGraph.h → PTACallGraph.h} +44 -42
- package/SVF-osx/Release-build/include/Graphs/ThreadCallGraph.h +28 -28
- package/SVF-osx/Release-build/include/Graphs/VFG.h +5 -5
- package/SVF-osx/Release-build/include/MSSA/MemRegion.h +4 -4
- package/SVF-osx/Release-build/include/MTA/LockAnalysis.h +1 -1
- package/SVF-osx/Release-build/include/MTA/MHP.h +2 -2
- package/SVF-osx/Release-build/include/MTA/TCT.h +6 -6
- package/SVF-osx/Release-build/include/MemoryModel/PointerAnalysis.h +9 -9
- package/SVF-osx/Release-build/include/SABER/SaberSVFGBuilder.h +1 -1
- package/SVF-osx/Release-build/include/SABER/SrcSnkDDA.h +2 -2
- package/SVF-osx/Release-build/include/SVF-LLVM/LLVMModule.h +1 -1
- package/SVF-osx/Release-build/include/SVF-LLVM/SVFIRBuilder.h +1 -1
- package/SVF-osx/Release-build/include/SVFIR/SVFIR.h +4 -4
- package/SVF-osx/Release-build/include/Util/CallGraphBuilder.h +2 -2
- package/SVF-osx/Release-build/lib/libSvfCore.a +0 -0
- package/SVF-osx/Release-build/lib/libSvfLLVM.a +0 -0
- package/package.json +1 -1
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
#include "SVFIR/SVFIR.h"
|
|
35
|
-
#include "Graphs/
|
|
35
|
+
#include "Graphs/PTACallGraph.h"
|
|
36
36
|
#include "Graphs/VFGNode.h"
|
|
37
37
|
#include "Graphs/VFGEdge.h"
|
|
38
38
|
|
|
@@ -100,7 +100,7 @@ protected:
|
|
|
100
100
|
FunToVFGNodesMapTy funToVFGNodesMap; ///< map a function to its VFGNodes;
|
|
101
101
|
|
|
102
102
|
GlobalVFGNodeSet globalVFGNodes; ///< set of global store VFG nodes
|
|
103
|
-
|
|
103
|
+
PTACallGraph* callgraph;
|
|
104
104
|
SVFIR* pag;
|
|
105
105
|
VFGK kind;
|
|
106
106
|
|
|
@@ -109,7 +109,7 @@ protected:
|
|
|
109
109
|
|
|
110
110
|
public:
|
|
111
111
|
/// Constructor
|
|
112
|
-
VFG(
|
|
112
|
+
VFG(PTACallGraph* callgraph, VFGK k = FULLSVFG);
|
|
113
113
|
|
|
114
114
|
/// Destructor
|
|
115
115
|
virtual ~VFG()
|
|
@@ -135,8 +135,8 @@ public:
|
|
|
135
135
|
return pag;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
/// Return
|
|
139
|
-
inline
|
|
138
|
+
/// Return PTACallGraph
|
|
139
|
+
inline PTACallGraph* getCallGraph() const
|
|
140
140
|
{
|
|
141
141
|
return callgraph;
|
|
142
142
|
}
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
#define MEMORYREGION_H_
|
|
36
36
|
|
|
37
37
|
#include "Graphs/ICFG.h"
|
|
38
|
-
#include "Graphs/
|
|
38
|
+
#include "Graphs/PTACallGraph.h"
|
|
39
39
|
#include "Graphs/SCC.h"
|
|
40
40
|
#include "SVFIR/SVFIR.h"
|
|
41
41
|
#include "Util/WorkList.h"
|
|
@@ -175,7 +175,7 @@ public:
|
|
|
175
175
|
/// SVFIR edge list
|
|
176
176
|
typedef SVFIR::SVFStmtList SVFStmtList;
|
|
177
177
|
/// Call Graph SCC
|
|
178
|
-
typedef SCCDetection<
|
|
178
|
+
typedef SCCDetection<PTACallGraph*> SCC;
|
|
179
179
|
|
|
180
180
|
MRSet& getMRSet()
|
|
181
181
|
{
|
|
@@ -196,7 +196,7 @@ private:
|
|
|
196
196
|
|
|
197
197
|
BVDataPTAImpl* pta;
|
|
198
198
|
SCC* callGraphSCC;
|
|
199
|
-
|
|
199
|
+
PTACallGraph* callGraph;
|
|
200
200
|
bool ptrOnlyMSSA;
|
|
201
201
|
|
|
202
202
|
/// Map a function to all its memory regions
|
|
@@ -330,7 +330,7 @@ protected:
|
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
/// Mod-Ref analysis for callsite invoking this callGraphNode
|
|
333
|
-
virtual void modRefAnalysis(
|
|
333
|
+
virtual void modRefAnalysis(PTACallGraphNode* callGraphNode, WorkList& worklist);
|
|
334
334
|
|
|
335
335
|
/// Get Mod-Ref of a callee function
|
|
336
336
|
virtual bool handleCallsiteModRef(NodeBS& mod, NodeBS& ref, const CallICFGNode* cs, const SVFFunction* fun);
|
|
@@ -339,7 +339,7 @@ private:
|
|
|
339
339
|
void handleIntra(const CxtStmt& cts);
|
|
340
340
|
|
|
341
341
|
/// Handle call relations
|
|
342
|
-
void handleCallRelation(CxtLockProc& clp, const
|
|
342
|
+
void handleCallRelation(CxtLockProc& clp, const PTACallGraphEdge* cgEdge, const CallICFGNode* call);
|
|
343
343
|
|
|
344
344
|
/// Return true it a lock matches an unlock
|
|
345
345
|
bool isAliasedLocks(const CxtLock& cl1, const CxtLock& cl2)
|
|
@@ -123,7 +123,7 @@ public:
|
|
|
123
123
|
|
|
124
124
|
private:
|
|
125
125
|
|
|
126
|
-
inline const
|
|
126
|
+
inline const PTACallGraph::FunctionSet& getCallee(const CallICFGNode* inst, PTACallGraph::FunctionSet& callees)
|
|
127
127
|
{
|
|
128
128
|
tcg->getCallees(inst, callees);
|
|
129
129
|
return callees;
|
|
@@ -482,7 +482,7 @@ private:
|
|
|
482
482
|
{
|
|
483
483
|
return getTCG()->getThreadAPI()->getJoinedThread(call);
|
|
484
484
|
}
|
|
485
|
-
inline const
|
|
485
|
+
inline const PTACallGraph::FunctionSet& getCallee(const ICFGNode* inst, PTACallGraph::FunctionSet& callees)
|
|
486
486
|
{
|
|
487
487
|
getTCG()->getCallees(SVFUtil::cast<CallICFGNode>(inst), callees);
|
|
488
488
|
return callees;
|
|
@@ -160,14 +160,14 @@ public:
|
|
|
160
160
|
typedef Set<const SVFFunction*> FunSet;
|
|
161
161
|
typedef std::vector<const ICFGNode*> InstVec;
|
|
162
162
|
typedef Set<const ICFGNode*> InstSet;
|
|
163
|
-
typedef Set<const
|
|
163
|
+
typedef Set<const PTACallGraphNode*> PTACGNodeSet;
|
|
164
164
|
typedef Map<CxtThread, TCTNode*> CxtThreadToNodeMap;
|
|
165
165
|
typedef Map<CxtThread, CallStrCxt> CxtThreadToForkCxt;
|
|
166
166
|
typedef Map<CxtThread, const SVFFunction*> CxtThreadToFun;
|
|
167
167
|
typedef Map<const ICFGNode*, LoopBBs> InstToLoopMap;
|
|
168
168
|
typedef FIFOWorkList<CxtThreadProc> CxtThreadProcVec;
|
|
169
169
|
typedef Set<CxtThreadProc> CxtThreadProcSet;
|
|
170
|
-
typedef SCCDetection<
|
|
170
|
+
typedef SCCDetection<PTACallGraph*> ThreadCallGraphSCC;
|
|
171
171
|
|
|
172
172
|
/// Constructor
|
|
173
173
|
TCT(PointerAnalysis* p) :pta(p),TCTNodeNum(0),TCTEdgeNum(0),MaxCxtSize(0)
|
|
@@ -288,9 +288,9 @@ public:
|
|
|
288
288
|
//@}
|
|
289
289
|
|
|
290
290
|
/// Whether it is a candidate function for indirect call
|
|
291
|
-
inline bool isCandidateFun(const
|
|
291
|
+
inline bool isCandidateFun(const PTACallGraph::FunctionSet& callees) const
|
|
292
292
|
{
|
|
293
|
-
for(
|
|
293
|
+
for(PTACallGraph::FunctionSet::const_iterator cit = callees.begin(),
|
|
294
294
|
ecit = callees.end(); cit!=ecit; cit++)
|
|
295
295
|
{
|
|
296
296
|
if(candidateFuncSet.find((*cit))!=candidateFuncSet.end())
|
|
@@ -303,7 +303,7 @@ public:
|
|
|
303
303
|
return candidateFuncSet.find(fun)!=candidateFuncSet.end();
|
|
304
304
|
}
|
|
305
305
|
/// Whether two functions in the same callgraph scc
|
|
306
|
-
inline bool inSameCallGraphSCC(const
|
|
306
|
+
inline bool inSameCallGraphSCC(const PTACallGraphNode* src,const PTACallGraphNode* dst)
|
|
307
307
|
{
|
|
308
308
|
return (tcgSCC->repNode(src->getId()) == tcgSCC->repNode(dst->getId()));
|
|
309
309
|
}
|
|
@@ -506,7 +506,7 @@ private:
|
|
|
506
506
|
//@}
|
|
507
507
|
|
|
508
508
|
/// Handle call relations
|
|
509
|
-
void handleCallRelation(CxtThreadProc& ctp, const
|
|
509
|
+
void handleCallRelation(CxtThreadProc& ctp, const PTACallGraphEdge* cgEdge, const CallICFGNode* call);
|
|
510
510
|
|
|
511
511
|
/// Get or create a tct node based on CxtThread
|
|
512
512
|
//@{
|
|
@@ -103,7 +103,7 @@ public:
|
|
|
103
103
|
typedef SVFIR::CallSiteToFunPtrMap CallSiteToFunPtrMap;
|
|
104
104
|
typedef Set<const SVFFunction*> FunctionSet;
|
|
105
105
|
typedef OrderedMap<const CallICFGNode*, FunctionSet> CallEdgeMap;
|
|
106
|
-
typedef SCCDetection<
|
|
106
|
+
typedef SCCDetection<PTACallGraph*> CallGraphSCC;
|
|
107
107
|
typedef Set<const SVFGlobalValue*> VTableSet;
|
|
108
108
|
typedef Set<const SVFFunction*> VFunSet;
|
|
109
109
|
//@}
|
|
@@ -148,8 +148,8 @@ protected:
|
|
|
148
148
|
/// Statistics
|
|
149
149
|
PTAStat* stat;
|
|
150
150
|
/// Call graph used for pointer analysis
|
|
151
|
-
|
|
152
|
-
/// SCC for
|
|
151
|
+
PTACallGraph* callgraph;
|
|
152
|
+
/// SCC for PTACallGraph
|
|
153
153
|
CallGraphSCC* callGraphSCC;
|
|
154
154
|
/// Interprocedural control-flow graph
|
|
155
155
|
ICFG* icfg;
|
|
@@ -168,7 +168,7 @@ public:
|
|
|
168
168
|
return getCallGraph()->getNumOfResolvedIndCallEdge();
|
|
169
169
|
}
|
|
170
170
|
/// Return call graph
|
|
171
|
-
inline
|
|
171
|
+
inline PTACallGraph* getCallGraph() const
|
|
172
172
|
{
|
|
173
173
|
return callgraph;
|
|
174
174
|
}
|
|
@@ -382,9 +382,9 @@ public:
|
|
|
382
382
|
/// Resolve indirect call edges
|
|
383
383
|
virtual void resolveIndCalls(const CallICFGNode* cs, const PointsTo& target, CallEdgeMap& newEdges);
|
|
384
384
|
|
|
385
|
-
///
|
|
385
|
+
/// PTACallGraph SCC related methods
|
|
386
386
|
//@{
|
|
387
|
-
///
|
|
387
|
+
/// PTACallGraph SCC detection
|
|
388
388
|
inline void callGraphSCCDetection()
|
|
389
389
|
{
|
|
390
390
|
if(callGraphSCC==nullptr)
|
|
@@ -397,11 +397,11 @@ public:
|
|
|
397
397
|
{
|
|
398
398
|
return callGraphSCC->repNode(id);
|
|
399
399
|
}
|
|
400
|
-
/// Return TRUE if this edge is inside a
|
|
400
|
+
/// Return TRUE if this edge is inside a PTACallGraph SCC, i.e., src node and dst node are in the same SCC on the SVFG.
|
|
401
401
|
inline bool inSameCallGraphSCC(const SVFFunction* fun1,const SVFFunction* fun2)
|
|
402
402
|
{
|
|
403
|
-
const
|
|
404
|
-
const
|
|
403
|
+
const PTACallGraphNode* src = callgraph->getCallGraphNode(fun1);
|
|
404
|
+
const PTACallGraphNode* dst = callgraph->getCallGraphNode(fun2);
|
|
405
405
|
return (getCallGraphSCCRepNode(src->getId()) == getCallGraphSCCRepNode(dst->getId()));
|
|
406
406
|
}
|
|
407
407
|
inline bool isInRecursion(const SVFFunction* fun) const
|
|
@@ -89,7 +89,7 @@ protected:
|
|
|
89
89
|
|
|
90
90
|
/// Add actual parameter SVFGNode for 1st argument of a deallocation like external function
|
|
91
91
|
/// In order to path sensitive leak detection
|
|
92
|
-
virtual void AddExtActualParmSVFGNodes(
|
|
92
|
+
virtual void AddExtActualParmSVFGNodes(PTACallGraph* callgraph);
|
|
93
93
|
|
|
94
94
|
/// Collect memory pointed global pointers,
|
|
95
95
|
/// note that this collection is recursively performed, for example gp-->obj-->obj'
|
|
@@ -76,7 +76,7 @@ private:
|
|
|
76
76
|
protected:
|
|
77
77
|
SaberSVFGBuilder memSSA;
|
|
78
78
|
SVFG* svfg;
|
|
79
|
-
|
|
79
|
+
PTACallGraph* callgraph;
|
|
80
80
|
SVFBugReport report; /// Bug Reporter
|
|
81
81
|
|
|
82
82
|
public:
|
|
@@ -129,7 +129,7 @@ public:
|
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
/// Get Callgraph
|
|
132
|
-
inline
|
|
132
|
+
inline PTACallGraph* getCallgraph() const
|
|
133
133
|
{
|
|
134
134
|
return callgraph;
|
|
135
135
|
}
|
|
@@ -105,7 +105,7 @@ private:
|
|
|
105
105
|
InstToBlockNodeMapTy InstToBlockNodeMap; ///< map a basic block to its ICFGNode
|
|
106
106
|
FunToFunEntryNodeMapTy FunToFunEntryNodeMap; ///< map a function to its FunExitICFGNode
|
|
107
107
|
FunToFunExitNodeMapTy FunToFunExitNodeMap; ///< map a function to its FunEntryICFGNode
|
|
108
|
-
|
|
108
|
+
PTACallGraph* callgraph;
|
|
109
109
|
|
|
110
110
|
/// Constructor
|
|
111
111
|
LLVMModuleSet();
|
|
@@ -98,7 +98,7 @@ private:
|
|
|
98
98
|
ICFG* icfg; // ICFG
|
|
99
99
|
CommonCHGraph* chgraph; // class hierarchy graph
|
|
100
100
|
CallSiteSet callSiteSet; /// all the callsites of a program
|
|
101
|
-
|
|
101
|
+
PTACallGraph* callGraph; /// call graph
|
|
102
102
|
|
|
103
103
|
static std::unique_ptr<SVFIR> pag; ///< Singleton pattern here to enable instance of SVFIR can only be created once.
|
|
104
104
|
|
|
@@ -185,13 +185,13 @@ public:
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
/// Set/Get CG
|
|
188
|
-
inline void setCallGraph(
|
|
188
|
+
inline void setCallGraph(PTACallGraph* c)
|
|
189
189
|
{
|
|
190
190
|
callGraph = c;
|
|
191
191
|
}
|
|
192
|
-
inline
|
|
192
|
+
inline PTACallGraph* getCallGraph()
|
|
193
193
|
{
|
|
194
|
-
assert(callGraph && "empty
|
|
194
|
+
assert(callGraph && "empty PTACallGraph! Build SVF IR first!");
|
|
195
195
|
return callGraph;
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
#ifndef INCLUDE_SVF_FE_CALLGRAPHBUILDER_H_
|
|
32
32
|
#define INCLUDE_SVF_FE_CALLGRAPHBUILDER_H_
|
|
33
33
|
|
|
34
|
-
#include "Graphs/
|
|
34
|
+
#include "Graphs/PTACallGraph.h"
|
|
35
35
|
#include "Graphs/ThreadCallGraph.h"
|
|
36
36
|
|
|
37
37
|
namespace SVF
|
|
@@ -46,7 +46,7 @@ public:
|
|
|
46
46
|
CallGraphBuilder()=default;
|
|
47
47
|
|
|
48
48
|
/// Buidl SVFIR callgraoh
|
|
49
|
-
|
|
49
|
+
PTACallGraph* buildSVFIRCallGraph(SVFModule* svfModule);
|
|
50
50
|
|
|
51
51
|
/// Build thread-aware callgraph
|
|
52
52
|
ThreadCallGraph* buildThreadCallGraph();
|
|
Binary file
|
|
Binary file
|