svf-tools 1.0.1217 → 1.0.1219
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/VFG.h +9 -12
- package/svf/include/SVFIR/SVFStatements.h +1 -4
- package/svf/lib/DDA/ContextDDA.cpp +4 -4
- package/svf/lib/DDA/FlowDDA.cpp +2 -2
- package/svf/lib/Graphs/SVFGOPT.cpp +2 -2
- package/svf/lib/Graphs/VFG.cpp +1 -1
- package/svf/lib/SABER/SaberSVFGBuilder.cpp +8 -8
- package/svf/lib/SVFIR/SVFIR.cpp +16 -16
- package/svf/lib/SVFIR/SVFStatements.cpp +157 -44
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1219",
|
|
4
4
|
"description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
package/svf/include/Graphs/VFG.h
CHANGED
|
@@ -640,8 +640,7 @@ protected:
|
|
|
640
640
|
/// Add an llvm PHI VFG node
|
|
641
641
|
inline void addIntraPHIVFGNode(const MultiOpndStmt* edge)
|
|
642
642
|
{
|
|
643
|
-
|
|
644
|
-
IntraPHIVFGNode* sNode = new IntraPHIVFGNode(totalVFGNode++,res);
|
|
643
|
+
IntraPHIVFGNode* sNode = new IntraPHIVFGNode(totalVFGNode++, edge->getRes());
|
|
645
644
|
u32_t pos = 0;
|
|
646
645
|
for(auto var : edge->getOpndVars())
|
|
647
646
|
{
|
|
@@ -649,14 +648,13 @@ protected:
|
|
|
649
648
|
pos++;
|
|
650
649
|
}
|
|
651
650
|
addVFGNode(sNode,edge->getICFGNode());
|
|
652
|
-
setDef(
|
|
653
|
-
SVFVarToIntraPHIVFGNodeMap[
|
|
651
|
+
setDef(edge->getRes(),sNode);
|
|
652
|
+
SVFVarToIntraPHIVFGNodeMap[edge->getRes()] = sNode;
|
|
654
653
|
}
|
|
655
654
|
/// Add a Compare VFG node
|
|
656
655
|
inline void addCmpVFGNode(const CmpStmt* edge)
|
|
657
656
|
{
|
|
658
|
-
|
|
659
|
-
CmpVFGNode* sNode = new CmpVFGNode(totalVFGNode++, res);
|
|
657
|
+
CmpVFGNode* sNode = new CmpVFGNode(totalVFGNode++, edge->getRes());
|
|
660
658
|
u32_t pos = 0;
|
|
661
659
|
for(auto var : edge->getOpndVars())
|
|
662
660
|
{
|
|
@@ -664,14 +662,13 @@ protected:
|
|
|
664
662
|
pos++;
|
|
665
663
|
}
|
|
666
664
|
addVFGNode(sNode,edge->getICFGNode());
|
|
667
|
-
setDef(
|
|
668
|
-
SVFVarToCmpVFGNodeMap[
|
|
665
|
+
setDef(edge->getRes(),sNode);
|
|
666
|
+
SVFVarToCmpVFGNodeMap[edge->getRes()] = sNode;
|
|
669
667
|
}
|
|
670
668
|
/// Add a BinaryOperator VFG node
|
|
671
669
|
inline void addBinaryOPVFGNode(const BinaryOPStmt* edge)
|
|
672
670
|
{
|
|
673
|
-
|
|
674
|
-
BinaryOPVFGNode* sNode = new BinaryOPVFGNode(totalVFGNode++, res);
|
|
671
|
+
BinaryOPVFGNode* sNode = new BinaryOPVFGNode(totalVFGNode++, edge->getRes());
|
|
675
672
|
u32_t pos = 0;
|
|
676
673
|
for(auto var : edge->getOpndVars())
|
|
677
674
|
{
|
|
@@ -679,8 +676,8 @@ protected:
|
|
|
679
676
|
pos++;
|
|
680
677
|
}
|
|
681
678
|
addVFGNode(sNode,edge->getICFGNode());
|
|
682
|
-
setDef(
|
|
683
|
-
SVFVarToBinaryOPVFGNodeMap[
|
|
679
|
+
setDef(edge->getRes(),sNode);
|
|
680
|
+
SVFVarToBinaryOPVFGNodeMap[edge->getRes()] = sNode;
|
|
684
681
|
}
|
|
685
682
|
/// Add a UnaryOperator VFG node
|
|
686
683
|
inline void addUnaryOPVFGNode(const UnaryOPStmt* edge)
|
|
@@ -867,10 +867,7 @@ public:
|
|
|
867
867
|
return opVars.at(pos);
|
|
868
868
|
}
|
|
869
869
|
/// Result SVFVar
|
|
870
|
-
|
|
871
|
-
{
|
|
872
|
-
return SVFStmt::getDstNode();
|
|
873
|
-
}
|
|
870
|
+
const ValVar* getRes() const;
|
|
874
871
|
|
|
875
872
|
NodeID getOpVarID(u32_t pos) const;
|
|
876
873
|
NodeID getResID() const;
|
|
@@ -79,8 +79,8 @@ const CxtPtSet& ContextDDA::computeDDAPts(const CxtVar& var)
|
|
|
79
79
|
LocDPItem::setMaxBudget(Options::CxtBudget());
|
|
80
80
|
|
|
81
81
|
NodeID id = var.get_id();
|
|
82
|
-
const
|
|
83
|
-
CxtLocDPItem dpm = getDPIm(var, getDefSVFGNode(
|
|
82
|
+
const ValVar* node = getPAG()->getValVar(id);
|
|
83
|
+
CxtLocDPItem dpm = getDPIm(var, getDefSVFGNode(node));
|
|
84
84
|
|
|
85
85
|
// start DDA analysis
|
|
86
86
|
DOTIMESTAT(double start = DDAStat::getClk(true));
|
|
@@ -191,9 +191,9 @@ bool ContextDDA::testIndCallReachability(CxtLocDPItem& dpm, const FunObjVar* cal
|
|
|
191
191
|
if(getPAG()->isIndirectCallSites(cs))
|
|
192
192
|
{
|
|
193
193
|
NodeID id = getPAG()->getFunPtr(cs);
|
|
194
|
-
const
|
|
194
|
+
const ValVar* node = getPAG()->getValVar(id);
|
|
195
195
|
CxtVar funptrVar(dpm.getCondVar().get_cond(), id);
|
|
196
|
-
CxtLocDPItem funptrDpm = getDPIm(funptrVar,getDefSVFGNode(
|
|
196
|
+
CxtLocDPItem funptrDpm = getDPIm(funptrVar,getDefSVFGNode(node));
|
|
197
197
|
PointsTo pts = getBVPointsTo(findPT(funptrDpm));
|
|
198
198
|
if(pts.test(callee->getId()))
|
|
199
199
|
return true;
|
package/svf/lib/DDA/FlowDDA.cpp
CHANGED
|
@@ -45,8 +45,8 @@ void FlowDDA::computeDDAPts(NodeID id)
|
|
|
45
45
|
resetQuery();
|
|
46
46
|
LocDPItem::setMaxBudget(Options::FlowBudget());
|
|
47
47
|
|
|
48
|
-
const
|
|
49
|
-
LocDPItem dpm = getDPIm(node->getId(),getDefSVFGNode(
|
|
48
|
+
const ValVar* node = getPAG()->getValVar(id);
|
|
49
|
+
LocDPItem dpm = getDPIm(node->getId(),getDefSVFGNode(node));
|
|
50
50
|
|
|
51
51
|
/// start DDA analysis
|
|
52
52
|
DOTIMESTAT(double start = DDAStat::getClk(true));
|
|
@@ -199,7 +199,7 @@ void SVFGOPT::replaceFParamARetWithPHI(PHISVFGNode* phi, SVFGNode* svfgNode)
|
|
|
199
199
|
ActualParmSVFGNode* ap = SVFUtil::cast<ActualParmSVFGNode>((*it)->getSrcNode());
|
|
200
200
|
addInterPHIOperands(phi, ap->getParam());
|
|
201
201
|
// connect actual param's def node to phi node
|
|
202
|
-
addCallEdge(getDef(
|
|
202
|
+
addCallEdge(getDef(ap->getParam()), phiId, getCallSiteID(ap->getCallSite(), fp->getFun()));
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
else if (ActualRetSVFGNode* ar = SVFUtil::dyn_cast<ActualRetSVFGNode>(svfgNode))
|
|
@@ -210,7 +210,7 @@ void SVFGOPT::replaceFParamARetWithPHI(PHISVFGNode* phi, SVFGNode* svfgNode)
|
|
|
210
210
|
FormalRetSVFGNode* fr = SVFUtil::cast<FormalRetSVFGNode>((*it)->getSrcNode());
|
|
211
211
|
addInterPHIOperands(phi, fr->getRet());
|
|
212
212
|
// connect formal return's def node to phi node
|
|
213
|
-
addRetEdge(getDef(
|
|
213
|
+
addRetEdge(getDef(fr->getRet()), phiId, getCallSiteID(ar->getCallSite(), fr->getFun()));
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
|
package/svf/lib/Graphs/VFG.cpp
CHANGED
|
@@ -747,7 +747,7 @@ void VFG::connectDirectVFGEdges()
|
|
|
747
747
|
{
|
|
748
748
|
if(varType.first->isConstDataOrAggDataButNotNullPtr() || isInterestedSVFVar(varType.first) == false)
|
|
749
749
|
continue;
|
|
750
|
-
addIntraDirectVFEdge(getDef(
|
|
750
|
+
addIntraDirectVFEdge(getDef(varType.first), nodeId);
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
753
|
/// for store, connect the RHS/LHS pointer to its def
|
|
@@ -185,23 +185,23 @@ void SaberSVFGBuilder::rmDerefDirSVFGEdges(BVDataPTAImpl* pta)
|
|
|
185
185
|
if(const StmtSVFGNode* stmtNode = SVFUtil::dyn_cast<StmtSVFGNode>(node))
|
|
186
186
|
{
|
|
187
187
|
/// for store, connect the RHS/LHS pointer to its def
|
|
188
|
-
if(SVFUtil::
|
|
188
|
+
if(const StoreSVFGNode* store = SVFUtil::dyn_cast<StoreSVFGNode>(stmtNode))
|
|
189
189
|
{
|
|
190
|
-
const SVFGNode* def = svfg->getDefSVFGNode(
|
|
191
|
-
if(SVFGEdge* edge = svfg->getIntraVFGEdge(def,
|
|
190
|
+
const SVFGNode* def = svfg->getDefSVFGNode(store->getDstNode());
|
|
191
|
+
if(SVFGEdge* edge = svfg->getIntraVFGEdge(def,store,SVFGEdge::IntraDirectVF))
|
|
192
192
|
svfg->removeSVFGEdge(edge);
|
|
193
193
|
else
|
|
194
194
|
assert((svfg->getKind()==VFG::FULLSVFG_OPT || svfg->getKind()==VFG::PTRONLYSVFG_OPT) && "Edge not found!");
|
|
195
195
|
|
|
196
|
-
if(accessGlobal(pta,
|
|
196
|
+
if(accessGlobal(pta,store->getDstNode()))
|
|
197
197
|
{
|
|
198
|
-
globSVFGNodes.insert(
|
|
198
|
+
globSVFGNodes.insert(store);
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
else if(SVFUtil::
|
|
201
|
+
else if(const LoadSVFGNode* load = SVFUtil::dyn_cast<LoadSVFGNode>(stmtNode))
|
|
202
202
|
{
|
|
203
|
-
const SVFGNode* def = svfg->getDefSVFGNode(
|
|
204
|
-
if(SVFGEdge* edge = svfg->getIntraVFGEdge(def,
|
|
203
|
+
const SVFGNode* def = svfg->getDefSVFGNode(load->getSrcNode());
|
|
204
|
+
if(SVFGEdge* edge = svfg->getIntraVFGEdge(def,load,SVFGEdge::IntraDirectVF))
|
|
205
205
|
svfg->removeSVFGEdge(edge);
|
|
206
206
|
else
|
|
207
207
|
assert((svfg->getKind()==VFG::FULLSVFG_OPT || svfg->getKind()==VFG::PTRONLYSVFG_OPT) && "Edge not found!");
|
package/svf/lib/SVFIR/SVFIR.cpp
CHANGED
|
@@ -107,8 +107,8 @@ void SVFIR::addCopyStmt(CopyStmt* edge)
|
|
|
107
107
|
*/
|
|
108
108
|
PhiStmt* SVFIR::addPhiStmt(NodeID res, NodeID opnd, const ICFGNode* pred)
|
|
109
109
|
{
|
|
110
|
-
ValVar* opNode =
|
|
111
|
-
ValVar* resNode =
|
|
110
|
+
ValVar* opNode = const_cast<ValVar*>(getValVar(opnd));
|
|
111
|
+
ValVar* resNode = const_cast<ValVar*>(getValVar(res));
|
|
112
112
|
PHINodeMap::iterator it = phiNodeMap.find(resNode);
|
|
113
113
|
if(it == phiNodeMap.end())
|
|
114
114
|
{
|
|
@@ -140,10 +140,10 @@ void SVFIR::addPhiStmt(PhiStmt* edge, SVFVar* src, SVFVar* dst)
|
|
|
140
140
|
*/
|
|
141
141
|
SelectStmt* SVFIR::addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond)
|
|
142
142
|
{
|
|
143
|
-
ValVar* op1Node =
|
|
144
|
-
ValVar* op2Node =
|
|
145
|
-
ValVar* dstNode =
|
|
146
|
-
SVFVar* condNode = getGNode(cond);
|
|
143
|
+
ValVar* op1Node = const_cast<ValVar*>(getValVar(op1));
|
|
144
|
+
ValVar* op2Node = const_cast<ValVar*>(getValVar(op2));
|
|
145
|
+
ValVar* dstNode = const_cast<ValVar*>(getValVar(res));
|
|
146
|
+
const SVFVar* condNode = getGNode(cond);
|
|
147
147
|
if(hasLabeledEdge(op1Node, dstNode, SVFStmt::Select, op2Node))
|
|
148
148
|
return nullptr;
|
|
149
149
|
else
|
|
@@ -166,9 +166,9 @@ void SVFIR::addSelectStmt(SelectStmt* edge, SVFVar* src, SVFVar* dst)
|
|
|
166
166
|
*/
|
|
167
167
|
CmpStmt* SVFIR::addCmpStmt(NodeID op1, NodeID op2, NodeID dst, u32_t predicate)
|
|
168
168
|
{
|
|
169
|
-
ValVar* op1Node =
|
|
170
|
-
ValVar* op2Node =
|
|
171
|
-
ValVar* dstNode =
|
|
169
|
+
ValVar* op1Node = const_cast<ValVar*>(getValVar(op1));
|
|
170
|
+
ValVar* op2Node = const_cast<ValVar*>(getValVar(op2));
|
|
171
|
+
ValVar* dstNode = const_cast<ValVar*>(getValVar(dst));
|
|
172
172
|
if(hasLabeledEdge(op1Node, dstNode, SVFStmt::Cmp, op2Node))
|
|
173
173
|
return nullptr;
|
|
174
174
|
else
|
|
@@ -192,9 +192,9 @@ void SVFIR::addCmpStmt(CmpStmt* edge, SVFVar* src, SVFVar* dst)
|
|
|
192
192
|
*/
|
|
193
193
|
BinaryOPStmt* SVFIR::addBinaryOPStmt(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
|
|
194
194
|
{
|
|
195
|
-
ValVar* op1Node =
|
|
196
|
-
ValVar* op2Node =
|
|
197
|
-
ValVar* dstNode =
|
|
195
|
+
ValVar* op1Node = const_cast<ValVar*>(getValVar(op1));
|
|
196
|
+
ValVar* op2Node = const_cast<ValVar*>(getValVar(op2));
|
|
197
|
+
ValVar* dstNode = const_cast<ValVar*>(getValVar(dst));
|
|
198
198
|
if(hasLabeledEdge(op1Node, dstNode, SVFStmt::BinaryOp, op2Node))
|
|
199
199
|
return nullptr;
|
|
200
200
|
else
|
|
@@ -216,8 +216,8 @@ void SVFIR::addBinaryOPStmt(BinaryOPStmt* edge, SVFVar* src, SVFVar* dst)
|
|
|
216
216
|
*/
|
|
217
217
|
UnaryOPStmt* SVFIR::addUnaryOPStmt(NodeID src, NodeID dst, u32_t opcode)
|
|
218
218
|
{
|
|
219
|
-
ValVar* srcNode =
|
|
220
|
-
ValVar* dstNode =
|
|
219
|
+
ValVar* srcNode = const_cast<ValVar*>(getValVar(src));
|
|
220
|
+
ValVar* dstNode = const_cast<ValVar*>(getValVar(dst));
|
|
221
221
|
if(hasNonlabeledEdge(srcNode,dstNode, SVFStmt::UnaryOp))
|
|
222
222
|
return nullptr;
|
|
223
223
|
else
|
|
@@ -239,8 +239,8 @@ void SVFIR::addUnaryOPStmt(UnaryOPStmt* edge, SVFVar* src, SVFVar* dst)
|
|
|
239
239
|
*/
|
|
240
240
|
BranchStmt* SVFIR::addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccAndCondPairVec& succs)
|
|
241
241
|
{
|
|
242
|
-
ValVar* brNode =
|
|
243
|
-
ValVar* condNode =
|
|
242
|
+
ValVar* brNode = const_cast<ValVar*>(getValVar(br));
|
|
243
|
+
ValVar* condNode = const_cast<ValVar*>(getValVar(cond));
|
|
244
244
|
if(hasNonlabeledEdge(condNode,brNode, SVFStmt::Branch))
|
|
245
245
|
return nullptr;
|
|
246
246
|
else
|
|
@@ -290,50 +290,158 @@ const std::string TDJoinPE::toString() const
|
|
|
290
290
|
return rawstr.str();
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
const ObjVar* AddrStmt::getRHSVar() const
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const ValVar*
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
const ValVar*
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
const ValVar*
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
const ValVar*
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
const ValVar*
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
const ValVar*
|
|
336
|
-
|
|
293
|
+
const ObjVar* AddrStmt::getRHSVar() const
|
|
294
|
+
{
|
|
295
|
+
return cast<ObjVar>(SVFStmt::getSrcNode());
|
|
296
|
+
}
|
|
297
|
+
const ValVar* AddrStmt::getLHSVar() const
|
|
298
|
+
{
|
|
299
|
+
return cast<ValVar>(SVFStmt::getDstNode());
|
|
300
|
+
}
|
|
301
|
+
const ObjVar* AddrStmt::getSrcNode() const
|
|
302
|
+
{
|
|
303
|
+
return getRHSVar();
|
|
304
|
+
}
|
|
305
|
+
const ValVar* AddrStmt::getDstNode() const
|
|
306
|
+
{
|
|
307
|
+
return getLHSVar();
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
const ValVar* CopyStmt::getRHSVar() const
|
|
311
|
+
{
|
|
312
|
+
return cast<ValVar>(SVFStmt::getSrcNode());
|
|
313
|
+
}
|
|
314
|
+
const ValVar* CopyStmt::getLHSVar() const
|
|
315
|
+
{
|
|
316
|
+
return cast<ValVar>(SVFStmt::getDstNode());
|
|
317
|
+
}
|
|
318
|
+
const ValVar* CopyStmt::getSrcNode() const
|
|
319
|
+
{
|
|
320
|
+
return getRHSVar();
|
|
321
|
+
}
|
|
322
|
+
const ValVar* CopyStmt::getDstNode() const
|
|
323
|
+
{
|
|
324
|
+
return getLHSVar();
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
const ValVar* StoreStmt::getRHSVar() const
|
|
328
|
+
{
|
|
329
|
+
return cast<ValVar>(SVFStmt::getSrcNode());
|
|
330
|
+
}
|
|
331
|
+
const ValVar* StoreStmt::getLHSVar() const
|
|
332
|
+
{
|
|
333
|
+
return cast<ValVar>(SVFStmt::getDstNode());
|
|
334
|
+
}
|
|
335
|
+
const ValVar* StoreStmt::getSrcNode() const
|
|
336
|
+
{
|
|
337
|
+
return getRHSVar();
|
|
338
|
+
}
|
|
339
|
+
const ValVar* StoreStmt::getDstNode() const
|
|
340
|
+
{
|
|
341
|
+
return getLHSVar();
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
const ValVar* LoadStmt::getRHSVar() const
|
|
345
|
+
{
|
|
346
|
+
return cast<ValVar>(SVFStmt::getSrcNode());
|
|
347
|
+
}
|
|
348
|
+
const ValVar* LoadStmt::getLHSVar() const
|
|
349
|
+
{
|
|
350
|
+
return cast<ValVar>(SVFStmt::getDstNode());
|
|
351
|
+
}
|
|
352
|
+
const ValVar* LoadStmt::getSrcNode() const
|
|
353
|
+
{
|
|
354
|
+
return getRHSVar();
|
|
355
|
+
}
|
|
356
|
+
const ValVar* LoadStmt::getDstNode() const
|
|
357
|
+
{
|
|
358
|
+
return getLHSVar();
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
const ValVar* GepStmt::getRHSVar() const
|
|
362
|
+
{
|
|
363
|
+
return cast<ValVar>(SVFStmt::getSrcNode());
|
|
364
|
+
}
|
|
365
|
+
const ValVar* GepStmt::getLHSVar() const
|
|
366
|
+
{
|
|
367
|
+
return cast<ValVar>(SVFStmt::getDstNode());
|
|
368
|
+
}
|
|
369
|
+
const ValVar* GepStmt::getSrcNode() const
|
|
370
|
+
{
|
|
371
|
+
return getRHSVar();
|
|
372
|
+
}
|
|
373
|
+
const ValVar* GepStmt::getDstNode() const
|
|
374
|
+
{
|
|
375
|
+
return getLHSVar();
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const ValVar* CallPE::getRHSVar() const
|
|
379
|
+
{
|
|
380
|
+
return cast<ValVar>(SVFStmt::getSrcNode());
|
|
381
|
+
}
|
|
382
|
+
const ValVar* CallPE::getLHSVar() const
|
|
383
|
+
{
|
|
384
|
+
return cast<ValVar>(SVFStmt::getDstNode());
|
|
385
|
+
}
|
|
386
|
+
const ValVar* CallPE::getSrcNode() const
|
|
387
|
+
{
|
|
388
|
+
return getRHSVar();
|
|
389
|
+
}
|
|
390
|
+
const ValVar* CallPE::getDstNode() const
|
|
391
|
+
{
|
|
392
|
+
return getLHSVar();
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
const ValVar* RetPE::getRHSVar() const
|
|
396
|
+
{
|
|
397
|
+
return cast<ValVar>(SVFStmt::getSrcNode());
|
|
398
|
+
}
|
|
399
|
+
const ValVar* RetPE::getLHSVar() const
|
|
400
|
+
{
|
|
401
|
+
return cast<ValVar>(SVFStmt::getDstNode());
|
|
402
|
+
}
|
|
403
|
+
const ValVar* RetPE::getSrcNode() const
|
|
404
|
+
{
|
|
405
|
+
return getRHSVar();
|
|
406
|
+
}
|
|
407
|
+
const ValVar* RetPE::getDstNode() const
|
|
408
|
+
{
|
|
409
|
+
return getLHSVar();
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
const ValVar* TDForkPE::getRHSVar() const
|
|
413
|
+
{
|
|
414
|
+
return cast<ValVar>(SVFStmt::getSrcNode());
|
|
415
|
+
}
|
|
416
|
+
const ValVar* TDForkPE::getLHSVar() const
|
|
417
|
+
{
|
|
418
|
+
return cast<ValVar>(SVFStmt::getDstNode());
|
|
419
|
+
}
|
|
420
|
+
const ValVar* TDForkPE::getSrcNode() const
|
|
421
|
+
{
|
|
422
|
+
return getRHSVar();
|
|
423
|
+
}
|
|
424
|
+
const ValVar* TDForkPE::getDstNode() const
|
|
425
|
+
{
|
|
426
|
+
return getLHSVar();
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const ValVar* TDJoinPE::getRHSVar() const
|
|
430
|
+
{
|
|
431
|
+
return cast<ValVar>(SVFStmt::getSrcNode());
|
|
432
|
+
}
|
|
433
|
+
const ValVar* TDJoinPE::getLHSVar() const
|
|
434
|
+
{
|
|
435
|
+
return cast<ValVar>(SVFStmt::getDstNode());
|
|
436
|
+
}
|
|
437
|
+
const ValVar* TDJoinPE::getSrcNode() const
|
|
438
|
+
{
|
|
439
|
+
return getRHSVar();
|
|
440
|
+
}
|
|
441
|
+
const ValVar* TDJoinPE::getDstNode() const
|
|
442
|
+
{
|
|
443
|
+
return getLHSVar();
|
|
444
|
+
}
|
|
337
445
|
|
|
338
446
|
|
|
339
447
|
NodeID MultiOpndStmt::getOpVarID(u32_t pos) const
|
|
@@ -364,6 +472,11 @@ const ValVar* UnaryOPStmt::getRes() const
|
|
|
364
472
|
return cast<ValVar>(SVFStmt::getDstNode());
|
|
365
473
|
}
|
|
366
474
|
|
|
475
|
+
const ValVar* MultiOpndStmt::getRes() const
|
|
476
|
+
{
|
|
477
|
+
return cast<ValVar>(SVFStmt::getDstNode());
|
|
478
|
+
}
|
|
479
|
+
|
|
367
480
|
/// Return true if this is a phi at the function exit
|
|
368
481
|
/// to receive one or multiple return values of this function
|
|
369
482
|
bool PhiStmt::isFunctionRetPhi() const
|