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
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -172,6 +172,49 @@ protected:
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
virtual inline IntraICFGNode* addIntraICFGNode(const SVFBasicBlock* bb, bool isRet)
|
|
176
|
+
{
|
|
177
|
+
IntraICFGNode* intraIcfgNode =
|
|
178
|
+
new IntraICFGNode(totalICFGNode++, bb, isRet);
|
|
179
|
+
addICFGNode(intraIcfgNode);
|
|
180
|
+
return intraIcfgNode;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
virtual inline CallICFGNode* addCallICFGNode(
|
|
184
|
+
const SVFBasicBlock* bb, const SVFType* ty,
|
|
185
|
+
const SVFFunction* calledFunc, bool isVararg, bool isvcall,
|
|
186
|
+
s32_t vcallIdx, const std::string& funNameOfVcall)
|
|
187
|
+
{
|
|
188
|
+
|
|
189
|
+
CallICFGNode* callICFGNode =
|
|
190
|
+
new CallICFGNode(totalICFGNode++, bb, ty, calledFunc, isVararg,
|
|
191
|
+
isvcall, vcallIdx, funNameOfVcall);
|
|
192
|
+
addICFGNode(callICFGNode);
|
|
193
|
+
return callICFGNode;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
virtual inline RetICFGNode* addRetICFGNode(CallICFGNode* call)
|
|
197
|
+
{
|
|
198
|
+
RetICFGNode* retICFGNode = new RetICFGNode(totalICFGNode++, call);
|
|
199
|
+
call->setRetICFGNode(retICFGNode);
|
|
200
|
+
addICFGNode(retICFGNode);
|
|
201
|
+
return retICFGNode;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
virtual inline FunEntryICFGNode* addFunEntryICFGNode(const SVFFunction* svfFunc)
|
|
205
|
+
{
|
|
206
|
+
FunEntryICFGNode* sNode = new FunEntryICFGNode(totalICFGNode++,svfFunc);
|
|
207
|
+
addICFGNode(sNode);
|
|
208
|
+
return FunToFunEntryNodeMap[svfFunc] = sNode;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
virtual inline FunExitICFGNode* addFunExitICFGNode(const SVFFunction* svfFunc)
|
|
212
|
+
{
|
|
213
|
+
FunExitICFGNode* sNode = new FunExitICFGNode(totalICFGNode++, svfFunc);
|
|
214
|
+
addICFGNode(sNode);
|
|
215
|
+
return FunToFunExitNodeMap[svfFunc] = sNode;
|
|
216
|
+
}
|
|
217
|
+
|
|
175
218
|
/// Add a ICFG node
|
|
176
219
|
virtual inline void addICFGNode(ICFGNode* node)
|
|
177
220
|
{
|
|
@@ -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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1002,7 +1002,7 @@ inline IntervalValue operator|(const IntervalValue &lhs, const IntervalValue &rh
|
|
|
1002
1002
|
else if (lhs.is_numeral() && rhs.is_numeral())
|
|
1003
1003
|
return IntervalValue(lhs.lb() | rhs.lb());
|
|
1004
1004
|
else if (lhs.lb().getNumeral() >= 0 && !lhs.ub().is_infinity() &&
|
|
1005
|
-
|
|
1005
|
+
rhs.lb().getNumeral() >= 0 && !rhs.ub().is_infinity())
|
|
1006
1006
|
{
|
|
1007
1007
|
s64_t m = std::max(lhs.ub().getNumeral(), rhs.ub().getNumeral());
|
|
1008
1008
|
s64_t ub = next_power_of_2(s64_t(m)) - 1;
|
|
@@ -1031,7 +1031,7 @@ inline IntervalValue operator^(const IntervalValue &lhs, const IntervalValue &rh
|
|
|
1031
1031
|
else if (lhs.is_numeral() && rhs.is_numeral())
|
|
1032
1032
|
return IntervalValue(lhs.lb() ^ rhs.lb());
|
|
1033
1033
|
else if (lhs.lb().getNumeral() >= 0 && !lhs.ub().is_infinity() &&
|
|
1034
|
-
|
|
1034
|
+
rhs.lb().getNumeral() >= 0 && !rhs.ub().is_infinity())
|
|
1035
1035
|
{
|
|
1036
1036
|
s64_t m = std::max(lhs.ub().getNumeral(), rhs.ub().getNumeral());
|
|
1037
1037
|
s64_t ub = next_power_of_2(s64_t(m)) - 1;
|
|
@@ -908,9 +908,9 @@ public:
|
|
|
908
908
|
static double safeAdd(double lhs, double rhs)
|
|
909
909
|
{
|
|
910
910
|
if ((lhs == std::numeric_limits<double>::infinity() &&
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
911
|
+
rhs == -std::numeric_limits<double>::infinity()) ||
|
|
912
|
+
(lhs == -std::numeric_limits<double>::infinity() &&
|
|
913
|
+
rhs == std::numeric_limits<double>::infinity()))
|
|
914
914
|
{
|
|
915
915
|
assert(false && "invalid add");
|
|
916
916
|
}
|
|
@@ -147,17 +147,17 @@ public:
|
|
|
147
147
|
template<typename Key, typename Value, typename Hash = SymbolHash,
|
|
148
148
|
typename KeyEqual = std::equal_to<Key>,
|
|
149
149
|
typename Allocator = std::allocator<std::pair<const Key, Value>>>
|
|
150
|
-
|
|
150
|
+
using SymbolMap = std::unordered_map<Key, Value, Hash, KeyEqual, Allocator>;
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
template <typename Key, typename Hash = SymbolVectorHash, typename KeyEqual = std::equal_to<Key>,
|
|
153
|
+
typename Allocator = std::allocator<Key>>
|
|
154
|
+
using SymbolSet = std::unordered_set<Key, Hash, KeyEqual, Allocator>;
|
|
155
155
|
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
typedef std::vector<Symbol> Production;
|
|
157
|
+
typedef SymbolSet<Production> Productions;
|
|
158
158
|
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
inline Map<std::string, Kind>& getNonterminals()
|
|
161
161
|
{
|
|
162
162
|
return this->nonterminals;
|
|
163
163
|
}
|
|
@@ -117,7 +117,8 @@ public:
|
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
/// AliasCFLGraphBuilder: a CFLGraphBuilder specialized for handling aliasing
|
|
120
|
-
class AliasCFLGraphBuilder :
|
|
120
|
+
class AliasCFLGraphBuilder :
|
|
121
|
+
public CFLGraphBuilder
|
|
121
122
|
{
|
|
122
123
|
public:
|
|
123
124
|
/// Builds a bidirectional CFL graph by copying nodes and edges from a const graph that inherits from GenericGraph
|
|
@@ -129,17 +130,18 @@ public:
|
|
|
129
130
|
|
|
130
131
|
private:
|
|
131
132
|
/// Connects VGep (Variable GEP)
|
|
132
|
-
void connectVGep(CFLGraph *cflGraph,
|
|
133
|
+
void connectVGep(CFLGraph *cflGraph, ConstraintGraph *graph, ConstraintNode *src, ConstraintNode *dst, u32_t level, SVFIR* pag);
|
|
133
134
|
|
|
134
135
|
/// Handles edges, with the exception of the GEP
|
|
135
|
-
void addBiCFLEdge(CFLGraph *cflGraph,
|
|
136
|
+
void addBiCFLEdge(CFLGraph *cflGraph, ConstraintNode* src, ConstraintNode* dst, CFGrammar::Kind label);
|
|
136
137
|
|
|
137
138
|
/// Adds bidirectional GEP edges with attributes
|
|
138
|
-
void addBiGepCFLEdge(CFLGraph *cflGraph,
|
|
139
|
+
void addBiGepCFLEdge(CFLGraph *cflGraph, ConstraintNode* src, ConstraintNode* dst, CFGrammar::Attribute attri);
|
|
139
140
|
};
|
|
140
141
|
|
|
141
142
|
/// VFCFLGraphBuilder: a CFLGraphBuilder specialized for handling value-flow
|
|
142
|
-
class VFCFLGraphBuilder :
|
|
143
|
+
class VFCFLGraphBuilder :
|
|
144
|
+
public CFLGraphBuilder
|
|
143
145
|
{
|
|
144
146
|
public:
|
|
145
147
|
/// Builds a bidirectional CFL graph by copying nodes and edges from a const graph that inherits from SVFG
|
|
@@ -151,13 +153,13 @@ public:
|
|
|
151
153
|
|
|
152
154
|
private:
|
|
153
155
|
/// Connects VGep (Variable GEP)
|
|
154
|
-
void connectVGep(CFLGraph *cflGraph,
|
|
156
|
+
void connectVGep(CFLGraph *cflGraph, ConstraintGraph *graph, ConstraintNode *src, ConstraintNode *dst, u32_t level, SVFIR* pag);
|
|
155
157
|
|
|
156
158
|
/// Handles edges, with the exception of the GEP
|
|
157
|
-
void addBiCFLEdge(CFLGraph *cflGraph,
|
|
159
|
+
void addBiCFLEdge(CFLGraph *cflGraph, ConstraintNode* src, ConstraintNode* dst, CFGrammar::Kind label);
|
|
158
160
|
|
|
159
161
|
/// Adds bidirectional GEP edges with attributes
|
|
160
|
-
void addBiGepCFLEdge(CFLGraph *cflGraph,
|
|
162
|
+
void addBiGepCFLEdge(CFLGraph *cflGraph, ConstraintNode* src, ConstraintNode* dst, CFGrammar::Attribute attri);
|
|
161
163
|
};
|
|
162
164
|
|
|
163
165
|
|
|
@@ -147,8 +147,8 @@ public:
|
|
|
147
147
|
static inline bool classof(const GenericCallGraphEdgeTy *edge)
|
|
148
148
|
{
|
|
149
149
|
return edge->getEdgeKind() == CallGraphEdge::CallRetEdge ||
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
edge->getEdgeKind() == CallGraphEdge::TDForkEdge ||
|
|
151
|
+
edge->getEdgeKind() == CallGraphEdge::TDJoinEdge;
|
|
152
152
|
}
|
|
153
153
|
//@}
|
|
154
154
|
|
|
@@ -420,14 +420,14 @@ public:
|
|
|
420
420
|
{
|
|
421
421
|
CallInstToCallGraphEdgesMap::const_iterator it = callinstToCallGraphEdgesMap.find(inst);
|
|
422
422
|
assert(it!=callinstToCallGraphEdgesMap.end()
|
|
423
|
-
|
|
423
|
+
&& "call instruction does not have a valid callee");
|
|
424
424
|
return it->second.begin();
|
|
425
425
|
}
|
|
426
426
|
inline CallGraphEdgeSet::const_iterator getCallEdgeEnd(const CallICFGNode* inst) const
|
|
427
427
|
{
|
|
428
428
|
CallInstToCallGraphEdgesMap::const_iterator it = callinstToCallGraphEdgesMap.find(inst);
|
|
429
429
|
assert(it!=callinstToCallGraphEdgesMap.end()
|
|
430
|
-
|
|
430
|
+
&& "call instruction does not have a valid callee");
|
|
431
431
|
return it->second.end();
|
|
432
432
|
}
|
|
433
433
|
//@}
|
|
@@ -131,7 +131,7 @@ public:
|
|
|
131
131
|
{
|
|
132
132
|
ConstraintEdge edge(src,dst,kind);
|
|
133
133
|
if(kind == ConstraintEdge::Copy ||
|
|
134
|
-
|
|
134
|
+
kind == ConstraintEdge::NormalGep || kind == ConstraintEdge::VariantGep)
|
|
135
135
|
return directEdgeSet.find(&edge) != directEdgeSet.end();
|
|
136
136
|
else if(kind == ConstraintEdge::Addr)
|
|
137
137
|
return AddrCGEdgeSet.find(&edge) != AddrCGEdgeSet.end();
|
|
@@ -75,11 +75,11 @@ public:
|
|
|
75
75
|
static inline bool classof(const GenericConsEdgeTy *edge)
|
|
76
76
|
{
|
|
77
77
|
return edge->getEdgeKind() == Addr ||
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
edge->getEdgeKind() == Copy ||
|
|
79
|
+
edge->getEdgeKind() == Store ||
|
|
80
|
+
edge->getEdgeKind() == Load ||
|
|
81
|
+
edge->getEdgeKind() == NormalGep ||
|
|
82
|
+
edge->getEdgeKind() == VariantGep;
|
|
83
83
|
}
|
|
84
84
|
/// Constraint edge type
|
|
85
85
|
typedef GenericNode<ConstraintNode, ConstraintEdge>::GEdgeSetTy ConstraintEdgeSetTy;
|
|
@@ -248,12 +248,12 @@ public:
|
|
|
248
248
|
static inline bool classof(const ConstraintEdge *edge)
|
|
249
249
|
{
|
|
250
250
|
return edge->getEdgeKind() == NormalGep ||
|
|
251
|
-
|
|
251
|
+
edge->getEdgeKind() == VariantGep;
|
|
252
252
|
}
|
|
253
253
|
static inline bool classof(const GenericConsEdgeTy *edge)
|
|
254
254
|
{
|
|
255
255
|
return edge->getEdgeKind() == NormalGep ||
|
|
256
|
-
|
|
256
|
+
edge->getEdgeKind() == VariantGep;
|
|
257
257
|
}
|
|
258
258
|
//@}
|
|
259
259
|
|
|
@@ -123,8 +123,8 @@ public:
|
|
|
123
123
|
virtual inline bool operator==(const GenericEdge<NodeType>* rhs) const
|
|
124
124
|
{
|
|
125
125
|
return (rhs->edgeFlag == this->edgeFlag &&
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
rhs->getSrcID() == this->getSrcID() &&
|
|
127
|
+
rhs->getDstID() == this->getDstID());
|
|
128
128
|
}
|
|
129
129
|
//@}
|
|
130
130
|
|
|
@@ -668,8 +668,8 @@ public:
|
|
|
668
668
|
inline void removeGNode(NodeType* node)
|
|
669
669
|
{
|
|
670
670
|
assert(node->hasIncomingEdge() == false
|
|
671
|
-
|
|
672
|
-
|
|
671
|
+
&& node->hasOutgoingEdge() == false
|
|
672
|
+
&& "node which have edges can't be deleted");
|
|
673
673
|
iterator it = IDToNodeMap.find(node->getId());
|
|
674
674
|
assert(it != IDToNodeMap.end() && "can not find the node");
|
|
675
675
|
IDToNodeMap.erase(it);
|
|
@@ -172,6 +172,49 @@ protected:
|
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
virtual inline IntraICFGNode* addIntraICFGNode(const SVFBasicBlock* bb, bool isRet)
|
|
176
|
+
{
|
|
177
|
+
IntraICFGNode* intraIcfgNode =
|
|
178
|
+
new IntraICFGNode(totalICFGNode++, bb, isRet);
|
|
179
|
+
addICFGNode(intraIcfgNode);
|
|
180
|
+
return intraIcfgNode;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
virtual inline CallICFGNode* addCallICFGNode(
|
|
184
|
+
const SVFBasicBlock* bb, const SVFType* ty,
|
|
185
|
+
const SVFFunction* calledFunc, bool isVararg, bool isvcall,
|
|
186
|
+
s32_t vcallIdx, const std::string& funNameOfVcall)
|
|
187
|
+
{
|
|
188
|
+
|
|
189
|
+
CallICFGNode* callICFGNode =
|
|
190
|
+
new CallICFGNode(totalICFGNode++, bb, ty, calledFunc, isVararg,
|
|
191
|
+
isvcall, vcallIdx, funNameOfVcall);
|
|
192
|
+
addICFGNode(callICFGNode);
|
|
193
|
+
return callICFGNode;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
virtual inline RetICFGNode* addRetICFGNode(CallICFGNode* call)
|
|
197
|
+
{
|
|
198
|
+
RetICFGNode* retICFGNode = new RetICFGNode(totalICFGNode++, call);
|
|
199
|
+
call->setRetICFGNode(retICFGNode);
|
|
200
|
+
addICFGNode(retICFGNode);
|
|
201
|
+
return retICFGNode;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
virtual inline FunEntryICFGNode* addFunEntryICFGNode(const SVFFunction* svfFunc)
|
|
205
|
+
{
|
|
206
|
+
FunEntryICFGNode* sNode = new FunEntryICFGNode(totalICFGNode++,svfFunc);
|
|
207
|
+
addICFGNode(sNode);
|
|
208
|
+
return FunToFunEntryNodeMap[svfFunc] = sNode;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
virtual inline FunExitICFGNode* addFunExitICFGNode(const SVFFunction* svfFunc)
|
|
212
|
+
{
|
|
213
|
+
FunExitICFGNode* sNode = new FunExitICFGNode(totalICFGNode++, svfFunc);
|
|
214
|
+
addICFGNode(sNode);
|
|
215
|
+
return FunToFunExitNodeMap[svfFunc] = sNode;
|
|
216
|
+
}
|
|
217
|
+
|
|
175
218
|
/// Add a ICFG node
|
|
176
219
|
virtual inline void addICFGNode(ICFGNode* node)
|
|
177
220
|
{
|