svf-tools 1.0.994 → 1.0.995
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/package.json +1 -1
- package/svf/include/Graphs/CDG.h +18 -1
- package/svf/include/Graphs/CFLGraph.h +19 -1
- package/svf/include/Graphs/CHG.h +19 -1
- package/svf/include/Graphs/CallGraph.h +19 -1
- package/svf/include/Graphs/ConsGNode.h +19 -1
- package/svf/include/Graphs/GenericGraph.h +243 -17
- package/svf/include/Graphs/ICFG.h +0 -96
- package/svf/include/Graphs/ICFGNode.h +55 -22
- package/svf/include/Graphs/SVFG.h +2 -2
- package/svf/include/Graphs/SVFGNode.h +5 -17
- package/svf/include/Graphs/SVFGOPT.h +2 -1
- package/svf/include/Graphs/VFG.h +2 -2
- package/svf/include/Graphs/VFGNode.h +99 -26
- package/svf/include/MTA/TCT.h +19 -1
- package/svf/include/SABER/SaberCondAllocator.h +2 -2
- package/svf/include/SVFIR/SVFFileSystem.h +1 -1
- package/svf/include/SVFIR/SVFIR.h +2 -2
- package/svf/include/SVFIR/SVFVariables.h +68 -38
- package/svf/include/SVFIR/SymbolTableInfo.h +11 -1
- package/svf/include/WPA/Andersen.h +1 -1
- package/svf/lib/AE/Svfexe/AEDetector.cpp +4 -2
- package/svf/lib/AE/Svfexe/AbsExtAPI.cpp +10 -12
- package/svf/lib/AE/Svfexe/AbstractInterpretation.cpp +2 -0
- package/svf/lib/DDA/ContextDDA.cpp +12 -8
- package/svf/lib/Graphs/ICFG.cpp +9 -93
- package/svf/lib/Graphs/SVFG.cpp +1 -1
- package/svf/lib/Graphs/VFG.cpp +2 -4
- package/svf/lib/MSSA/MemRegion.cpp +2 -2
- package/svf/lib/SABER/LeakChecker.cpp +1 -2
- package/svf/lib/SABER/SaberCondAllocator.cpp +13 -16
- package/svf/lib/SABER/SaberSVFGBuilder.cpp +2 -2
- package/svf/lib/SVFIR/SVFFileSystem.cpp +0 -6
- package/svf/lib/SVFIR/SVFVariables.cpp +3 -0
- package/svf/lib/SVFIR/SymbolTableInfo.cpp +3 -2
- package/svf-llvm/include/SVF-LLVM/DCHG.h +1 -1
- package/svf-llvm/include/SVF-LLVM/ICFGBuilder.h +93 -23
- package/svf-llvm/include/SVF-LLVM/LLVMModule.h +84 -0
- package/svf-llvm/include/SVF-LLVM/LLVMUtil.h +15 -0
- package/svf-llvm/include/SVF-LLVM/SVFIRBuilder.h +19 -12
- package/svf-llvm/lib/ICFGBuilder.cpp +125 -54
- package/svf-llvm/lib/LLVMLoopAnalysis.cpp +6 -11
- package/svf-llvm/lib/LLVMModule.cpp +54 -0
- package/svf-llvm/lib/LLVMUtil.cpp +15 -0
- package/svf-llvm/lib/SVFIRBuilder.cpp +92 -76
- package/svf-llvm/lib/SVFIRExtAPI.cpp +2 -2
- package/svf-llvm/lib/SymbolTableBuilder.cpp +4 -4
|
@@ -57,17 +57,6 @@ class ICFGNode : public GenericICFGNodeTy
|
|
|
57
57
|
friend class SVFIRReader;
|
|
58
58
|
|
|
59
59
|
public:
|
|
60
|
-
/// 22 kinds of ICFG node
|
|
61
|
-
/// Gep represents offset edge for field sensitivity
|
|
62
|
-
enum ICFGNodeK
|
|
63
|
-
{
|
|
64
|
-
IntraBlock,
|
|
65
|
-
FunEntryBlock,
|
|
66
|
-
FunExitBlock,
|
|
67
|
-
FunCallBlock,
|
|
68
|
-
FunRetBlock,
|
|
69
|
-
GlobalBlock
|
|
70
|
-
};
|
|
71
60
|
|
|
72
61
|
typedef ICFGEdge::ICFGEdgeSetTy::iterator iterator;
|
|
73
62
|
typedef ICFGEdge::ICFGEdgeSetTy::const_iterator const_iterator;
|
|
@@ -75,10 +64,11 @@ public:
|
|
|
75
64
|
typedef Set<const RetPE *> RetPESet;
|
|
76
65
|
typedef std::list<const VFGNode*> VFGNodeList;
|
|
77
66
|
typedef std::list<const SVFStmt*> SVFStmtList;
|
|
67
|
+
typedef GNodeK ICFGNodeK;
|
|
78
68
|
|
|
79
69
|
public:
|
|
80
70
|
/// Constructor
|
|
81
|
-
ICFGNode(NodeID i,
|
|
71
|
+
ICFGNode(NodeID i, GNodeK k) : GenericICFGNodeTy(i, k), fun(nullptr), bb(nullptr)
|
|
82
72
|
{
|
|
83
73
|
}
|
|
84
74
|
|
|
@@ -136,6 +126,22 @@ public:
|
|
|
136
126
|
|
|
137
127
|
void dump() const;
|
|
138
128
|
|
|
129
|
+
|
|
130
|
+
static inline bool classof(const ICFGNode *)
|
|
131
|
+
{
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
static inline bool classof(const GenericICFGNodeTy* node)
|
|
136
|
+
{
|
|
137
|
+
return isICFGNodeKinds(node->getNodeKind());
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
static inline bool classof(const SVFBaseNode* node)
|
|
141
|
+
{
|
|
142
|
+
return isICFGNodeKinds(node->getNodeKind());
|
|
143
|
+
}
|
|
144
|
+
|
|
139
145
|
protected:
|
|
140
146
|
const SVFFunction* fun;
|
|
141
147
|
const SVFBasicBlock* bb;
|
|
@@ -248,26 +254,28 @@ public:
|
|
|
248
254
|
return true;
|
|
249
255
|
}
|
|
250
256
|
|
|
251
|
-
static inline bool classof(const ICFGNode
|
|
257
|
+
static inline bool classof(const ICFGNode* node)
|
|
252
258
|
{
|
|
253
|
-
return node->getNodeKind()
|
|
254
|
-
|| node->getNodeKind() == FunExitBlock
|
|
255
|
-
|| node->getNodeKind() == FunCallBlock
|
|
256
|
-
|| node->getNodeKind() == FunRetBlock;
|
|
259
|
+
return isInterICFGNodeKind(node->getNodeKind());
|
|
257
260
|
}
|
|
258
261
|
|
|
259
|
-
static inline bool classof(const GenericICFGNodeTy
|
|
262
|
+
static inline bool classof(const GenericICFGNodeTy* node)
|
|
260
263
|
{
|
|
261
|
-
return node->getNodeKind()
|
|
262
|
-
|| node->getNodeKind() == FunExitBlock
|
|
263
|
-
|| node->getNodeKind() == FunCallBlock
|
|
264
|
-
|| node->getNodeKind() == FunRetBlock;
|
|
264
|
+
return isInterICFGNodeKind(node->getNodeKind());
|
|
265
265
|
}
|
|
266
|
+
|
|
267
|
+
static inline bool classof(const SVFBaseNode* node)
|
|
268
|
+
{
|
|
269
|
+
return isInterICFGNodeKind(node->getNodeKind());
|
|
270
|
+
}
|
|
271
|
+
|
|
266
272
|
//@}
|
|
267
273
|
virtual const std::string getSourceLoc() const = 0;
|
|
268
274
|
};
|
|
269
275
|
|
|
270
276
|
|
|
277
|
+
|
|
278
|
+
|
|
271
279
|
/*!
|
|
272
280
|
* Function entry ICFGNode containing a set of FormalParmVFGNodes of a function
|
|
273
281
|
*/
|
|
@@ -326,6 +334,11 @@ public:
|
|
|
326
334
|
{
|
|
327
335
|
return node->getNodeKind() == FunEntryBlock;
|
|
328
336
|
}
|
|
337
|
+
|
|
338
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
339
|
+
{
|
|
340
|
+
return node->getNodeKind() == FunEntryBlock;
|
|
341
|
+
}
|
|
329
342
|
//@}
|
|
330
343
|
|
|
331
344
|
const virtual std::string toString() const;
|
|
@@ -392,6 +405,11 @@ public:
|
|
|
392
405
|
{
|
|
393
406
|
return node->getNodeKind() == FunExitBlock;
|
|
394
407
|
}
|
|
408
|
+
|
|
409
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
410
|
+
{
|
|
411
|
+
return node->getNodeKind() == FunExitBlock;
|
|
412
|
+
}
|
|
395
413
|
//@}
|
|
396
414
|
|
|
397
415
|
virtual const std::string toString() const;
|
|
@@ -482,6 +500,12 @@ public:
|
|
|
482
500
|
{
|
|
483
501
|
return SVFUtil::cast<SVFCallInst>(cs)->getArgOperand(ArgNo);
|
|
484
502
|
}
|
|
503
|
+
|
|
504
|
+
const SVFVar* getArgumentVar(u32_t ArgNo) const
|
|
505
|
+
{
|
|
506
|
+
return getActualParms()[ArgNo];
|
|
507
|
+
}
|
|
508
|
+
|
|
485
509
|
const SVFType* getType() const
|
|
486
510
|
{
|
|
487
511
|
return SVFUtil::cast<SVFCallInst>(cs)->getType();
|
|
@@ -556,6 +580,11 @@ public:
|
|
|
556
580
|
{
|
|
557
581
|
return node->getNodeKind() == FunCallBlock;
|
|
558
582
|
}
|
|
583
|
+
|
|
584
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
585
|
+
{
|
|
586
|
+
return node->getNodeKind() == FunCallBlock;
|
|
587
|
+
}
|
|
559
588
|
//@}
|
|
560
589
|
|
|
561
590
|
virtual const std::string toString() const;
|
|
@@ -637,6 +666,10 @@ public:
|
|
|
637
666
|
{
|
|
638
667
|
return node->getNodeKind() == FunRetBlock;
|
|
639
668
|
}
|
|
669
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
670
|
+
{
|
|
671
|
+
return node->getNodeKind() == FunRetBlock;
|
|
672
|
+
}
|
|
640
673
|
//@}
|
|
641
674
|
|
|
642
675
|
virtual const std::string toString() const;
|
|
@@ -420,7 +420,7 @@ protected:
|
|
|
420
420
|
inline void addActualINSVFGNode(const CallICFGNode* callsite, const MRVer* ver, const NodeID nodeId)
|
|
421
421
|
{
|
|
422
422
|
ActualINSVFGNode* sNode = new ActualINSVFGNode(nodeId, callsite, ver);
|
|
423
|
-
addSVFGNode(sNode,
|
|
423
|
+
addSVFGNode(sNode, const_cast<CallICFGNode*>(callsite));
|
|
424
424
|
callSiteToActualINMap[callsite].set(sNode->getId());
|
|
425
425
|
}
|
|
426
426
|
|
|
@@ -428,7 +428,7 @@ protected:
|
|
|
428
428
|
inline void addActualOUTSVFGNode(const CallICFGNode* callsite, const MRVer* resVer, const NodeID nodeId)
|
|
429
429
|
{
|
|
430
430
|
ActualOUTSVFGNode* sNode = new ActualOUTSVFGNode(nodeId, callsite, resVer);
|
|
431
|
-
addSVFGNode(sNode,
|
|
431
|
+
addSVFGNode(sNode,const_cast<RetICFGNode*>(callsite->getRetICFGNode()));
|
|
432
432
|
setDef(resVer,sNode);
|
|
433
433
|
callSiteToActualOUTMap[callsite].set(sNode->getId());
|
|
434
434
|
}
|
|
@@ -64,23 +64,11 @@ public:
|
|
|
64
64
|
}
|
|
65
65
|
static inline bool classof(const VFGNode *node)
|
|
66
66
|
{
|
|
67
|
-
return node->getNodeKind()
|
|
68
|
-
node->getNodeKind() == FPOUT ||
|
|
69
|
-
node->getNodeKind() == APIN ||
|
|
70
|
-
node->getNodeKind() == APOUT ||
|
|
71
|
-
node->getNodeKind() == MPhi ||
|
|
72
|
-
node->getNodeKind() == MIntraPhi ||
|
|
73
|
-
node->getNodeKind() == MInterPhi;
|
|
67
|
+
return isMRSVFGNodeKinds(node->getNodeKind());
|
|
74
68
|
}
|
|
75
69
|
static inline bool classof(const GenericVFGNodeTy *node)
|
|
76
70
|
{
|
|
77
|
-
return node->getNodeKind()
|
|
78
|
-
node->getNodeKind() == FPOUT ||
|
|
79
|
-
node->getNodeKind() == APIN ||
|
|
80
|
-
node->getNodeKind() == APOUT ||
|
|
81
|
-
node->getNodeKind() == MPhi ||
|
|
82
|
-
node->getNodeKind() == MIntraPhi ||
|
|
83
|
-
node->getNodeKind() == MInterPhi;
|
|
71
|
+
return isMRSVFGNodeKinds(node->getNodeKind());
|
|
84
72
|
}
|
|
85
73
|
//@}
|
|
86
74
|
|
|
@@ -328,15 +316,15 @@ public:
|
|
|
328
316
|
}
|
|
329
317
|
static inline bool classof(const MRSVFGNode *node)
|
|
330
318
|
{
|
|
331
|
-
return (node->getNodeKind()
|
|
319
|
+
return isMSSAPHISVFGNodeKinds(node->getNodeKind());
|
|
332
320
|
}
|
|
333
321
|
static inline bool classof(const VFGNode *node)
|
|
334
322
|
{
|
|
335
|
-
return (node->getNodeKind()
|
|
323
|
+
return isMSSAPHISVFGNodeKinds(node->getNodeKind());
|
|
336
324
|
}
|
|
337
325
|
static inline bool classof(const GenericVFGNodeTy *node)
|
|
338
326
|
{
|
|
339
|
-
return (node->getNodeKind()
|
|
327
|
+
return isMSSAPHISVFGNodeKinds(node->getNodeKind());
|
|
340
328
|
}
|
|
341
329
|
//@}
|
|
342
330
|
|
|
@@ -252,7 +252,8 @@ private:
|
|
|
252
252
|
inline InterPHISVFGNode* addInterPHIForAR(const ActualRetSVFGNode* ar)
|
|
253
253
|
{
|
|
254
254
|
InterPHISVFGNode* sNode = new InterPHISVFGNode(totalVFGNode++,ar);
|
|
255
|
-
addSVFGNode(sNode,
|
|
255
|
+
addSVFGNode(sNode, const_cast<RetICFGNode*>(
|
|
256
|
+
ar->getCallSite()->getRetICFGNode()));
|
|
256
257
|
resetDef(ar->getRev(),sNode);
|
|
257
258
|
return sNode;
|
|
258
259
|
}
|
package/svf/include/Graphs/VFG.h
CHANGED
|
@@ -530,7 +530,7 @@ protected:
|
|
|
530
530
|
inline void addActualParmVFGNode(const PAGNode* aparm, const CallICFGNode* cs)
|
|
531
531
|
{
|
|
532
532
|
ActualParmVFGNode* sNode = new ActualParmVFGNode(totalVFGNode++,aparm,cs);
|
|
533
|
-
addVFGNode(sNode,
|
|
533
|
+
addVFGNode(sNode, const_cast<CallICFGNode*>(cs));
|
|
534
534
|
PAGNodeToActualParmMap[std::make_pair(aparm->getId(),cs)] = sNode;
|
|
535
535
|
/// do not set def here, this node is not a variable definition
|
|
536
536
|
}
|
|
@@ -571,7 +571,7 @@ protected:
|
|
|
571
571
|
inline void addActualRetVFGNode(const PAGNode* ret,const CallICFGNode* cs)
|
|
572
572
|
{
|
|
573
573
|
ActualRetVFGNode* sNode = new ActualRetVFGNode(totalVFGNode++,ret,cs);
|
|
574
|
-
addVFGNode(sNode,
|
|
574
|
+
addVFGNode(sNode, const_cast<RetICFGNode*>(cs->getRetICFGNode()));
|
|
575
575
|
setDef(ret,sNode);
|
|
576
576
|
PAGNodeToActualRetMap[ret] = sNode;
|
|
577
577
|
}
|
|
@@ -49,12 +49,7 @@ class VFGNode : public GenericVFGNodeTy
|
|
|
49
49
|
public:
|
|
50
50
|
/// 25 kinds of ICFG node
|
|
51
51
|
/// Gep represents offset edge for field sensitivity
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
Addr, Copy, Gep, Store, Load, Cmp, BinaryOp, UnaryOp, Branch, TPhi, TIntraPhi, TInterPhi,
|
|
55
|
-
MPhi, MIntraPhi, MInterPhi, FRet, ARet, AParm, FParm,
|
|
56
|
-
APIN, APOUT, FPIN, FPOUT, NPtr, DummyVProp
|
|
57
|
-
};
|
|
52
|
+
typedef GNodeK VFGNodeK;
|
|
58
53
|
|
|
59
54
|
typedef VFGEdge::VFGEdgeSetTy::iterator iterator;
|
|
60
55
|
typedef VFGEdge::VFGEdgeSetTy::const_iterator const_iterator;
|
|
@@ -106,6 +101,22 @@ public:
|
|
|
106
101
|
|
|
107
102
|
virtual const std::string toString() const;
|
|
108
103
|
|
|
104
|
+
static inline bool classof(const VFGNode *)
|
|
105
|
+
{
|
|
106
|
+
return true;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
static inline bool classof(const GenericVFGNodeTy * node)
|
|
110
|
+
{
|
|
111
|
+
return isVFGNodeKinds(node->getNodeKind());
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
static inline bool classof(const SVFBaseNode* node)
|
|
116
|
+
{
|
|
117
|
+
return isVFGNodeKinds(node->getNodeKind());
|
|
118
|
+
}
|
|
119
|
+
|
|
109
120
|
protected:
|
|
110
121
|
const ICFGNode* icfgNode;
|
|
111
122
|
};
|
|
@@ -167,19 +178,15 @@ public:
|
|
|
167
178
|
}
|
|
168
179
|
static inline bool classof(const VFGNode *node)
|
|
169
180
|
{
|
|
170
|
-
return node->getNodeKind()
|
|
171
|
-
|| node->getNodeKind() == Copy
|
|
172
|
-
|| node->getNodeKind() == Gep
|
|
173
|
-
|| node->getNodeKind() == Store
|
|
174
|
-
|| node->getNodeKind() == Load;
|
|
181
|
+
return isStmtVFGNodeKinds(node->getNodeKind());
|
|
175
182
|
}
|
|
176
183
|
static inline bool classof(const GenericVFGNodeTy *node)
|
|
177
184
|
{
|
|
178
|
-
return node->getNodeKind()
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
return isStmtVFGNodeKinds(node->getNodeKind());
|
|
186
|
+
}
|
|
187
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
188
|
+
{
|
|
189
|
+
return isStmtVFGNodeKinds(node->getNodeKind());
|
|
183
190
|
}
|
|
184
191
|
//@}
|
|
185
192
|
|
|
@@ -221,6 +228,10 @@ public:
|
|
|
221
228
|
{
|
|
222
229
|
return node->getNodeKind() == Load;
|
|
223
230
|
}
|
|
231
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
232
|
+
{
|
|
233
|
+
return node->getNodeKind() == Load;
|
|
234
|
+
}
|
|
224
235
|
//@}
|
|
225
236
|
|
|
226
237
|
const NodeBS getDefSVFVars() const override;
|
|
@@ -262,6 +273,10 @@ public:
|
|
|
262
273
|
{
|
|
263
274
|
return node->getNodeKind() == Store;
|
|
264
275
|
}
|
|
276
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
277
|
+
{
|
|
278
|
+
return node->getNodeKind() == Store;
|
|
279
|
+
}
|
|
265
280
|
//@}
|
|
266
281
|
|
|
267
282
|
const NodeBS getDefSVFVars() const override;
|
|
@@ -303,6 +318,10 @@ public:
|
|
|
303
318
|
{
|
|
304
319
|
return node->getNodeKind() == Copy;
|
|
305
320
|
}
|
|
321
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
322
|
+
{
|
|
323
|
+
return node->getNodeKind() == Copy;
|
|
324
|
+
}
|
|
306
325
|
//@}
|
|
307
326
|
|
|
308
327
|
const NodeBS getDefSVFVars() const override;
|
|
@@ -345,6 +364,10 @@ public:
|
|
|
345
364
|
{
|
|
346
365
|
return node->getNodeKind() == Cmp;
|
|
347
366
|
}
|
|
367
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
368
|
+
{
|
|
369
|
+
return node->getNodeKind() == Cmp;
|
|
370
|
+
}
|
|
348
371
|
//@}
|
|
349
372
|
/// Operands at a BinaryNode
|
|
350
373
|
//@{
|
|
@@ -416,6 +439,10 @@ public:
|
|
|
416
439
|
{
|
|
417
440
|
return node->getNodeKind() == BinaryOp;
|
|
418
441
|
}
|
|
442
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
443
|
+
{
|
|
444
|
+
return node->getNodeKind() == BinaryOp;
|
|
445
|
+
}
|
|
419
446
|
//@}
|
|
420
447
|
/// Operands at a BinaryNode
|
|
421
448
|
//@{
|
|
@@ -486,6 +513,10 @@ public:
|
|
|
486
513
|
{
|
|
487
514
|
return node->getNodeKind() == UnaryOp;
|
|
488
515
|
}
|
|
516
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
517
|
+
{
|
|
518
|
+
return node->getNodeKind() == UnaryOp;
|
|
519
|
+
}
|
|
489
520
|
//@}
|
|
490
521
|
/// Operands at a UnaryNode
|
|
491
522
|
//@{
|
|
@@ -554,6 +585,10 @@ public:
|
|
|
554
585
|
{
|
|
555
586
|
return node->getNodeKind() == Branch;
|
|
556
587
|
}
|
|
588
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
589
|
+
{
|
|
590
|
+
return node->getNodeKind() == Branch;
|
|
591
|
+
}
|
|
557
592
|
//@}
|
|
558
593
|
|
|
559
594
|
/// Return the branch statement
|
|
@@ -616,6 +651,10 @@ public:
|
|
|
616
651
|
{
|
|
617
652
|
return node->getNodeKind() == Gep;
|
|
618
653
|
}
|
|
654
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
655
|
+
{
|
|
656
|
+
return node->getNodeKind() == Gep;
|
|
657
|
+
}
|
|
619
658
|
//@}
|
|
620
659
|
|
|
621
660
|
const NodeBS getDefSVFVars() const override;
|
|
@@ -683,11 +722,15 @@ public:
|
|
|
683
722
|
}
|
|
684
723
|
static inline bool classof(const VFGNode *node)
|
|
685
724
|
{
|
|
686
|
-
return (node->getNodeKind()
|
|
725
|
+
return isPHIVFGNodeKinds(node->getNodeKind());
|
|
687
726
|
}
|
|
688
727
|
static inline bool classof(const GenericVFGNodeTy *node)
|
|
689
728
|
{
|
|
690
|
-
return (node->getNodeKind()
|
|
729
|
+
return isPHIVFGNodeKinds(node->getNodeKind());
|
|
730
|
+
}
|
|
731
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
732
|
+
{
|
|
733
|
+
return isPHIVFGNodeKinds(node->getNodeKind());
|
|
691
734
|
}
|
|
692
735
|
//@}
|
|
693
736
|
|
|
@@ -745,6 +788,10 @@ public:
|
|
|
745
788
|
{
|
|
746
789
|
return node->getNodeKind() == TIntraPhi;
|
|
747
790
|
}
|
|
791
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
792
|
+
{
|
|
793
|
+
return node->getNodeKind() == TIntraPhi;
|
|
794
|
+
}
|
|
748
795
|
//@}
|
|
749
796
|
|
|
750
797
|
const std::string toString() const override;
|
|
@@ -782,6 +829,10 @@ public:
|
|
|
782
829
|
{
|
|
783
830
|
return node->getNodeKind() == Addr;
|
|
784
831
|
}
|
|
832
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
833
|
+
{
|
|
834
|
+
return node->getNodeKind() == Addr;
|
|
835
|
+
}
|
|
785
836
|
//@}
|
|
786
837
|
|
|
787
838
|
const NodeBS getDefSVFVars() const override;
|
|
@@ -816,17 +867,15 @@ public:
|
|
|
816
867
|
}
|
|
817
868
|
static inline bool classof(const VFGNode *node)
|
|
818
869
|
{
|
|
819
|
-
return node->getNodeKind()
|
|
820
|
-
|| node->getNodeKind() == ARet
|
|
821
|
-
|| node->getNodeKind() == AParm
|
|
822
|
-
|| node->getNodeKind() == FParm;
|
|
870
|
+
return isArgumentVFGNodeKinds(node->getNodeKind());
|
|
823
871
|
}
|
|
824
872
|
static inline bool classof(const GenericVFGNodeTy *node)
|
|
825
873
|
{
|
|
826
|
-
return node->getNodeKind()
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
874
|
+
return isArgumentVFGNodeKinds(node->getNodeKind());
|
|
875
|
+
}
|
|
876
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
877
|
+
{
|
|
878
|
+
return isArgumentVFGNodeKinds(node->getNodeKind());
|
|
830
879
|
}
|
|
831
880
|
//@}
|
|
832
881
|
|
|
@@ -878,6 +927,10 @@ public:
|
|
|
878
927
|
{
|
|
879
928
|
return node->getNodeKind() == AParm;
|
|
880
929
|
}
|
|
930
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
931
|
+
{
|
|
932
|
+
return node->getNodeKind() == AParm;
|
|
933
|
+
}
|
|
881
934
|
//@}
|
|
882
935
|
|
|
883
936
|
const NodeBS getDefSVFVars() const override;
|
|
@@ -948,6 +1001,10 @@ public:
|
|
|
948
1001
|
{
|
|
949
1002
|
return node->getNodeKind() == FParm;
|
|
950
1003
|
}
|
|
1004
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
1005
|
+
{
|
|
1006
|
+
return node->getNodeKind() == FParm;
|
|
1007
|
+
}
|
|
951
1008
|
//@}
|
|
952
1009
|
|
|
953
1010
|
const NodeBS getDefSVFVars() const override;
|
|
@@ -1006,6 +1063,10 @@ public:
|
|
|
1006
1063
|
{
|
|
1007
1064
|
return node->getNodeKind() == ARet;
|
|
1008
1065
|
}
|
|
1066
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
1067
|
+
{
|
|
1068
|
+
return node->getNodeKind() == ARet;
|
|
1069
|
+
}
|
|
1009
1070
|
//@}
|
|
1010
1071
|
|
|
1011
1072
|
const NodeBS getDefSVFVars() const override;
|
|
@@ -1072,6 +1133,10 @@ public:
|
|
|
1072
1133
|
{
|
|
1073
1134
|
return node->getNodeKind() == FRet;
|
|
1074
1135
|
}
|
|
1136
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
1137
|
+
{
|
|
1138
|
+
return node->getNodeKind() == FRet;
|
|
1139
|
+
}
|
|
1075
1140
|
//@}
|
|
1076
1141
|
|
|
1077
1142
|
const NodeBS getDefSVFVars() const override;
|
|
@@ -1131,6 +1196,10 @@ public:
|
|
|
1131
1196
|
{
|
|
1132
1197
|
return node->getNodeKind() == TInterPhi;
|
|
1133
1198
|
}
|
|
1199
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
1200
|
+
{
|
|
1201
|
+
return node->getNodeKind() == TInterPhi;
|
|
1202
|
+
}
|
|
1134
1203
|
//@}
|
|
1135
1204
|
|
|
1136
1205
|
const std::string toString() const override;
|
|
@@ -1179,6 +1248,10 @@ public:
|
|
|
1179
1248
|
{
|
|
1180
1249
|
return node->getNodeKind() == NPtr;
|
|
1181
1250
|
}
|
|
1251
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
1252
|
+
{
|
|
1253
|
+
return node->getNodeKind() == NPtr;
|
|
1254
|
+
}
|
|
1182
1255
|
//@}
|
|
1183
1256
|
|
|
1184
1257
|
const NodeBS getDefSVFVars() const override;
|
package/svf/include/MTA/TCT.h
CHANGED
|
@@ -88,7 +88,7 @@ class TCTNode: public GenericTCTNodeTy
|
|
|
88
88
|
public:
|
|
89
89
|
/// Constructor
|
|
90
90
|
TCTNode(NodeID i, const CxtThread& cctx) :
|
|
91
|
-
GenericTCTNodeTy(i,
|
|
91
|
+
GenericTCTNodeTy(i, TCTNodeKd), ctx(cctx), multiforked(false)
|
|
92
92
|
{
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -123,6 +123,24 @@ public:
|
|
|
123
123
|
}
|
|
124
124
|
//@}
|
|
125
125
|
|
|
126
|
+
///Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
127
|
+
//@{
|
|
128
|
+
static inline bool classof(const TCTNode *)
|
|
129
|
+
{
|
|
130
|
+
return true;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
static inline bool classof(const GenericTCTNodeTy *node)
|
|
134
|
+
{
|
|
135
|
+
return node->getNodeKind() == TCTNodeKd;
|
|
136
|
+
}
|
|
137
|
+
static inline bool classof(const SVFBaseNode*node)
|
|
138
|
+
{
|
|
139
|
+
return node->getNodeKind() == TCTNodeKd;
|
|
140
|
+
}
|
|
141
|
+
//@}
|
|
142
|
+
|
|
143
|
+
|
|
126
144
|
private:
|
|
127
145
|
const CxtThread ctx;
|
|
128
146
|
bool multiforked;
|
|
@@ -282,9 +282,9 @@ private:
|
|
|
282
282
|
/// Return true if the predicate of this compare instruction is not equal
|
|
283
283
|
bool isNECmp(const CmpStmt* cmp) const;
|
|
284
284
|
/// Return true if this is a test null expression
|
|
285
|
-
bool isTestNullExpr(const
|
|
285
|
+
bool isTestNullExpr(const ICFGNode* test) const;
|
|
286
286
|
/// Return true if this is a test not null expression
|
|
287
|
-
bool isTestNotNullExpr(const
|
|
287
|
+
bool isTestNotNullExpr(const ICFGNode* test) const;
|
|
288
288
|
/// Return true if two values on the predicate are what we want
|
|
289
289
|
bool isTestContainsNullAndTheValue(const CmpStmt* cmp) const;
|
|
290
290
|
//@}
|
|
@@ -1064,7 +1064,7 @@ public:
|
|
|
1064
1064
|
}
|
|
1065
1065
|
|
|
1066
1066
|
private:
|
|
1067
|
-
using GNodeK =
|
|
1067
|
+
using GNodeK = s32_t;
|
|
1068
1068
|
using GEdgeFlag = GenericEdge<void>::GEdgeFlag;
|
|
1069
1069
|
using GEdgeKind = GenericEdge<void>::GEdgeKind;
|
|
1070
1070
|
static ICFGNode* createICFGNode(NodeID id, GNodeK type);
|
|
@@ -531,9 +531,9 @@ private:
|
|
|
531
531
|
/// add node into SVFIR
|
|
532
532
|
//@{
|
|
533
533
|
/// Add a value (pointer) node
|
|
534
|
-
inline NodeID addValNode(const SVFValue* val, NodeID i)
|
|
534
|
+
inline NodeID addValNode(const SVFValue* val, NodeID i, const SVFBaseNode* gNode)
|
|
535
535
|
{
|
|
536
|
-
SVFVar *node = new ValVar(val,i);
|
|
536
|
+
SVFVar *node = new ValVar(val,i, ValVar::ValNode, gNode);
|
|
537
537
|
return addValNode(val, node, i);
|
|
538
538
|
}
|
|
539
539
|
/// Add a memory obj node
|