svf-lib 1.0.2211 → 1.0.2213
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 +2 -2
- package/SVF-linux/Release-build/include/CFL/CFLAlias.h +1 -1
- package/SVF-linux/Release-build/include/DDA/ContextDDA.h +6 -6
- package/SVF-linux/Release-build/include/DDA/DDAVFSolver.h +2 -2
- package/SVF-linux/Release-build/include/DDA/FlowDDA.h +2 -2
- package/SVF-linux/Release-build/include/Graphs/BasicBlockG.h +17 -9
- package/SVF-linux/Release-build/include/Graphs/CHG.h +7 -7
- package/SVF-linux/Release-build/include/Graphs/CallGraph.h +23 -27
- package/SVF-linux/Release-build/include/Graphs/ConsG.h +2 -2
- package/SVF-linux/Release-build/include/Graphs/ICFG.h +11 -11
- package/SVF-linux/Release-build/include/Graphs/ICFGNode.h +12 -18
- package/SVF-linux/Release-build/include/Graphs/IRGraph.h +11 -9
- package/SVF-linux/Release-build/include/Graphs/SVFG.h +13 -13
- package/SVF-linux/Release-build/include/Graphs/SVFGNode.h +2 -2
- package/SVF-linux/Release-build/include/Graphs/ThreadCallGraph.h +3 -21
- package/SVF-linux/Release-build/include/Graphs/VFG.h +15 -15
- package/SVF-linux/Release-build/include/Graphs/VFGNode.h +10 -10
- package/SVF-linux/Release-build/include/MSSA/MSSAMuChi.h +6 -6
- package/SVF-linux/Release-build/include/MSSA/MemPartition.h +12 -12
- package/SVF-linux/Release-build/include/MSSA/MemRegion.h +21 -21
- package/SVF-linux/Release-build/include/MSSA/MemSSA.h +10 -10
- package/SVF-linux/Release-build/include/MTA/LockAnalysis.h +4 -4
- package/SVF-linux/Release-build/include/MTA/MHP.h +8 -8
- package/SVF-linux/Release-build/include/MTA/TCT.h +10 -10
- package/SVF-linux/Release-build/include/MemoryModel/PointerAnalysis.h +4 -4
- package/SVF-linux/Release-build/include/SABER/DoubleFreeChecker.h +2 -2
- package/SVF-linux/Release-build/include/SABER/FileChecker.h +2 -2
- package/SVF-linux/Release-build/include/SABER/LeakChecker.h +4 -4
- package/SVF-linux/Release-build/include/SABER/SaberCheckerAPI.h +6 -5
- package/SVF-linux/Release-build/include/SABER/SaberCondAllocator.h +5 -5
- package/SVF-linux/Release-build/include/SABER/SrcSnkDDA.h +2 -2
- package/SVF-linux/Release-build/include/SVF-LLVM/LLVMModule.h +83 -7
- package/SVF-linux/Release-build/include/SVF-LLVM/LLVMUtil.h +9 -1
- package/SVF-linux/Release-build/include/SVF-LLVM/SVFIRBuilder.h +5 -2
- package/SVF-linux/Release-build/include/SVFIR/SVFIR.h +20 -27
- package/SVF-linux/Release-build/include/SVFIR/SVFValue.h +3 -2
- package/SVF-linux/Release-build/include/SVFIR/SVFVariables.h +271 -71
- package/SVF-linux/Release-build/include/Util/CDGBuilder.h +1 -1
- package/SVF-linux/Release-build/include/Util/CallGraphBuilder.h +1 -1
- package/SVF-linux/Release-build/include/Util/CxtStmt.h +6 -6
- package/SVF-linux/Release-build/include/Util/ExtAPI.h +20 -16
- package/SVF-linux/Release-build/include/Util/SVFUtil.h +16 -30
- package/SVF-linux/Release-build/include/Util/ThreadAPI.h +2 -11
- package/SVF-linux/Release-build/include/WPA/Andersen.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/DDA/DDAClient.h +6 -11
- package/SVF-osx/Release-build/include/DDA/DDAPass.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/CHG.h +2 -3
- package/SVF-osx/Release-build/include/Graphs/GenericGraph.h +1 -286
- package/SVF-osx/Release-build/include/MTA/MTA.h +2 -2
- package/SVF-osx/Release-build/include/MTA/TCT.h +0 -6
- package/SVF-osx/Release-build/include/MemoryModel/PointerAnalysis.h +1 -7
- package/SVF-osx/Release-build/include/SABER/DoubleFreeChecker.h +1 -1
- package/SVF-osx/Release-build/include/SABER/FileChecker.h +1 -1
- package/SVF-osx/Release-build/include/SABER/LeakChecker.h +1 -1
- package/SVF-osx/Release-build/include/SABER/SaberCondAllocator.h +1 -2
- package/SVF-osx/Release-build/include/SABER/SrcSnkDDA.h +2 -2
- package/SVF-osx/Release-build/include/SVF-LLVM/BreakConstantExpr.h +1 -1
- package/SVF-osx/Release-build/include/SVF-LLVM/CppUtil.h +1 -1
- package/SVF-osx/Release-build/include/SVF-LLVM/DCHG.h +1 -1
- package/SVF-osx/Release-build/include/SVF-LLVM/LLVMLoopAnalysis.h +1 -1
- package/SVF-osx/Release-build/include/SVF-LLVM/LLVMModule.h +2 -2
- package/SVF-osx/Release-build/include/SVF-LLVM/LLVMUtil.h +1 -1
- package/SVF-osx/Release-build/include/SVF-LLVM/ObjTypeInference.h +1 -1
- package/SVF-osx/Release-build/include/{SVFIR → SVF-LLVM}/SVFModule.h +1 -36
- package/SVF-osx/Release-build/include/SVF-LLVM/SVFValue.h +805 -0
- package/SVF-osx/Release-build/include/SVFIR/ObjTypeInfo.h +0 -1
- package/SVF-osx/Release-build/include/SVFIR/SVFIR.h +38 -11
- package/SVF-osx/Release-build/include/SVFIR/SVFStatements.h +1 -0
- package/SVF-osx/Release-build/include/SVFIR/SVFValue.h +202 -799
- package/SVF-osx/Release-build/include/Util/CDGBuilder.h +1 -1
- package/SVF-osx/Release-build/include/Util/GeneralType.h +1 -0
- package/SVF-osx/Release-build/include/Util/SVFLoopAndDomInfo.h +169 -0
- package/SVF-osx/Release-build/include/Util/SVFUtil.h +3 -1
- package/SVF-osx/Release-build/include/Util/ThreadAPI.h +2 -1
- package/SVF-osx/Release-build/include/WPA/FlowSensitive.h +1 -1
- 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
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
//===- SVFLoopAndDomInfo.h -- ------------------------------//
|
|
2
|
+
//
|
|
3
|
+
// SVF: Static Value-Flow Analysis
|
|
4
|
+
//
|
|
5
|
+
// Copyright (C) <2013-2017> <Yulei Sui>
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// This program is free software: you can redistribute it and/or modify
|
|
9
|
+
// it under the terms of the GNU Affero General Public License as published by
|
|
10
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
// (at your option) any later version.
|
|
12
|
+
|
|
13
|
+
// This program is distributed in the hope that it will be useful,
|
|
14
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
// GNU Affero General Public License for more details.
|
|
17
|
+
|
|
18
|
+
// You should have received a copy of the GNU Affero General Public License
|
|
19
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
//
|
|
21
|
+
//===----------------------------------------------------------------------===//
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* SVFLoopAndDomInfo.h
|
|
25
|
+
*
|
|
26
|
+
* Created on: Feb 7, 2025
|
|
27
|
+
* Author: Xiao Cheng
|
|
28
|
+
*
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
#ifndef SVFLOOPANDDOMINFO_H
|
|
32
|
+
#define SVFLOOPANDDOMINFO_H
|
|
33
|
+
|
|
34
|
+
#include "SVFIR/SVFType.h"
|
|
35
|
+
#include "Graphs/GraphPrinter.h"
|
|
36
|
+
#include "Util/Casting.h"
|
|
37
|
+
#include "Graphs/BasicBlockG.h"
|
|
38
|
+
|
|
39
|
+
namespace SVF
|
|
40
|
+
{
|
|
41
|
+
class SVFLoopAndDomInfo
|
|
42
|
+
{
|
|
43
|
+
friend class SVFIRWriter;
|
|
44
|
+
friend class SVFIRReader;
|
|
45
|
+
public:
|
|
46
|
+
typedef Set<const SVFBasicBlock*> BBSet;
|
|
47
|
+
typedef std::vector<const SVFBasicBlock*> BBList;
|
|
48
|
+
typedef BBList LoopBBs;
|
|
49
|
+
|
|
50
|
+
private:
|
|
51
|
+
BBList reachableBBs; ///< reachable BasicBlocks from the function entry.
|
|
52
|
+
Map<const SVFBasicBlock*,BBSet> dtBBsMap; ///< map a BasicBlock to BasicBlocks it Dominates
|
|
53
|
+
Map<const SVFBasicBlock*,BBSet> pdtBBsMap; ///< map a BasicBlock to BasicBlocks it PostDominates
|
|
54
|
+
Map<const SVFBasicBlock*,BBSet> dfBBsMap; ///< map a BasicBlock to its Dominate Frontier BasicBlocks
|
|
55
|
+
Map<const SVFBasicBlock*, LoopBBs> bb2LoopMap; ///< map a BasicBlock (if it is in a loop) to all the BasicBlocks in this loop
|
|
56
|
+
Map<const SVFBasicBlock*, u32_t> bb2PdomLevel; ///< map a BasicBlock to its level in pdom tree, used in findNearestCommonPDominator
|
|
57
|
+
Map<const SVFBasicBlock*, const SVFBasicBlock*> bb2PIdom; ///< map a BasicBlock to its immediate dominator in pdom tree, used in findNearestCommonPDominator
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
SVFLoopAndDomInfo()
|
|
61
|
+
{
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
virtual ~SVFLoopAndDomInfo() {}
|
|
65
|
+
|
|
66
|
+
inline const Map<const SVFBasicBlock*,BBSet>& getDomFrontierMap() const
|
|
67
|
+
{
|
|
68
|
+
return dfBBsMap;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
inline Map<const SVFBasicBlock*,BBSet>& getDomFrontierMap()
|
|
72
|
+
{
|
|
73
|
+
return dfBBsMap;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
inline bool hasLoopInfo(const SVFBasicBlock* bb) const
|
|
77
|
+
{
|
|
78
|
+
return bb2LoopMap.find(bb) != bb2LoopMap.end();
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const LoopBBs& getLoopInfo(const SVFBasicBlock* bb) const;
|
|
82
|
+
|
|
83
|
+
inline const SVFBasicBlock* getLoopHeader(const LoopBBs& lp) const
|
|
84
|
+
{
|
|
85
|
+
assert(!lp.empty() && "this is not a loop, empty basic block");
|
|
86
|
+
return lp.front();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
inline bool loopContainsBB(const LoopBBs& lp, const SVFBasicBlock* bb) const
|
|
90
|
+
{
|
|
91
|
+
return std::find(lp.begin(), lp.end(), bb) != lp.end();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
inline void addToBB2LoopMap(const SVFBasicBlock* bb, const SVFBasicBlock* loopBB)
|
|
95
|
+
{
|
|
96
|
+
bb2LoopMap[bb].push_back(loopBB);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
inline const Map<const SVFBasicBlock*,BBSet>& getPostDomTreeMap() const
|
|
100
|
+
{
|
|
101
|
+
return pdtBBsMap;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
inline Map<const SVFBasicBlock*,BBSet>& getPostDomTreeMap()
|
|
105
|
+
{
|
|
106
|
+
return pdtBBsMap;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
inline const Map<const SVFBasicBlock*,u32_t>& getBBPDomLevel() const
|
|
110
|
+
{
|
|
111
|
+
return bb2PdomLevel;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
inline Map<const SVFBasicBlock*,u32_t>& getBBPDomLevel()
|
|
115
|
+
{
|
|
116
|
+
return bb2PdomLevel;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
inline const Map<const SVFBasicBlock*,const SVFBasicBlock*>& getBB2PIdom() const
|
|
120
|
+
{
|
|
121
|
+
return bb2PIdom;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
inline Map<const SVFBasicBlock*,const SVFBasicBlock*>& getBB2PIdom()
|
|
125
|
+
{
|
|
126
|
+
return bb2PIdom;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
inline Map<const SVFBasicBlock*,BBSet>& getDomTreeMap()
|
|
131
|
+
{
|
|
132
|
+
return dtBBsMap;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
inline const Map<const SVFBasicBlock*,BBSet>& getDomTreeMap() const
|
|
136
|
+
{
|
|
137
|
+
return dtBBsMap;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
inline bool isUnreachable(const SVFBasicBlock* bb) const
|
|
141
|
+
{
|
|
142
|
+
return std::find(reachableBBs.begin(), reachableBBs.end(), bb) ==
|
|
143
|
+
reachableBBs.end();
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
inline const BBList& getReachableBBs() const
|
|
147
|
+
{
|
|
148
|
+
return reachableBBs;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
inline void setReachableBBs(BBList& bbs)
|
|
152
|
+
{
|
|
153
|
+
reachableBBs = bbs;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
void getExitBlocksOfLoop(const SVFBasicBlock* bb, BBList& exitbbs) const;
|
|
157
|
+
|
|
158
|
+
bool isLoopHeader(const SVFBasicBlock* bb) const;
|
|
159
|
+
|
|
160
|
+
bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const;
|
|
161
|
+
|
|
162
|
+
bool postDominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const;
|
|
163
|
+
|
|
164
|
+
/// find nearest common post dominator of two basic blocks
|
|
165
|
+
const SVFBasicBlock *findNearestCommonPDominator(const SVFBasicBlock *A, const SVFBasicBlock *B) const;
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
#endif //SVFLOOPANDDOMINFO_H
|
|
@@ -32,10 +32,12 @@
|
|
|
32
32
|
|
|
33
33
|
#include "FastCluster/fastcluster.h"
|
|
34
34
|
#include "SVFIR/SVFValue.h"
|
|
35
|
-
#include "
|
|
35
|
+
#include "Util/SVFLoopAndDomInfo.h"
|
|
36
36
|
#include "Util/ExtAPI.h"
|
|
37
37
|
#include "MemoryModel/PointsTo.h"
|
|
38
38
|
#include <time.h>
|
|
39
|
+
#include "Util/NodeIDAllocator.h"
|
|
40
|
+
#include "Util/ThreadAPI.h"
|
|
39
41
|
|
|
40
42
|
namespace SVF
|
|
41
43
|
{
|
|
@@ -41,6 +41,7 @@ class CallICFGNode;
|
|
|
41
41
|
class SVFVar;
|
|
42
42
|
class ValVar;
|
|
43
43
|
class ObjVar;
|
|
44
|
+
class FunObjVar;
|
|
44
45
|
|
|
45
46
|
/*
|
|
46
47
|
* ThreadAPI class contains interfaces for pthread programs
|
|
@@ -179,7 +180,7 @@ public:
|
|
|
179
180
|
bool isTDBarWait(const CallICFGNode *inst) const;
|
|
180
181
|
//@}
|
|
181
182
|
|
|
182
|
-
void performAPIStat(
|
|
183
|
+
void performAPIStat();
|
|
183
184
|
void statInit(Map<std::string, u32_t>& tdAPIStatMap);
|
|
184
185
|
};
|
|
185
186
|
|
|
Binary file
|
|
Binary file
|