svf-lib 1.0.2125 → 1.0.2127
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/Graphs/ICFG.h +43 -0
- package/SVF-linux/Release-build/include/Graphs/ICFGNode.h +48 -33
- 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/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
|
@@ -428,19 +428,28 @@ public:
|
|
|
428
428
|
typedef std::vector<const SVFVar *> ActualParmNodeVec;
|
|
429
429
|
|
|
430
430
|
protected:
|
|
431
|
-
const SVFInstruction* cs;
|
|
432
431
|
const RetICFGNode* ret;
|
|
433
|
-
ActualParmNodeVec APNodes;
|
|
432
|
+
ActualParmNodeVec APNodes; /// arguments
|
|
433
|
+
const SVFFunction* calledFunc; /// called function
|
|
434
|
+
bool isvararg; /// is variable argument
|
|
435
|
+
bool isVirCallInst; /// is virtual call inst
|
|
436
|
+
SVFVar* vtabPtr; /// virtual table pointer
|
|
437
|
+
s32_t virtualFunIdx; /// virtual function index of the virtual table(s) at a virtual call
|
|
438
|
+
std::string funNameOfVcall; /// the function name of this virtual call
|
|
434
439
|
|
|
435
440
|
/// Constructor to create empty CallICFGNode (for SVFIRReader/deserialization)
|
|
436
|
-
CallICFGNode(NodeID id) : InterICFGNode(id, FunCallBlock),
|
|
441
|
+
CallICFGNode(NodeID id) : InterICFGNode(id, FunCallBlock), ret{} {}
|
|
437
442
|
|
|
438
443
|
public:
|
|
439
|
-
CallICFGNode(NodeID id, const
|
|
440
|
-
|
|
444
|
+
CallICFGNode(NodeID id, const SVFBasicBlock* b, const SVFType* ty,
|
|
445
|
+
const SVFFunction* cf, bool iv, bool ivc, s32_t vfi,
|
|
446
|
+
const std::string& fnv)
|
|
447
|
+
: InterICFGNode(id, FunCallBlock), ret(nullptr), calledFunc(cf),
|
|
448
|
+
isvararg(iv), isVirCallInst(ivc), vtabPtr(nullptr),
|
|
449
|
+
virtualFunIdx(vfi), funNameOfVcall(fnv)
|
|
441
450
|
{
|
|
442
|
-
fun =
|
|
443
|
-
bb =
|
|
451
|
+
fun = b->getFunction();
|
|
452
|
+
bb = b;
|
|
444
453
|
type = ty;
|
|
445
454
|
}
|
|
446
455
|
|
|
@@ -472,7 +481,7 @@ public:
|
|
|
472
481
|
/// Return true if this is an indirect call
|
|
473
482
|
inline bool isIndirectCall() const
|
|
474
483
|
{
|
|
475
|
-
return nullptr ==
|
|
484
|
+
return nullptr == calledFunc;
|
|
476
485
|
}
|
|
477
486
|
|
|
478
487
|
/// Return the set of actual parameters
|
|
@@ -488,54 +497,61 @@ public:
|
|
|
488
497
|
}
|
|
489
498
|
/// Parameter operations
|
|
490
499
|
//@{
|
|
491
|
-
const SVFVar* getArgument(u32_t ArgNo) const
|
|
500
|
+
inline const SVFVar* getArgument(u32_t ArgNo) const
|
|
492
501
|
{
|
|
493
502
|
return getActualParms()[ArgNo];
|
|
494
503
|
}
|
|
495
504
|
|
|
496
|
-
u32_t arg_size() const
|
|
505
|
+
inline u32_t arg_size() const
|
|
497
506
|
{
|
|
498
507
|
return APNodes.size();
|
|
499
508
|
}
|
|
500
|
-
bool arg_empty() const
|
|
509
|
+
inline bool arg_empty() const
|
|
501
510
|
{
|
|
502
511
|
return APNodes.empty();
|
|
503
512
|
}
|
|
504
513
|
|
|
505
|
-
u32_t getNumArgOperands() const
|
|
514
|
+
inline u32_t getNumArgOperands() const
|
|
506
515
|
{
|
|
507
516
|
return arg_size();
|
|
508
517
|
}
|
|
509
|
-
const SVFFunction* getCalledFunction() const
|
|
518
|
+
inline const SVFFunction* getCalledFunction() const
|
|
510
519
|
{
|
|
511
|
-
return
|
|
520
|
+
return calledFunc;
|
|
512
521
|
}
|
|
513
|
-
|
|
522
|
+
|
|
523
|
+
inline bool isVarArg() const
|
|
514
524
|
{
|
|
515
|
-
return
|
|
525
|
+
return isvararg;
|
|
516
526
|
}
|
|
517
|
-
bool
|
|
527
|
+
inline bool isVirtualCall() const
|
|
518
528
|
{
|
|
519
|
-
return
|
|
529
|
+
return isVirCallInst;
|
|
520
530
|
}
|
|
521
|
-
|
|
531
|
+
|
|
532
|
+
inline void setVtablePtr(SVFVar* v)
|
|
522
533
|
{
|
|
523
|
-
|
|
534
|
+
vtabPtr = v;
|
|
524
535
|
}
|
|
525
|
-
|
|
536
|
+
|
|
537
|
+
inline const SVFVar* getVtablePtr() const
|
|
526
538
|
{
|
|
527
539
|
assert(isVirtualCall() && "not a virtual call?");
|
|
528
|
-
return
|
|
540
|
+
return vtabPtr;
|
|
529
541
|
}
|
|
530
|
-
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
inline s32_t getFunIdxInVtable() const
|
|
531
545
|
{
|
|
532
546
|
assert(isVirtualCall() && "not a virtual call?");
|
|
533
|
-
|
|
547
|
+
assert(virtualFunIdx >=0 && "virtual function idx is less than 0? not set yet?");
|
|
548
|
+
return virtualFunIdx;
|
|
534
549
|
}
|
|
535
|
-
|
|
550
|
+
|
|
551
|
+
inline const std::string& getFunNameOfVirtualCall() const
|
|
536
552
|
{
|
|
537
553
|
assert(isVirtualCall() && "not a virtual call?");
|
|
538
|
-
return
|
|
554
|
+
return funNameOfVcall;
|
|
539
555
|
}
|
|
540
556
|
//@}
|
|
541
557
|
|
|
@@ -585,23 +601,22 @@ class RetICFGNode : public InterICFGNode
|
|
|
585
601
|
friend class SVFIRReader;
|
|
586
602
|
|
|
587
603
|
private:
|
|
588
|
-
const SVFInstruction* cs;
|
|
589
604
|
const SVFVar *actualRet;
|
|
590
605
|
const CallICFGNode* callBlockNode;
|
|
591
606
|
|
|
592
607
|
/// Constructor to create empty RetICFGNode (for SVFIRReader/deserialization)
|
|
593
608
|
RetICFGNode(NodeID id)
|
|
594
|
-
: InterICFGNode(id, FunRetBlock),
|
|
609
|
+
: InterICFGNode(id, FunRetBlock), actualRet{}, callBlockNode{}
|
|
595
610
|
{
|
|
596
611
|
}
|
|
597
612
|
|
|
598
613
|
public:
|
|
599
|
-
RetICFGNode(NodeID id,
|
|
600
|
-
InterICFGNode(id, FunRetBlock),
|
|
614
|
+
RetICFGNode(NodeID id, CallICFGNode* cb) :
|
|
615
|
+
InterICFGNode(id, FunRetBlock), actualRet(nullptr), callBlockNode(cb)
|
|
601
616
|
{
|
|
602
|
-
fun =
|
|
603
|
-
bb =
|
|
604
|
-
type =
|
|
617
|
+
fun = cb->getFun();
|
|
618
|
+
bb = cb->getBB();
|
|
619
|
+
type = cb->getType();
|
|
605
620
|
}
|
|
606
621
|
|
|
607
622
|
inline const CallICFGNode* getCallICFGNode() const
|
|
@@ -72,16 +72,16 @@ public:
|
|
|
72
72
|
static inline bool classof(const VFGEdge *edge)
|
|
73
73
|
{
|
|
74
74
|
return edge->getEdgeKind() == IntraIndirectVF ||
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
edge->getEdgeKind() == CallIndVF ||
|
|
76
|
+
edge->getEdgeKind() == RetIndVF ||
|
|
77
|
+
edge->getEdgeKind() == TheadMHPIndirectVF;
|
|
78
78
|
}
|
|
79
79
|
static inline bool classof(const GenericVFGEdgeTy *edge)
|
|
80
80
|
{
|
|
81
81
|
return edge->getEdgeKind() == IntraIndirectVF ||
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
edge->getEdgeKind() == CallIndVF ||
|
|
83
|
+
edge->getEdgeKind() == RetIndVF ||
|
|
84
|
+
edge->getEdgeKind() == TheadMHPIndirectVF;
|
|
85
85
|
}
|
|
86
86
|
//@}
|
|
87
87
|
|
|
@@ -202,7 +202,7 @@ public:
|
|
|
202
202
|
inline bool hasThreadForkEdge(const CallICFGNode* cs) const
|
|
203
203
|
{
|
|
204
204
|
return callinstToThreadForkEdgesMap.find(cs) !=
|
|
205
|
-
|
|
205
|
+
callinstToThreadForkEdgesMap.end();
|
|
206
206
|
}
|
|
207
207
|
inline ForkEdgeSet::const_iterator getForkEdgeBegin(const CallICFGNode* cs) const
|
|
208
208
|
{
|
|
@@ -155,14 +155,14 @@ public:
|
|
|
155
155
|
static inline bool classof(const VFGEdge *edge)
|
|
156
156
|
{
|
|
157
157
|
return edge->getEdgeKind() == IntraDirectVF ||
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
edge->getEdgeKind() == CallDirVF ||
|
|
159
|
+
edge->getEdgeKind() == RetDirVF;
|
|
160
160
|
}
|
|
161
161
|
static inline bool classof(const GenericVFGEdgeTy *edge)
|
|
162
162
|
{
|
|
163
163
|
return edge->getEdgeKind() == IntraDirectVF ||
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
edge->getEdgeKind() == CallDirVF ||
|
|
165
|
+
edge->getEdgeKind() == RetDirVF;
|
|
166
166
|
}
|
|
167
167
|
//@}
|
|
168
168
|
|
|
@@ -494,7 +494,7 @@ public:
|
|
|
494
494
|
|
|
495
495
|
/// Copy assignment operator
|
|
496
496
|
WTOComponentVisitor& operator=(const WTOComponentVisitor&) noexcept =
|
|
497
|
-
|
|
497
|
+
default;
|
|
498
498
|
|
|
499
499
|
/// Move assignment operator
|
|
500
500
|
WTOComponentVisitor& operator=(WTOComponentVisitor&&) noexcept = default;
|
|
@@ -702,7 +702,7 @@ protected:
|
|
|
702
702
|
WTOCycleDepthPtr previous_cycleDepth = _wtoCycleDepth;
|
|
703
703
|
_nodeToWTOCycleDepth.insert(std::make_pair(head, _wtoCycleDepth));
|
|
704
704
|
_wtoCycleDepth =
|
|
705
|
-
|
|
705
|
+
std::make_shared<GraphTWTOCycleDepth>(*_wtoCycleDepth);
|
|
706
706
|
_wtoCycleDepth->add(head);
|
|
707
707
|
for (auto it = cycle.begin(), et = cycle.end(); it != et; ++it)
|
|
708
708
|
{
|
|
@@ -439,8 +439,8 @@ public:
|
|
|
439
439
|
static inline bool classof(const MSSADEF *chi)
|
|
440
440
|
{
|
|
441
441
|
return chi->getType() == MSSADEF::EntryMSSACHI ||
|
|
442
|
-
|
|
443
|
-
|
|
442
|
+
chi->getType() == MSSADEF::StoreMSSACHI ||
|
|
443
|
+
chi->getType() == MSSADEF::SSACHI ;
|
|
444
444
|
}
|
|
445
445
|
//@}
|
|
446
446
|
|
|
@@ -180,8 +180,8 @@ public:
|
|
|
180
180
|
static inline bool classof(const PTData<Key, KeySet, Data, DataSet>* ptd)
|
|
181
181
|
{
|
|
182
182
|
return ptd->getPTDTY() == PTDataTy::Diff
|
|
183
|
-
|
|
184
|
-
|
|
183
|
+
|| ptd->getPTDTY() == PTDataTy::MutDiff
|
|
184
|
+
|| ptd->getPTDTY() == PTDataTy::PersDiff;
|
|
185
185
|
}
|
|
186
186
|
///@}
|
|
187
187
|
};
|
|
@@ -254,10 +254,10 @@ public:
|
|
|
254
254
|
static inline bool classof(const PTData<Key, KeySet, Data, DataSet>* ptd)
|
|
255
255
|
{
|
|
256
256
|
return ptd->getPTDTY() == BasePTData::DataFlow
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
257
|
+
|| ptd->getPTDTY() == BasePTData::MutDataFlow
|
|
258
|
+
|| ptd->getPTDTY() == BasePTData::MutIncDataFlow
|
|
259
|
+
|| ptd->getPTDTY() == BasePTData::PersDataFlow
|
|
260
|
+
|| ptd->getPTDTY() == BasePTData::PersIncDataFlow;
|
|
261
261
|
}
|
|
262
262
|
///@}
|
|
263
263
|
};
|
|
@@ -299,8 +299,8 @@ public:
|
|
|
299
299
|
static inline bool classof(const PTData<Key, KeySet, Data, DataSet>* ptd)
|
|
300
300
|
{
|
|
301
301
|
return ptd->getPTDTY() == PTDataTy::Versioned
|
|
302
|
-
|
|
303
|
-
|
|
302
|
+
|| ptd->getPTDTY() == PTDataTy::MutVersioned
|
|
303
|
+
|| ptd->getPTDTY() == PTDataTy::PersVersioned;
|
|
304
304
|
}
|
|
305
305
|
private:
|
|
306
306
|
using BasePTData::getPts;
|
|
@@ -91,7 +91,7 @@ public:
|
|
|
91
91
|
inline bool operator==(const AccessPath& rhs) const
|
|
92
92
|
{
|
|
93
93
|
return this->fldIdx == rhs.fldIdx &&
|
|
94
|
-
|
|
94
|
+
this->idxOperandPairs == rhs.idxOperandPairs && this->gepPointeeType == rhs.gepPointeeType;
|
|
95
95
|
}
|
|
96
96
|
//@}
|
|
97
97
|
|
|
@@ -589,7 +589,7 @@ public:
|
|
|
589
589
|
static inline bool classof(const PTData<Key, KeySet, Data, DataSet>* ptd)
|
|
590
590
|
{
|
|
591
591
|
return ptd->getPTDTY() == BaseDFPTData::MutDataFlow
|
|
592
|
-
|
|
592
|
+
|| ptd->getPTDTY() == BaseDFPTData::MutIncDataFlow;
|
|
593
593
|
}
|
|
594
594
|
///@}
|
|
595
595
|
|
|
@@ -541,7 +541,7 @@ public:
|
|
|
541
541
|
static inline bool classof(const PTData<Key, KeySet, Data, DataSet> *ptd)
|
|
542
542
|
{
|
|
543
543
|
return ptd->getPTDTY() == PTDataTy::PersDataFlow
|
|
544
|
-
|
|
544
|
+
|| ptd->getPTDTY() == PTDataTy::PersIncDataFlow;
|
|
545
545
|
}
|
|
546
546
|
///@}
|
|
547
547
|
|
|
@@ -86,11 +86,11 @@ public:
|
|
|
86
86
|
//@{
|
|
87
87
|
inline Condition condAnd(const Condition& lhs, const Condition& rhs)
|
|
88
88
|
{
|
|
89
|
-
return Condition::AND(lhs,rhs);
|
|
89
|
+
return Condition::AND(lhs, rhs);
|
|
90
90
|
}
|
|
91
91
|
inline Condition condOr(const Condition& lhs, const Condition& rhs)
|
|
92
92
|
{
|
|
93
|
-
return Condition::OR(lhs,rhs);
|
|
93
|
+
return Condition::OR(lhs, rhs);
|
|
94
94
|
}
|
|
95
95
|
inline Condition condNeg(const Condition& cond)
|
|
96
96
|
{
|
|
@@ -151,7 +151,7 @@ public:
|
|
|
151
151
|
bool funcEq = (keyFunc == valueFunc);
|
|
152
152
|
(void)funcEq; // Suppress warning of unused variable under release build
|
|
153
153
|
assert(funcEq && "two basicblocks should be in the same function!");
|
|
154
|
-
return keyFunc->postDominate(bbKey,bbValue);
|
|
154
|
+
return keyFunc->postDominate(bbKey, bbValue);
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
inline bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
|
|
@@ -161,7 +161,7 @@ public:
|
|
|
161
161
|
bool funcEq = (keyFunc == valueFunc);
|
|
162
162
|
(void)funcEq; // Suppress warning of unused variable under release build
|
|
163
163
|
assert(funcEq && "two basicblocks should be in the same function!");
|
|
164
|
-
return keyFunc->dominate(bbKey,bbValue);
|
|
164
|
+
return keyFunc->dominate(bbKey, bbValue);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/// Guard Computation for a value-flow (between two basic blocks)
|
|
@@ -205,7 +205,8 @@ private:
|
|
|
205
205
|
};
|
|
206
206
|
|
|
207
207
|
/// Dwarf based CHG.
|
|
208
|
-
class DCHGraph :
|
|
208
|
+
class DCHGraph :
|
|
209
|
+
public CommonCHGraph, public GenericGraph<DCHNode, DCHEdge>
|
|
209
210
|
{
|
|
210
211
|
public:
|
|
211
212
|
/// Returns the DIType beneath the qualifiers. Does not strip away "DW_TAG_members".
|
|
@@ -320,7 +321,7 @@ public:
|
|
|
320
321
|
}
|
|
321
322
|
|
|
322
323
|
if (!(base->getTag() == dwarf::DW_TAG_class_type ||
|
|
323
|
-
|
|
324
|
+
base->getTag() == dwarf::DW_TAG_structure_type))
|
|
324
325
|
{
|
|
325
326
|
return nullptr;
|
|
326
327
|
}
|
|
@@ -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;
|