svf-lib 1.0.2213 → 1.0.2215
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/DDA/DDAClient.h +6 -11
- package/SVF-linux/Release-build/include/DDA/DDAPass.h +1 -1
- package/SVF-linux/Release-build/include/Graphs/CHG.h +2 -3
- package/SVF-linux/Release-build/include/Graphs/GenericGraph.h +1 -286
- package/SVF-linux/Release-build/include/MTA/MTA.h +2 -2
- package/SVF-linux/Release-build/include/MTA/TCT.h +0 -6
- package/SVF-linux/Release-build/include/MemoryModel/PointerAnalysis.h +1 -7
- package/SVF-linux/Release-build/include/SABER/DoubleFreeChecker.h +1 -1
- package/SVF-linux/Release-build/include/SABER/FileChecker.h +1 -1
- package/SVF-linux/Release-build/include/SABER/LeakChecker.h +1 -1
- package/SVF-linux/Release-build/include/SABER/SaberCondAllocator.h +1 -2
- package/SVF-linux/Release-build/include/SABER/SrcSnkDDA.h +2 -2
- package/SVF-linux/Release-build/include/SVF-LLVM/BreakConstantExpr.h +1 -1
- package/SVF-linux/Release-build/include/SVF-LLVM/CppUtil.h +1 -1
- package/SVF-linux/Release-build/include/SVF-LLVM/DCHG.h +1 -1
- package/SVF-linux/Release-build/include/SVF-LLVM/LLVMLoopAnalysis.h +1 -1
- package/SVF-linux/Release-build/include/SVF-LLVM/LLVMModule.h +2 -2
- package/SVF-linux/Release-build/include/SVF-LLVM/LLVMUtil.h +1 -1
- package/SVF-linux/Release-build/include/SVF-LLVM/ObjTypeInference.h +1 -1
- package/SVF-linux/Release-build/include/{SVFIR → SVF-LLVM}/SVFModule.h +1 -36
- package/SVF-linux/Release-build/include/SVFIR/ObjTypeInfo.h +0 -1
- package/SVF-linux/Release-build/include/SVFIR/SVFIR.h +38 -11
- package/SVF-linux/Release-build/include/SVFIR/SVFStatements.h +1 -0
- package/SVF-linux/Release-build/include/SVFIR/SVFValue.h +202 -799
- package/SVF-linux/Release-build/include/Util/CDGBuilder.h +1 -1
- package/SVF-linux/Release-build/include/Util/GeneralType.h +1 -0
- package/SVF-linux/Release-build/include/Util/SVFLoopAndDomInfo.h +169 -0
- package/SVF-linux/Release-build/include/Util/SVFUtil.h +3 -1
- package/SVF-linux/Release-build/include/Util/ThreadAPI.h +2 -1
- package/SVF-linux/Release-build/include/WPA/FlowSensitive.h +1 -1
- 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/Graphs/BasicBlockG.h +2 -2
- package/SVF-osx/Release-build/include/Graphs/CDG.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/CFLGraph.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/CHG.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/CallGraph.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/ConsGNode.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/GenericGraph.h +3 -3
- package/SVF-osx/Release-build/include/Graphs/ICFGNode.h +6 -6
- package/SVF-osx/Release-build/include/Graphs/VFGNode.h +20 -20
- package/SVF-osx/Release-build/include/MTA/TCT.h +1 -1
- 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/LLVMModule.h +12 -12
- package/SVF-osx/Release-build/include/SVF-LLVM/LLVMUtil.h +2 -2
- package/SVF-osx/Release-build/include/SVF-LLVM/ObjTypeInference.h +1 -1
- package/SVF-osx/Release-build/include/SVF-LLVM/SVFIRBuilder.h +6 -6
- package/SVF-osx/Release-build/include/SVF-LLVM/SVFLLVMValue.h +805 -0
- package/SVF-osx/Release-build/include/SVF-LLVM/SVFModule.h +1 -1
- package/SVF-osx/Release-build/include/SVFIR/SVFValue.h +2 -2
- package/SVF-osx/Release-build/include/SVFIR/SVFVariables.h +28 -28
- 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
- /package/{SVF-osx → SVF-linux}/Release-build/include/SVF-LLVM/SVFValue.h +0 -0
|
@@ -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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -115,9 +115,9 @@ public:
|
|
|
115
115
|
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
static inline bool classof(const
|
|
118
|
+
static inline bool classof(const SVFValue* node)
|
|
119
119
|
{
|
|
120
|
-
return node->getNodeKind() ==
|
|
120
|
+
return node->getNodeKind() == SVFValue::BasicBlockKd;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
static inline bool classof(const SVFBasicBlock* node)
|
|
@@ -140,7 +140,7 @@ protected:
|
|
|
140
140
|
* Generic node on the graph as base class
|
|
141
141
|
*/
|
|
142
142
|
template<class NodeTy,class EdgeTy>
|
|
143
|
-
class GenericNode: public
|
|
143
|
+
class GenericNode: public SVFValue
|
|
144
144
|
{
|
|
145
145
|
friend class SVFIRWriter;
|
|
146
146
|
friend class SVFIRReader;
|
|
@@ -163,7 +163,7 @@ private:
|
|
|
163
163
|
|
|
164
164
|
public:
|
|
165
165
|
/// Constructor
|
|
166
|
-
GenericNode(NodeID i, GNodeK k, const SVFType* svfType = nullptr):
|
|
166
|
+
GenericNode(NodeID i, GNodeK k, const SVFType* svfType = nullptr): SVFValue(i, k, svfType)
|
|
167
167
|
{
|
|
168
168
|
|
|
169
169
|
}
|
|
@@ -327,7 +327,7 @@ public:
|
|
|
327
327
|
return true;
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
static inline bool classof(const
|
|
330
|
+
static inline bool classof(const SVFValue*)
|
|
331
331
|
{
|
|
332
332
|
return true;
|
|
333
333
|
}
|
|
@@ -137,7 +137,7 @@ public:
|
|
|
137
137
|
return isICFGNodeKinds(node->getNodeKind());
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
static inline bool classof(const
|
|
140
|
+
static inline bool classof(const SVFValue* node)
|
|
141
141
|
{
|
|
142
142
|
return isICFGNodeKinds(node->getNodeKind());
|
|
143
143
|
}
|
|
@@ -261,7 +261,7 @@ public:
|
|
|
261
261
|
return isInterICFGNodeKind(node->getNodeKind());
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
static inline bool classof(const
|
|
264
|
+
static inline bool classof(const SVFValue* node)
|
|
265
265
|
{
|
|
266
266
|
return isInterICFGNodeKind(node->getNodeKind());
|
|
267
267
|
}
|
|
@@ -331,7 +331,7 @@ public:
|
|
|
331
331
|
return node->getNodeKind() == FunEntryBlock;
|
|
332
332
|
}
|
|
333
333
|
|
|
334
|
-
static inline bool classof(const
|
|
334
|
+
static inline bool classof(const SVFValue*node)
|
|
335
335
|
{
|
|
336
336
|
return node->getNodeKind() == FunEntryBlock;
|
|
337
337
|
}
|
|
@@ -399,7 +399,7 @@ public:
|
|
|
399
399
|
return node->getNodeKind() == FunExitBlock;
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
-
static inline bool classof(const
|
|
402
|
+
static inline bool classof(const SVFValue*node)
|
|
403
403
|
{
|
|
404
404
|
return node->getNodeKind() == FunExitBlock;
|
|
405
405
|
}
|
|
@@ -571,7 +571,7 @@ public:
|
|
|
571
571
|
return node->getNodeKind() == FunCallBlock;
|
|
572
572
|
}
|
|
573
573
|
|
|
574
|
-
static inline bool classof(const
|
|
574
|
+
static inline bool classof(const SVFValue*node)
|
|
575
575
|
{
|
|
576
576
|
return node->getNodeKind() == FunCallBlock;
|
|
577
577
|
}
|
|
@@ -650,7 +650,7 @@ public:
|
|
|
650
650
|
{
|
|
651
651
|
return node->getNodeKind() == FunRetBlock;
|
|
652
652
|
}
|
|
653
|
-
static inline bool classof(const
|
|
653
|
+
static inline bool classof(const SVFValue*node)
|
|
654
654
|
{
|
|
655
655
|
return node->getNodeKind() == FunRetBlock;
|
|
656
656
|
}
|
|
@@ -112,7 +112,7 @@ public:
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
|
|
115
|
-
static inline bool classof(const
|
|
115
|
+
static inline bool classof(const SVFValue* node)
|
|
116
116
|
{
|
|
117
117
|
return isVFGNodeKinds(node->getNodeKind());
|
|
118
118
|
}
|
|
@@ -184,7 +184,7 @@ public:
|
|
|
184
184
|
{
|
|
185
185
|
return isStmtVFGNodeKinds(node->getNodeKind());
|
|
186
186
|
}
|
|
187
|
-
static inline bool classof(const
|
|
187
|
+
static inline bool classof(const SVFValue*node)
|
|
188
188
|
{
|
|
189
189
|
return isStmtVFGNodeKinds(node->getNodeKind());
|
|
190
190
|
}
|
|
@@ -228,7 +228,7 @@ public:
|
|
|
228
228
|
{
|
|
229
229
|
return node->getNodeKind() == Load;
|
|
230
230
|
}
|
|
231
|
-
static inline bool classof(const
|
|
231
|
+
static inline bool classof(const SVFValue*node)
|
|
232
232
|
{
|
|
233
233
|
return node->getNodeKind() == Load;
|
|
234
234
|
}
|
|
@@ -273,7 +273,7 @@ public:
|
|
|
273
273
|
{
|
|
274
274
|
return node->getNodeKind() == Store;
|
|
275
275
|
}
|
|
276
|
-
static inline bool classof(const
|
|
276
|
+
static inline bool classof(const SVFValue*node)
|
|
277
277
|
{
|
|
278
278
|
return node->getNodeKind() == Store;
|
|
279
279
|
}
|
|
@@ -318,7 +318,7 @@ public:
|
|
|
318
318
|
{
|
|
319
319
|
return node->getNodeKind() == Copy;
|
|
320
320
|
}
|
|
321
|
-
static inline bool classof(const
|
|
321
|
+
static inline bool classof(const SVFValue*node)
|
|
322
322
|
{
|
|
323
323
|
return node->getNodeKind() == Copy;
|
|
324
324
|
}
|
|
@@ -364,7 +364,7 @@ public:
|
|
|
364
364
|
{
|
|
365
365
|
return node->getNodeKind() == Cmp;
|
|
366
366
|
}
|
|
367
|
-
static inline bool classof(const
|
|
367
|
+
static inline bool classof(const SVFValue*node)
|
|
368
368
|
{
|
|
369
369
|
return node->getNodeKind() == Cmp;
|
|
370
370
|
}
|
|
@@ -441,7 +441,7 @@ public:
|
|
|
441
441
|
{
|
|
442
442
|
return node->getNodeKind() == BinaryOp;
|
|
443
443
|
}
|
|
444
|
-
static inline bool classof(const
|
|
444
|
+
static inline bool classof(const SVFValue*node)
|
|
445
445
|
{
|
|
446
446
|
return node->getNodeKind() == BinaryOp;
|
|
447
447
|
}
|
|
@@ -515,7 +515,7 @@ public:
|
|
|
515
515
|
{
|
|
516
516
|
return node->getNodeKind() == UnaryOp;
|
|
517
517
|
}
|
|
518
|
-
static inline bool classof(const
|
|
518
|
+
static inline bool classof(const SVFValue*node)
|
|
519
519
|
{
|
|
520
520
|
return node->getNodeKind() == UnaryOp;
|
|
521
521
|
}
|
|
@@ -587,7 +587,7 @@ public:
|
|
|
587
587
|
{
|
|
588
588
|
return node->getNodeKind() == Branch;
|
|
589
589
|
}
|
|
590
|
-
static inline bool classof(const
|
|
590
|
+
static inline bool classof(const SVFValue*node)
|
|
591
591
|
{
|
|
592
592
|
return node->getNodeKind() == Branch;
|
|
593
593
|
}
|
|
@@ -653,7 +653,7 @@ public:
|
|
|
653
653
|
{
|
|
654
654
|
return node->getNodeKind() == Gep;
|
|
655
655
|
}
|
|
656
|
-
static inline bool classof(const
|
|
656
|
+
static inline bool classof(const SVFValue*node)
|
|
657
657
|
{
|
|
658
658
|
return node->getNodeKind() == Gep;
|
|
659
659
|
}
|
|
@@ -730,7 +730,7 @@ public:
|
|
|
730
730
|
{
|
|
731
731
|
return isPHIVFGNodeKinds(node->getNodeKind());
|
|
732
732
|
}
|
|
733
|
-
static inline bool classof(const
|
|
733
|
+
static inline bool classof(const SVFValue*node)
|
|
734
734
|
{
|
|
735
735
|
return isPHIVFGNodeKinds(node->getNodeKind());
|
|
736
736
|
}
|
|
@@ -790,7 +790,7 @@ public:
|
|
|
790
790
|
{
|
|
791
791
|
return node->getNodeKind() == TIntraPhi;
|
|
792
792
|
}
|
|
793
|
-
static inline bool classof(const
|
|
793
|
+
static inline bool classof(const SVFValue*node)
|
|
794
794
|
{
|
|
795
795
|
return node->getNodeKind() == TIntraPhi;
|
|
796
796
|
}
|
|
@@ -831,7 +831,7 @@ public:
|
|
|
831
831
|
{
|
|
832
832
|
return node->getNodeKind() == Addr;
|
|
833
833
|
}
|
|
834
|
-
static inline bool classof(const
|
|
834
|
+
static inline bool classof(const SVFValue*node)
|
|
835
835
|
{
|
|
836
836
|
return node->getNodeKind() == Addr;
|
|
837
837
|
}
|
|
@@ -875,7 +875,7 @@ public:
|
|
|
875
875
|
{
|
|
876
876
|
return isArgumentVFGNodeKinds(node->getNodeKind());
|
|
877
877
|
}
|
|
878
|
-
static inline bool classof(const
|
|
878
|
+
static inline bool classof(const SVFValue*node)
|
|
879
879
|
{
|
|
880
880
|
return isArgumentVFGNodeKinds(node->getNodeKind());
|
|
881
881
|
}
|
|
@@ -929,7 +929,7 @@ public:
|
|
|
929
929
|
{
|
|
930
930
|
return node->getNodeKind() == AParm;
|
|
931
931
|
}
|
|
932
|
-
static inline bool classof(const
|
|
932
|
+
static inline bool classof(const SVFValue*node)
|
|
933
933
|
{
|
|
934
934
|
return node->getNodeKind() == AParm;
|
|
935
935
|
}
|
|
@@ -1003,7 +1003,7 @@ public:
|
|
|
1003
1003
|
{
|
|
1004
1004
|
return node->getNodeKind() == FParm;
|
|
1005
1005
|
}
|
|
1006
|
-
static inline bool classof(const
|
|
1006
|
+
static inline bool classof(const SVFValue*node)
|
|
1007
1007
|
{
|
|
1008
1008
|
return node->getNodeKind() == FParm;
|
|
1009
1009
|
}
|
|
@@ -1065,7 +1065,7 @@ public:
|
|
|
1065
1065
|
{
|
|
1066
1066
|
return node->getNodeKind() == ARet;
|
|
1067
1067
|
}
|
|
1068
|
-
static inline bool classof(const
|
|
1068
|
+
static inline bool classof(const SVFValue*node)
|
|
1069
1069
|
{
|
|
1070
1070
|
return node->getNodeKind() == ARet;
|
|
1071
1071
|
}
|
|
@@ -1135,7 +1135,7 @@ public:
|
|
|
1135
1135
|
{
|
|
1136
1136
|
return node->getNodeKind() == FRet;
|
|
1137
1137
|
}
|
|
1138
|
-
static inline bool classof(const
|
|
1138
|
+
static inline bool classof(const SVFValue*node)
|
|
1139
1139
|
{
|
|
1140
1140
|
return node->getNodeKind() == FRet;
|
|
1141
1141
|
}
|
|
@@ -1198,7 +1198,7 @@ public:
|
|
|
1198
1198
|
{
|
|
1199
1199
|
return node->getNodeKind() == TInterPhi;
|
|
1200
1200
|
}
|
|
1201
|
-
static inline bool classof(const
|
|
1201
|
+
static inline bool classof(const SVFValue*node)
|
|
1202
1202
|
{
|
|
1203
1203
|
return node->getNodeKind() == TInterPhi;
|
|
1204
1204
|
}
|
|
@@ -1250,7 +1250,7 @@ public:
|
|
|
1250
1250
|
{
|
|
1251
1251
|
return node->getNodeKind() == NPtr;
|
|
1252
1252
|
}
|
|
1253
|
-
static inline bool classof(const
|
|
1253
|
+
static inline bool classof(const SVFValue*node)
|
|
1254
1254
|
{
|
|
1255
1255
|
return node->getNodeKind() == NPtr;
|
|
1256
1256
|
}
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
#define INCLUDE_SVF_FE_LLVMMODULE_H_
|
|
32
32
|
|
|
33
33
|
#include "SVF-LLVM/BasicTypes.h"
|
|
34
|
-
#include "SVF-LLVM/
|
|
34
|
+
#include "SVF-LLVM/SVFLLVMValue.h"
|
|
35
35
|
#include "SVF-LLVM/SVFModule.h"
|
|
36
36
|
#include "Util/Options.h"
|
|
37
37
|
#include "Graphs/BasicBlockG.h"
|
|
@@ -61,8 +61,8 @@ public:
|
|
|
61
61
|
typedef Map<const Argument*, SVFArgument*> LLVMArgument2SVFArgumentMap;
|
|
62
62
|
typedef Map<const Constant*, SVFConstant*> LLVMConst2SVFConstMap;
|
|
63
63
|
typedef Map<const Value*, SVFOtherValue*> LLVMValue2SVFOtherValueMap;
|
|
64
|
-
typedef Map<const
|
|
65
|
-
typedef Map<const
|
|
64
|
+
typedef Map<const SVFLLVMValue*, const Value*> SVFValue2LLVMValueMap;
|
|
65
|
+
typedef Map<const SVFValue*, const Value*> SVFBaseNode2LLVMValueMap;
|
|
66
66
|
typedef Map<const Type*, SVFType*> LLVMType2SVFTypeMap;
|
|
67
67
|
typedef Map<const Type*, StInfo*> Type2TypeInfoMap;
|
|
68
68
|
typedef Map<std::string, std::vector<std::string>> Fun2AnnoMap;
|
|
@@ -75,7 +75,7 @@ public:
|
|
|
75
75
|
|
|
76
76
|
/// llvm value to sym id map
|
|
77
77
|
/// local (%) and global (@) identifiers are pointer types which have a value node id.
|
|
78
|
-
typedef OrderedMap<const
|
|
78
|
+
typedef OrderedMap<const SVFLLVMValue*, NodeID> ValueToIDMapTy;
|
|
79
79
|
|
|
80
80
|
typedef OrderedMap<const SVFFunction*, NodeID> FunToIDMapTy;
|
|
81
81
|
|
|
@@ -208,13 +208,13 @@ public:
|
|
|
208
208
|
|
|
209
209
|
/// Get SVFIR Node according to LLVM value
|
|
210
210
|
///getNode - Return the node corresponding to the specified pointer.
|
|
211
|
-
NodeID getValueNode(const
|
|
211
|
+
NodeID getValueNode(const SVFLLVMValue* V);
|
|
212
212
|
|
|
213
|
-
bool hasValueNode(const
|
|
213
|
+
bool hasValueNode(const SVFLLVMValue* V);
|
|
214
214
|
|
|
215
215
|
/// getObject - Return the obj node id refer to the memory object for the
|
|
216
216
|
/// specified global, heap or alloca instruction according to llvm value.
|
|
217
|
-
NodeID getObjectNode(const
|
|
217
|
+
NodeID getObjectNode(const SVFLLVMValue* V);
|
|
218
218
|
|
|
219
219
|
void dumpSymTable();
|
|
220
220
|
|
|
@@ -285,16 +285,16 @@ public:
|
|
|
285
285
|
setValueAttr(ov,svfov);
|
|
286
286
|
}
|
|
287
287
|
|
|
288
|
-
|
|
288
|
+
SVFLLVMValue* getSVFValue(const Value* value);
|
|
289
289
|
|
|
290
|
-
const Value* getLLVMValue(const
|
|
290
|
+
const Value* getLLVMValue(const SVFLLVMValue* value) const
|
|
291
291
|
{
|
|
292
292
|
SVFValue2LLVMValueMap::const_iterator it = SVFValue2LLVMValue.find(value);
|
|
293
293
|
assert(it!=SVFValue2LLVMValue.end() && "can't find corresponding llvm value!");
|
|
294
294
|
return it->second;
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
-
const Value* getLLVMValue(const
|
|
297
|
+
const Value* getLLVMValue(const SVFValue* value) const
|
|
298
298
|
{
|
|
299
299
|
SVFBaseNode2LLVMValueMap ::const_iterator it = SVFBaseNode2LLVMValue.find(value);
|
|
300
300
|
assert(it != SVFBaseNode2LLVMValue.end() && "can't find corresponding llvm value!");
|
|
@@ -536,8 +536,8 @@ private:
|
|
|
536
536
|
void initSVFFunction();
|
|
537
537
|
void initSVFBasicBlock(const Function* func);
|
|
538
538
|
void initDomTree(SVFFunction* func, const Function* f);
|
|
539
|
-
void setValueAttr(const Value* val,
|
|
540
|
-
void addToSVFVar2LLVMValueMap(const Value* val,
|
|
539
|
+
void setValueAttr(const Value* val, SVFLLVMValue* value);
|
|
540
|
+
void addToSVFVar2LLVMValueMap(const Value* val, SVFValue* svfBaseNode);
|
|
541
541
|
void buildFunToFunMap();
|
|
542
542
|
void buildGlobalDefToRepMap();
|
|
543
543
|
/// Invoke llvm passes to modify module
|