svf-lib 1.0.2125 → 1.0.2126
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/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/Core/IntervalValue.h +2 -2
- package/SVF-osx/Release-build/include/AE/Core/NumericValue.h +3 -3
- package/SVF-osx/Release-build/include/CFL/CFGrammar.h +7 -7
- package/SVF-osx/Release-build/include/CFL/CFLGraphBuilder.h +10 -8
- package/SVF-osx/Release-build/include/Graphs/CallGraph.h +4 -4
- package/SVF-osx/Release-build/include/Graphs/ConsG.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/ConsGEdge.h +7 -7
- package/SVF-osx/Release-build/include/Graphs/GenericGraph.h +4 -4
- package/SVF-osx/Release-build/include/Graphs/ICFG.h +43 -0
- package/SVF-osx/Release-build/include/Graphs/ICFGEdge.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/ICFGNode.h +48 -33
- package/SVF-osx/Release-build/include/Graphs/SVFGEdge.h +6 -6
- package/SVF-osx/Release-build/include/Graphs/ThreadCallGraph.h +1 -1
- package/SVF-osx/Release-build/include/Graphs/VFGEdge.h +4 -4
- package/SVF-osx/Release-build/include/Graphs/WTO.h +2 -2
- package/SVF-osx/Release-build/include/MSSA/MSSAMuChi.h +2 -2
- package/SVF-osx/Release-build/include/MemoryModel/AbstractPointsToDS.h +8 -8
- package/SVF-osx/Release-build/include/MemoryModel/AccessPath.h +1 -1
- package/SVF-osx/Release-build/include/MemoryModel/MutablePointsToDS.h +1 -1
- package/SVF-osx/Release-build/include/MemoryModel/PersistentPointsToDS.h +1 -1
- package/SVF-osx/Release-build/include/SABER/SaberCondAllocator.h +4 -4
- package/SVF-osx/Release-build/include/SVF-LLVM/DCHG.h +3 -2
- package/SVF-osx/Release-build/include/SVF-LLVM/LLVMModule.h +4 -4
- package/SVF-osx/Release-build/include/SVF-LLVM/LLVMUtil.h +6 -6
- package/SVF-osx/Release-build/include/SVFIR/SVFFileSystem.h +2 -2
- package/SVF-osx/Release-build/include/SVFIR/SVFIR.h +5 -5
- package/SVF-osx/Release-build/include/SVFIR/SVFStatements.h +42 -40
- package/SVF-osx/Release-build/include/SVFIR/SVFValue.h +19 -19
- package/SVF-osx/Release-build/include/SVFIR/SVFVariables.h +2 -2
- package/SVF-osx/Release-build/include/Util/Casting.h +6 -6
- package/SVF-osx/Release-build/include/Util/GeneralType.h +26 -26
- package/SVF-osx/Release-build/include/Util/SVFUtil.h +3 -3
- package/SVF-osx/Release-build/include/Util/SparseBitVector.h +7 -7
- package/SVF-osx/Release-build/include/Util/iterator.h +1 -1
- package/SVF-osx/Release-build/include/WPA/Andersen.h +9 -9
- package/SVF-osx/Release-build/include/WPA/FlowSensitive.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
|
@@ -166,22 +166,22 @@ public:
|
|
|
166
166
|
inline void addFunctionMap(const Function* func, SVFFunction* svfFunc)
|
|
167
167
|
{
|
|
168
168
|
LLVMFunc2SVFFunc[func] = svfFunc;
|
|
169
|
-
setValueAttr(func,svfFunc);
|
|
169
|
+
setValueAttr(func, svfFunc);
|
|
170
170
|
}
|
|
171
171
|
inline void addBasicBlockMap(const BasicBlock* bb, SVFBasicBlock* svfBB)
|
|
172
172
|
{
|
|
173
173
|
LLVMBB2SVFBB[bb] = svfBB;
|
|
174
|
-
setValueAttr(bb,svfBB);
|
|
174
|
+
setValueAttr(bb, svfBB);
|
|
175
175
|
}
|
|
176
176
|
inline void addInstructionMap(const Instruction* inst, SVFInstruction* svfInst)
|
|
177
177
|
{
|
|
178
178
|
LLVMInst2SVFInst[inst] = svfInst;
|
|
179
|
-
setValueAttr(inst,svfInst);
|
|
179
|
+
setValueAttr(inst, svfInst);
|
|
180
180
|
}
|
|
181
181
|
inline void addArgumentMap(const Argument* arg, SVFArgument* svfArg)
|
|
182
182
|
{
|
|
183
183
|
LLVMArgument2SVFArgument[arg] = svfArg;
|
|
184
|
-
setValueAttr(arg,svfArg);
|
|
184
|
+
setValueAttr(arg, svfArg);
|
|
185
185
|
}
|
|
186
186
|
inline void addGlobalValueMap(const GlobalValue* glob, SVFGlobalValue* svfglob)
|
|
187
187
|
{
|
|
@@ -233,10 +233,10 @@ inline const ConstantExpr* isTruncConstantExpr(const Value* val)
|
|
|
233
233
|
if (const ConstantExpr* constExpr = SVFUtil::dyn_cast<ConstantExpr>(val))
|
|
234
234
|
{
|
|
235
235
|
if (constExpr->getOpcode() == Instruction::Trunc ||
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
236
|
+
constExpr->getOpcode() == Instruction::FPTrunc ||
|
|
237
|
+
constExpr->getOpcode() == Instruction::ZExt ||
|
|
238
|
+
constExpr->getOpcode() == Instruction::SExt ||
|
|
239
|
+
constExpr->getOpcode() == Instruction::FPExt)
|
|
240
240
|
return constExpr;
|
|
241
241
|
}
|
|
242
242
|
return nullptr;
|
|
@@ -247,7 +247,7 @@ inline const ConstantExpr* isCmpConstantExpr(const Value* val)
|
|
|
247
247
|
if (const ConstantExpr* constExpr = SVFUtil::dyn_cast<ConstantExpr>(val))
|
|
248
248
|
{
|
|
249
249
|
if (constExpr->getOpcode() == Instruction::ICmp ||
|
|
250
|
-
|
|
250
|
+
constExpr->getOpcode() == Instruction::FCmp)
|
|
251
251
|
return constExpr;
|
|
252
252
|
}
|
|
253
253
|
return nullptr;
|
|
@@ -297,7 +297,7 @@ void getNextInsts(const Instruction* curInst,
|
|
|
297
297
|
inline bool isNoPrecessorBasicBlock(const BasicBlock* bb)
|
|
298
298
|
{
|
|
299
299
|
return bb != &bb->getParent()->getEntryBlock() &&
|
|
300
|
-
|
|
300
|
+
pred_empty(bb);
|
|
301
301
|
}
|
|
302
302
|
|
|
303
303
|
/// Check whether a file is an LLVM IR file
|
|
@@ -620,7 +620,7 @@ private:
|
|
|
620
620
|
|
|
621
621
|
template <typename T,
|
|
622
622
|
typename = std::enable_if_t<SVFUtil::is_iterable_v<T>>>
|
|
623
|
-
|
|
623
|
+
cJSON* toJson(const T& container)
|
|
624
624
|
{
|
|
625
625
|
cJSON* array = jsonCreateArray();
|
|
626
626
|
for (const auto& item : container)
|
|
@@ -792,7 +792,7 @@ public:
|
|
|
792
792
|
template <typename FillFunc> void fillObjs(FillFunc fillFunc)
|
|
793
793
|
{
|
|
794
794
|
assert(jsonArray.size() == ptrPool.size() &&
|
|
795
|
-
|
|
795
|
+
"jsonArray and ptrPool should have same size");
|
|
796
796
|
for (size_t i = 0; i < jsonArray.size(); ++i)
|
|
797
797
|
{
|
|
798
798
|
const cJSON*& objFieldJson = jsonArray[i];
|
|
@@ -202,7 +202,7 @@ public:
|
|
|
202
202
|
inline bool hasPTASVFStmtList(const ICFGNode* inst) const
|
|
203
203
|
{
|
|
204
204
|
return icfgNode2PTASVFStmtsMap.find(inst) !=
|
|
205
|
-
|
|
205
|
+
icfgNode2PTASVFStmtsMap.end();
|
|
206
206
|
}
|
|
207
207
|
/// Given an instruction, get all its PAGEdges
|
|
208
208
|
inline SVFStmtList& getSVFStmtList(const ICFGNode* inst)
|
|
@@ -601,16 +601,16 @@ private:
|
|
|
601
601
|
inline NodeID addValNode(const SVFValue*, SVFVar *node, NodeID i)
|
|
602
602
|
{
|
|
603
603
|
assert(hasGNode(i) == false &&
|
|
604
|
-
|
|
605
|
-
|
|
604
|
+
"This NodeID clashes here. Please check NodeIDAllocator. Switch "
|
|
605
|
+
"Strategy::DBUG to SEQ or DENSE");
|
|
606
606
|
return addNode(node, i);
|
|
607
607
|
}
|
|
608
608
|
/// Add a memory obj node
|
|
609
609
|
inline NodeID addObjNode(const SVFValue*, SVFVar *node, NodeID i)
|
|
610
610
|
{
|
|
611
611
|
assert(hasGNode(i) == false &&
|
|
612
|
-
|
|
613
|
-
|
|
612
|
+
"This NodeID clashes here. Please check NodeIDAllocator. Switch "
|
|
613
|
+
"Strategy::DBUG to SEQ or DENSE");
|
|
614
614
|
return addNode(node, i);
|
|
615
615
|
}
|
|
616
616
|
/// Add a unique return node for a procedure
|
|
@@ -107,20 +107,20 @@ public:
|
|
|
107
107
|
static inline bool classof(const GenericPAGEdgeTy* edge)
|
|
108
108
|
{
|
|
109
109
|
return edge->getEdgeKind() == SVFStmt::Addr ||
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
110
|
+
edge->getEdgeKind() == SVFStmt::Copy ||
|
|
111
|
+
edge->getEdgeKind() == SVFStmt::Store ||
|
|
112
|
+
edge->getEdgeKind() == SVFStmt::Load ||
|
|
113
|
+
edge->getEdgeKind() == SVFStmt::Call ||
|
|
114
|
+
edge->getEdgeKind() == SVFStmt::Ret ||
|
|
115
|
+
edge->getEdgeKind() == SVFStmt::Gep ||
|
|
116
|
+
edge->getEdgeKind() == SVFStmt::Phi ||
|
|
117
|
+
edge->getEdgeKind() == SVFStmt::Select ||
|
|
118
|
+
edge->getEdgeKind() == SVFStmt::Cmp ||
|
|
119
|
+
edge->getEdgeKind() == SVFStmt::BinaryOp ||
|
|
120
|
+
edge->getEdgeKind() == SVFStmt::UnaryOp ||
|
|
121
|
+
edge->getEdgeKind() == SVFStmt::Branch ||
|
|
122
|
+
edge->getEdgeKind() == SVFStmt::ThreadFork ||
|
|
123
|
+
edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
124
124
|
}
|
|
125
125
|
///@}
|
|
126
126
|
|
|
@@ -264,26 +264,26 @@ public:
|
|
|
264
264
|
static inline bool classof(const SVFStmt* edge)
|
|
265
265
|
{
|
|
266
266
|
return edge->getEdgeKind() == SVFStmt::Addr ||
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
267
|
+
edge->getEdgeKind() == SVFStmt::Copy ||
|
|
268
|
+
edge->getEdgeKind() == SVFStmt::Store ||
|
|
269
|
+
edge->getEdgeKind() == SVFStmt::Load ||
|
|
270
|
+
edge->getEdgeKind() == SVFStmt::Call ||
|
|
271
|
+
edge->getEdgeKind() == SVFStmt::Ret ||
|
|
272
|
+
edge->getEdgeKind() == SVFStmt::Gep ||
|
|
273
|
+
edge->getEdgeKind() == SVFStmt::ThreadFork ||
|
|
274
|
+
edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
275
275
|
}
|
|
276
276
|
static inline bool classof(const GenericPAGEdgeTy* edge)
|
|
277
277
|
{
|
|
278
278
|
return edge->getEdgeKind() == SVFStmt::Addr ||
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
279
|
+
edge->getEdgeKind() == SVFStmt::Copy ||
|
|
280
|
+
edge->getEdgeKind() == SVFStmt::Store ||
|
|
281
|
+
edge->getEdgeKind() == SVFStmt::Load ||
|
|
282
|
+
edge->getEdgeKind() == SVFStmt::Call ||
|
|
283
|
+
edge->getEdgeKind() == SVFStmt::Ret ||
|
|
284
|
+
edge->getEdgeKind() == SVFStmt::Gep ||
|
|
285
|
+
edge->getEdgeKind() == SVFStmt::ThreadFork ||
|
|
286
|
+
edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
287
287
|
}
|
|
288
288
|
//@}
|
|
289
289
|
|
|
@@ -633,12 +633,12 @@ public:
|
|
|
633
633
|
static inline bool classof(const SVFStmt* edge)
|
|
634
634
|
{
|
|
635
635
|
return edge->getEdgeKind() == SVFStmt::Call ||
|
|
636
|
-
|
|
636
|
+
edge->getEdgeKind() == SVFStmt::ThreadFork;
|
|
637
637
|
}
|
|
638
638
|
static inline bool classof(const GenericPAGEdgeTy* edge)
|
|
639
639
|
{
|
|
640
640
|
return edge->getEdgeKind() == SVFStmt::Call ||
|
|
641
|
-
|
|
641
|
+
edge->getEdgeKind() == SVFStmt::ThreadFork;
|
|
642
642
|
}
|
|
643
643
|
//@}
|
|
644
644
|
|
|
@@ -694,12 +694,12 @@ public:
|
|
|
694
694
|
static inline bool classof(const SVFStmt* edge)
|
|
695
695
|
{
|
|
696
696
|
return edge->getEdgeKind() == SVFStmt::Ret ||
|
|
697
|
-
|
|
697
|
+
edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
698
698
|
}
|
|
699
699
|
static inline bool classof(const GenericPAGEdgeTy* edge)
|
|
700
700
|
{
|
|
701
701
|
return edge->getEdgeKind() == SVFStmt::Ret ||
|
|
702
|
-
|
|
702
|
+
edge->getEdgeKind() == SVFStmt::ThreadJoin;
|
|
703
703
|
}
|
|
704
704
|
//@}
|
|
705
705
|
|
|
@@ -763,12 +763,12 @@ public:
|
|
|
763
763
|
static inline bool classof(const SVFStmt* node)
|
|
764
764
|
{
|
|
765
765
|
return node->getEdgeKind() == Phi || node->getEdgeKind() == Select ||
|
|
766
|
-
|
|
766
|
+
node->getEdgeKind() == BinaryOp || node->getEdgeKind() == Cmp;
|
|
767
767
|
}
|
|
768
768
|
static inline bool classof(const GenericPAGEdgeTy* node)
|
|
769
769
|
{
|
|
770
770
|
return node->getEdgeKind() == Phi || node->getEdgeKind() == Select ||
|
|
771
|
-
|
|
771
|
+
node->getEdgeKind() == BinaryOp || node->getEdgeKind() == Cmp;
|
|
772
772
|
}
|
|
773
773
|
//@}
|
|
774
774
|
/// Operands and result at a BinaryNode e.g., p = q + r, `p` is resVar and
|
|
@@ -853,14 +853,14 @@ public:
|
|
|
853
853
|
: MultiOpndStmt(s, opnds, SVFStmt::Phi), opICFGNodes(icfgNodes)
|
|
854
854
|
{
|
|
855
855
|
assert(opnds.size() == icfgNodes.size() &&
|
|
856
|
-
|
|
856
|
+
"Numbers of operands and their ICFGNodes are not consistent?");
|
|
857
857
|
}
|
|
858
858
|
void addOpVar(SVFVar* op, const ICFGNode* inode)
|
|
859
859
|
{
|
|
860
860
|
opVars.push_back(op);
|
|
861
861
|
opICFGNodes.push_back(inode);
|
|
862
862
|
assert(opVars.size() == opICFGNodes.size() &&
|
|
863
|
-
|
|
863
|
+
"Numbers of operands and their ICFGNodes are not consistent?");
|
|
864
864
|
}
|
|
865
865
|
|
|
866
866
|
/// Return the corresponding ICFGNode of this operand
|
|
@@ -1247,7 +1247,8 @@ public:
|
|
|
1247
1247
|
/*!
|
|
1248
1248
|
* Thread Fork
|
|
1249
1249
|
*/
|
|
1250
|
-
class TDForkPE:
|
|
1250
|
+
class TDForkPE:
|
|
1251
|
+
public CallPE
|
|
1251
1252
|
{
|
|
1252
1253
|
friend class SVFIRWriter;
|
|
1253
1254
|
friend class SVFIRReader;
|
|
@@ -1288,7 +1289,8 @@ public:
|
|
|
1288
1289
|
/*!
|
|
1289
1290
|
* Thread Join
|
|
1290
1291
|
*/
|
|
1291
|
-
class TDJoinPE:
|
|
1292
|
+
class TDJoinPE:
|
|
1293
|
+
public RetPE
|
|
1292
1294
|
{
|
|
1293
1295
|
friend class SVFIRWriter;
|
|
1294
1296
|
friend class SVFIRReader;
|
|
@@ -149,7 +149,7 @@ public:
|
|
|
149
149
|
inline bool isUnreachable(const SVFBasicBlock* bb) const
|
|
150
150
|
{
|
|
151
151
|
return std::find(reachableBBs.begin(), reachableBBs.end(), bb) ==
|
|
152
|
-
|
|
152
|
+
reachableBBs.end();
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
inline const BBList& getReachableBBs() const
|
|
@@ -215,7 +215,7 @@ protected:
|
|
|
215
215
|
/// Constructor without name
|
|
216
216
|
SVFValue(const SVFType* ty, SVFValKind k)
|
|
217
217
|
: kind(k), ptrInUncalledFun(false),
|
|
218
|
-
|
|
218
|
+
constDataOrAggData(SVFConstData == k), type(ty), sourceLoc("NoLoc")
|
|
219
219
|
{
|
|
220
220
|
}
|
|
221
221
|
|
|
@@ -540,7 +540,7 @@ protected:
|
|
|
540
540
|
inline void addICFGNode(const ICFGNode* icfgNode)
|
|
541
541
|
{
|
|
542
542
|
assert(std::find(getICFGNodeList().begin(), getICFGNodeList().end(),
|
|
543
|
-
|
|
543
|
+
icfgNode) == getICFGNodeList().end() && "duplicated icfgnode");
|
|
544
544
|
allICFGNodes.push_back(icfgNode);
|
|
545
545
|
}
|
|
546
546
|
|
|
@@ -641,8 +641,8 @@ public:
|
|
|
641
641
|
static inline bool classof(const SVFValue *node)
|
|
642
642
|
{
|
|
643
643
|
return node->getKind() == SVFInst ||
|
|
644
|
-
|
|
645
|
-
|
|
644
|
+
node->getKind() == SVFCall ||
|
|
645
|
+
node->getKind() == SVFVCall;
|
|
646
646
|
}
|
|
647
647
|
|
|
648
648
|
inline const SVFBasicBlock* getParent() const
|
|
@@ -808,12 +808,12 @@ public:
|
|
|
808
808
|
static inline bool classof(const SVFValue *node)
|
|
809
809
|
{
|
|
810
810
|
return node->getKind() == SVFConst ||
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
811
|
+
node->getKind() == SVFGlob ||
|
|
812
|
+
node->getKind() == SVFConstData ||
|
|
813
|
+
node->getKind() == SVFConstInt ||
|
|
814
|
+
node->getKind() == SVFConstFP ||
|
|
815
|
+
node->getKind() == SVFNullPtr ||
|
|
816
|
+
node->getKind() == SVFBlackHole;
|
|
817
817
|
}
|
|
818
818
|
|
|
819
819
|
};
|
|
@@ -913,18 +913,18 @@ public:
|
|
|
913
913
|
static inline bool classof(const SVFValue *node)
|
|
914
914
|
{
|
|
915
915
|
return node->getKind() == SVFConstData ||
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
916
|
+
node->getKind() == SVFConstInt ||
|
|
917
|
+
node->getKind() == SVFConstFP ||
|
|
918
|
+
node->getKind() == SVFNullPtr ||
|
|
919
|
+
node->getKind() == SVFBlackHole;
|
|
920
920
|
}
|
|
921
921
|
static inline bool classof(const SVFConstantData *node)
|
|
922
922
|
{
|
|
923
923
|
return node->getKind() == SVFConstData ||
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
924
|
+
node->getKind() == SVFConstInt ||
|
|
925
|
+
node->getKind() == SVFConstFP ||
|
|
926
|
+
node->getKind() == SVFNullPtr ||
|
|
927
|
+
node->getKind() == SVFBlackHole;
|
|
928
928
|
}
|
|
929
929
|
};
|
|
930
930
|
|
|
@@ -83,8 +83,8 @@ public:
|
|
|
83
83
|
inline const SVFValue* getValue() const
|
|
84
84
|
{
|
|
85
85
|
assert(this->getNodeKind() != DummyValNode &&
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
this->getNodeKind() != DummyObjNode &&
|
|
87
|
+
"dummy node do not have value!");
|
|
88
88
|
assert(!SymbolTableInfo::isBlkObjOrConstantObj(this->getId()) &&
|
|
89
89
|
"blackhole and constant obj do not have value");
|
|
90
90
|
assert(value &&
|
|
@@ -217,8 +217,8 @@ struct isa_impl_wrap
|
|
|
217
217
|
static bool doit(const From &Val)
|
|
218
218
|
{
|
|
219
219
|
return isa_impl_wrap<To, SimpleFrom,
|
|
220
|
-
|
|
221
|
-
|
|
220
|
+
typename simplify_type<SimpleFrom>::SimpleType>::doit(
|
|
221
|
+
simplify_type<const From>::getSimplifiedValue(Val));
|
|
222
222
|
}
|
|
223
223
|
};
|
|
224
224
|
|
|
@@ -285,11 +285,11 @@ template<class To, class From> struct cast_retty_impl<To, const From*const>
|
|
|
285
285
|
template <class To, class From>
|
|
286
286
|
struct cast_retty_impl<To, std::unique_ptr<From>>
|
|
287
287
|
{
|
|
288
|
-
private:
|
|
288
|
+
private:
|
|
289
289
|
using PointerType = typename cast_retty_impl<To, From *>::ret_type;
|
|
290
290
|
using ResultType = typename std::remove_pointer<PointerType>::type;
|
|
291
291
|
|
|
292
|
-
public:
|
|
292
|
+
public:
|
|
293
293
|
using ret_type = std::unique_ptr<ResultType>;
|
|
294
294
|
};
|
|
295
295
|
|
|
@@ -325,8 +325,8 @@ template<class To, class From, class SimpleFrom> struct cast_convert_val
|
|
|
325
325
|
static typename cast_retty<To, From>::ret_type doit(From &Val)
|
|
326
326
|
{
|
|
327
327
|
return cast_convert_val<To, SimpleFrom,
|
|
328
|
-
|
|
329
|
-
|
|
328
|
+
typename simplify_type<SimpleFrom>::SimpleType>::doit(
|
|
329
|
+
simplify_type<From>::getSimplifiedValue(Val));
|
|
330
330
|
}
|
|
331
331
|
};
|
|
332
332
|
|
|
@@ -98,30 +98,30 @@ using Set = std::unordered_set<Key, Hash, KeyEqual, Allocator>;
|
|
|
98
98
|
template <typename Key, typename Value, typename Hash = Hash<Key>,
|
|
99
99
|
typename KeyEqual = std::equal_to<Key>,
|
|
100
100
|
typename Allocator = std::allocator<std::pair<const Key, Value>>>
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
101
|
+
using Map = std::unordered_map<Key, Value, Hash, KeyEqual, Allocator>;
|
|
102
|
+
|
|
103
|
+
template <typename Key, typename Compare = std::less<Key>,
|
|
104
|
+
typename Allocator = std::allocator<Key>>
|
|
105
|
+
using OrderedSet = std::set<Key, Compare, Allocator>;
|
|
106
|
+
|
|
107
|
+
template <typename Key, typename Value, typename Compare = std::less<Key>,
|
|
108
|
+
typename Allocator = std::allocator<std::pair<const Key, Value>>>
|
|
109
|
+
using OrderedMap = std::map<Key, Value, Compare, Allocator>;
|
|
110
|
+
|
|
111
|
+
typedef std::pair<NodeID, NodeID> NodePair;
|
|
112
|
+
typedef OrderedSet<NodeID> OrderedNodeSet;
|
|
113
|
+
typedef Set<NodeID> NodeSet;
|
|
114
|
+
typedef Set<NodePair> NodePairSet;
|
|
115
|
+
typedef Map<NodePair, NodeID> NodePairMap;
|
|
116
|
+
typedef std::vector<NodeID> NodeVector;
|
|
117
|
+
typedef std::vector<EdgeID> EdgeVector;
|
|
118
|
+
typedef std::stack<NodeID> NodeStack;
|
|
119
|
+
typedef std::list<NodeID> NodeList;
|
|
120
|
+
typedef std::deque<NodeID> NodeDeque;
|
|
121
|
+
typedef NodeSet EdgeSet;
|
|
122
|
+
typedef std::vector<u32_t> CallStrCxt;
|
|
123
|
+
typedef unsigned Version;
|
|
124
|
+
typedef Set<Version> VersionSet;
|
|
125
|
+
typedef std::pair<NodeID, Version> VersionedVar;
|
|
126
|
+
typedef Set<VersionedVar> VersionedVarSet;
|
|
127
127
|
}
|
|
@@ -356,8 +356,8 @@ inline const SVFFunction* getProgEntryFunction(SVFModule* svfModule)
|
|
|
356
356
|
inline bool isProgExitFunction (const SVFFunction * fun)
|
|
357
357
|
{
|
|
358
358
|
return fun && (fun->getName() == "exit" ||
|
|
359
|
-
|
|
360
|
-
|
|
359
|
+
fun->getName() == "__assert_rtn" ||
|
|
360
|
+
fun->getName() == "__assert_fail" );
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
/// Return true if this argument belongs to an uncalled function
|
|
@@ -480,7 +480,7 @@ template <typename... Ts> using void_t = typename make_void<Ts...>::type;
|
|
|
480
480
|
template <typename T, typename = void> struct is_iterable : std::false_type {};
|
|
481
481
|
template <typename T>
|
|
482
482
|
struct is_iterable<T, void_t<decltype(std::begin(std::declval<T&>()) !=
|
|
483
|
-
|
|
483
|
+
std::end(std::declval<T&>()))>>
|
|
484
484
|
: std::true_type {};
|
|
485
485
|
template <typename T> constexpr bool is_iterable_v = is_iterable<T>::value;
|
|
486
486
|
///@}
|
|
@@ -388,7 +388,7 @@ public:
|
|
|
388
388
|
unsigned BitPos = Curr % BITWORD_SIZE;
|
|
389
389
|
BitWord Copy = Bits[WordPos];
|
|
390
390
|
assert(WordPos <= BITWORDS_PER_ELEMENT
|
|
391
|
-
|
|
391
|
+
&& "Word Position outside of element");
|
|
392
392
|
|
|
393
393
|
// Mask off previous bits.
|
|
394
394
|
Copy &= ~0UL << BitPos;
|
|
@@ -552,13 +552,13 @@ class SparseBitVector
|
|
|
552
552
|
else if (CurrElementIter->index() > ElementIndex)
|
|
553
553
|
{
|
|
554
554
|
while (ElementIter != Begin
|
|
555
|
-
|
|
555
|
+
&& ElementIter->index() > ElementIndex)
|
|
556
556
|
--ElementIter;
|
|
557
557
|
}
|
|
558
558
|
else
|
|
559
559
|
{
|
|
560
560
|
while (ElementIter != End &&
|
|
561
|
-
|
|
561
|
+
ElementIter->index() < ElementIndex)
|
|
562
562
|
++ElementIter;
|
|
563
563
|
}
|
|
564
564
|
CurrElementIter = ElementIter;
|
|
@@ -758,7 +758,7 @@ public:
|
|
|
758
758
|
// If we can't find an element that is supposed to contain this bit, there
|
|
759
759
|
// is nothing more to do.
|
|
760
760
|
if (ElementIter == Elements.end() ||
|
|
761
|
-
|
|
761
|
+
ElementIter->index() != ElementIndex)
|
|
762
762
|
return false;
|
|
763
763
|
return ElementIter->test(Idx % ElementSize);
|
|
764
764
|
}
|
|
@@ -774,7 +774,7 @@ public:
|
|
|
774
774
|
// If we can't find an element that is supposed to contain this bit, there
|
|
775
775
|
// is nothing more to do.
|
|
776
776
|
if (ElementIter == Elements.end() ||
|
|
777
|
-
|
|
777
|
+
ElementIter->index() != ElementIndex)
|
|
778
778
|
return;
|
|
779
779
|
ElementIter->reset(Idx % ElementSize);
|
|
780
780
|
|
|
@@ -799,13 +799,13 @@ public:
|
|
|
799
799
|
ElementIter = FindLowerBound(ElementIndex);
|
|
800
800
|
|
|
801
801
|
if (ElementIter == Elements.end() ||
|
|
802
|
-
|
|
802
|
+
ElementIter->index() != ElementIndex)
|
|
803
803
|
{
|
|
804
804
|
// We may have hit the beginning of our SparseBitVector, in which case,
|
|
805
805
|
// we may need to insert right after this element, which requires moving
|
|
806
806
|
// the current iterator forward one, because insert does insert before.
|
|
807
807
|
if (ElementIter != Elements.end() &&
|
|
808
|
-
|
|
808
|
+
ElementIter->index() < ElementIndex)
|
|
809
809
|
++ElementIter;
|
|
810
810
|
ElementIter = Elements.emplace(ElementIter, ElementIndex);
|
|
811
811
|
}
|
|
@@ -173,7 +173,7 @@ public:
|
|
|
173
173
|
IsRandomAccess,
|
|
174
174
|
"Relational operators are only defined for random access iterators.");
|
|
175
175
|
return !(static_cast<const DerivedT &>(*this) < RHS) &&
|
|
176
|
-
|
|
176
|
+
!(static_cast<const DerivedT &>(*this) == RHS);
|
|
177
177
|
}
|
|
178
178
|
bool operator<=(const DerivedT &RHS) const
|
|
179
179
|
{
|
|
@@ -109,12 +109,12 @@ public:
|
|
|
109
109
|
static inline bool classof(const PointerAnalysis *pta)
|
|
110
110
|
{
|
|
111
111
|
return ( pta->getAnalysisTy() == Andersen_BASE
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
|| pta->getAnalysisTy() == Andersen_WPA
|
|
113
|
+
|| pta->getAnalysisTy() == AndersenWaveDiff_WPA
|
|
114
|
+
|| pta->getAnalysisTy() == AndersenSCD_WPA
|
|
115
|
+
|| pta->getAnalysisTy() == AndersenSFR_WPA
|
|
116
|
+
|| pta->getAnalysisTy() == TypeCPP_WPA
|
|
117
|
+
|| pta->getAnalysisTy() == Steensgaard_WPA);
|
|
118
118
|
}
|
|
119
119
|
//@}
|
|
120
120
|
|
|
@@ -229,9 +229,9 @@ public:
|
|
|
229
229
|
static inline bool classof(const PointerAnalysis *pta)
|
|
230
230
|
{
|
|
231
231
|
return (pta->getAnalysisTy() == Andersen_WPA
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
232
|
+
|| pta->getAnalysisTy() == AndersenWaveDiff_WPA
|
|
233
|
+
|| pta->getAnalysisTy() == AndersenSCD_WPA
|
|
234
|
+
|| pta->getAnalysisTy() == AndersenSFR_WPA);
|
|
235
235
|
}
|
|
236
236
|
//@}
|
|
237
237
|
|
|
@@ -247,11 +247,11 @@ protected:
|
|
|
247
247
|
//@{
|
|
248
248
|
inline const PointsTo& getDFInPtsSet(const SVFGNode* stmt, const NodeID node)
|
|
249
249
|
{
|
|
250
|
-
return getDFPTDataTy()->getDFInPtsSet(stmt->getId(),node);
|
|
250
|
+
return getDFPTDataTy()->getDFInPtsSet(stmt->getId(), node);
|
|
251
251
|
}
|
|
252
252
|
inline const PointsTo& getDFOutPtsSet(const SVFGNode* stmt, const NodeID node)
|
|
253
253
|
{
|
|
254
|
-
return getDFPTDataTy()->getDFOutPtsSet(stmt->getId(),node);
|
|
254
|
+
return getDFPTDataTy()->getDFOutPtsSet(stmt->getId(), node);
|
|
255
255
|
}
|
|
256
256
|
//@}
|
|
257
257
|
|
|
Binary file
|
|
Binary file
|