svf-tools 1.0.358 → 1.0.359
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-doxygen/html/html/Andersen_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/CallGraphBuilder_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/ICFGBuilder_8cpp_source.html +1 -3
- package/SVF-doxygen/html/html/ICFGBuilder_8h_source.html +6 -6
- package/SVF-doxygen/html/html/ICFGNode_8h_source.html +3 -3
- package/SVF-doxygen/html/html/ICFG_8cpp_source.html +17 -17
- package/SVF-doxygen/html/html/ICFG_8h_source.html +17 -18
- package/SVF-doxygen/html/html/LeakChecker_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/LockAnalysis_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/LockResultValidator_8h_source.html +2 -2
- package/SVF-doxygen/html/html/MHP_8h_source.html +2 -2
- package/SVF-doxygen/html/html/MTAResultValidator_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +4 -4
- package/SVF-doxygen/html/html/MemSSA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PCG_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/PCG_8h_source.html +3 -3
- package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/SVFGOPT_8h_source.html +3 -3
- package/SVF-doxygen/html/html/SVFG_8cpp_source.html +5 -5
- package/SVF-doxygen/html/html/SVFG_8h_source.html +5 -5
- package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +2 -2
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +3 -3
- package/SVF-doxygen/html/html/TCT_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/TCT_8h_source.html +2 -2
- package/SVF-doxygen/html/html/VFG_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/VFG_8h_source.html +6 -6
- package/SVF-doxygen/html/html/WPAPass_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1Andersen.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1CallGraphBuilder.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1CallICFGNode-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1CallICFGNode.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1ForkJoinAnalysis.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1ICFG-members.html +22 -22
- package/SVF-doxygen/html/html/classSVF_1_1ICFG.html +234 -234
- package/SVF-doxygen/html/html/classSVF_1_1ICFGBuilder-members.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1ICFGBuilder.html +45 -49
- package/SVF-doxygen/html/html/classSVF_1_1ICFGPrinter-members.html +11 -11
- package/SVF-doxygen/html/html/classSVF_1_1ICFGPrinter.html +17 -17
- package/SVF-doxygen/html/html/classSVF_1_1LeakChecker.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1LockAnalysis.html +8 -8
- package/SVF-doxygen/html/html/classSVF_1_1LockResultValidator.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1MHP.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1MTAResultValidator.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1MemSSA.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1PCG-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1PCG.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1RetICFGNode-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1RetICFGNode.html +5 -5
- package/SVF-doxygen/html/html/classSVF_1_1SVFG.html +13 -13
- package/SVF-doxygen/html/html/classSVF_1_1SVFGOPT.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +20 -20
- package/SVF-doxygen/html/html/classSVF_1_1TCT-members.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1TCT.html +12 -12
- package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraphBuilder.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1VFG.html +14 -14
- package/SVF-doxygen/html/html/classSVF_1_1WPAPass.html +6 -6
- package/SVF-doxygen/html/html/functions_a.html +12 -12
- package/SVF-doxygen/html/html/functions_f.html +3 -3
- package/SVF-doxygen/html/html/functions_func.html +12 -12
- package/SVF-doxygen/html/html/functions_func_g.html +34 -41
- package/SVF-doxygen/html/html/functions_g.html +31 -38
- package/SVF-doxygen/html/html/functions_l.html +8 -8
- package/SVF-doxygen/html/html/functions_m.html +1 -1
- package/SVF-doxygen/html/html/functions_n.html +3 -3
- package/SVF-doxygen/html/html/functions_o.html +11 -11
- package/SVF-doxygen/html/html/functions_p.html +1 -1
- package/SVF-doxygen/html/html/functions_s.html +9 -7
- package/SVF-doxygen/html/html/functions_t.html +4 -4
- package/SVF-doxygen/html/html/functions_v.html +6 -6
- package/SVF-doxygen/html/html/functions_w.html +9 -5
- package/SVF-doxygen/html/html/search/all_1.js +5 -5
- package/SVF-doxygen/html/html/search/all_10.js +3 -3
- package/SVF-doxygen/html/html/search/all_13.js +6 -6
- package/SVF-doxygen/html/html/search/all_14.js +4 -4
- package/SVF-doxygen/html/html/search/all_16.js +2 -2
- package/SVF-doxygen/html/html/search/all_17.js +1 -1
- package/SVF-doxygen/html/html/search/all_6.js +1 -1
- package/SVF-doxygen/html/html/search/all_7.js +12 -15
- package/SVF-doxygen/html/html/search/all_c.js +3 -3
- package/SVF-doxygen/html/html/search/all_d.js +1 -1
- package/SVF-doxygen/html/html/search/all_e.js +3 -3
- package/SVF-doxygen/html/html/search/all_f.js +1 -1
- package/SVF-doxygen/html/html/search/functions_0.js +5 -5
- package/SVF-doxygen/html/html/search/functions_10.js +1 -1
- package/SVF-doxygen/html/html/search/functions_6.js +12 -15
- package/SVF-doxygen/html/html/search/functions_e.js +1 -1
- package/SVF-doxygen/html/html/search/variables_14.js +2 -2
- package/SVF-doxygen/html/html/search/variables_e.js +2 -2
- package/SVF-doxygen/html/html/svf-ex_8cpp.html +2 -2
- package/SVF-doxygen/html/html/svf-ex_8cpp_source.html +2 -2
- package/include/Graphs/ICFG.h +18 -18
- package/include/Graphs/ICFGNode.h +2 -2
- package/include/Graphs/SVFG.h +4 -4
- package/include/Graphs/SVFGOPT.h +2 -2
- package/include/Graphs/VFG.h +5 -5
- package/include/MTA/LockResultValidator.h +1 -1
- package/include/MTA/MHP.h +2 -2
- package/include/MTA/PCG.h +2 -2
- package/include/MTA/TCT.h +2 -2
- package/include/MemoryModel/SVFIR.h +2 -2
- package/include/SVF-FE/ICFGBuilder.h +5 -5
- package/include/SVF-FE/SVFIRBuilder.h +1 -1
- package/lib/Graphs/ICFG.cpp +23 -23
- package/lib/Graphs/SVFG.cpp +4 -4
- package/lib/Graphs/VFG.cpp +3 -3
- package/lib/MSSA/MemRegion.cpp +7 -7
- package/lib/MSSA/MemSSA.cpp +3 -3
- package/lib/MTA/LockAnalysis.cpp +4 -4
- package/lib/MTA/MTAResultValidator.cpp +1 -1
- package/lib/MTA/PCG.cpp +1 -1
- package/lib/MTA/TCT.cpp +2 -2
- package/lib/MemoryModel/PointerAnalysis.cpp +1 -1
- package/lib/SABER/LeakChecker.cpp +3 -3
- package/lib/SVF-FE/CallGraphBuilder.cpp +4 -4
- package/lib/SVF-FE/ICFGBuilder.cpp +12 -24
- package/lib/SVF-FE/SVFIRBuilder.cpp +15 -15
- package/lib/WPA/Andersen.cpp +3 -3
- package/lib/WPA/WPAPass.cpp +4 -4
- package/package.json +1 -1
- package/tools/Example/svf-ex.cpp +1 -1
package/lib/MTA/TCT.cpp
CHANGED
|
@@ -476,7 +476,7 @@ void TCT::pushCxt(CallStrCxt& cxt, const Instruction* call, const Function* call
|
|
|
476
476
|
const Function* caller = call->getParent()->getParent();
|
|
477
477
|
const SVFFunction* svfcaller = getSVFFun(caller);
|
|
478
478
|
const SVFFunction* svfcallee = getSVFFun(callee);
|
|
479
|
-
CallSiteID csId = tcg->getCallSiteID(
|
|
479
|
+
CallSiteID csId = tcg->getCallSiteID(getCallICFGNode(call), svfcallee);
|
|
480
480
|
|
|
481
481
|
/// handle calling context for candidate functions only
|
|
482
482
|
if(isCandidateFun(caller) == false)
|
|
@@ -498,7 +498,7 @@ bool TCT::matchCxt(CallStrCxt& cxt, const Instruction* call, const Function* cal
|
|
|
498
498
|
|
|
499
499
|
const Function* caller = call->getParent()->getParent();
|
|
500
500
|
const SVFFunction* svfcallee = getSVFFun(callee);
|
|
501
|
-
CallSiteID csId = tcg->getCallSiteID(
|
|
501
|
+
CallSiteID csId = tcg->getCallSiteID(getCallICFGNode(call), svfcallee);
|
|
502
502
|
|
|
503
503
|
/// handle calling context for candidate functions only
|
|
504
504
|
if(isCandidateFun(caller) == false)
|
|
@@ -515,7 +515,7 @@ void PointerAnalysis::connectVCallToVFns(const CallICFGNode* cs, const VFunSet &
|
|
|
515
515
|
{
|
|
516
516
|
newEdges[cs].insert(callee);
|
|
517
517
|
getIndCallMap()[cs].insert(callee);
|
|
518
|
-
const CallICFGNode* callBlockNode = pag->getICFG()->
|
|
518
|
+
const CallICFGNode* callBlockNode = pag->getICFG()->getCallICFGNode(cs->getCallSite());
|
|
519
519
|
ptaCallGraph->addIndirectCallGraphEdge(callBlockNode, cs->getCaller(),callee);
|
|
520
520
|
}
|
|
521
521
|
}
|
|
@@ -54,7 +54,7 @@ void LeakChecker::initSrcs()
|
|
|
54
54
|
continue;
|
|
55
55
|
|
|
56
56
|
PTACallGraph::FunctionSet callees;
|
|
57
|
-
getCallgraph()->getCallees(cs->
|
|
57
|
+
getCallgraph()->getCallees(cs->getCallICFGNode(),callees);
|
|
58
58
|
for(PTACallGraph::FunctionSet::const_iterator cit = callees.begin(), ecit = callees.end(); cit!=ecit; cit++)
|
|
59
59
|
{
|
|
60
60
|
const SVFFunction* fun = *cit;
|
|
@@ -62,11 +62,11 @@ void LeakChecker::initSrcs()
|
|
|
62
62
|
{
|
|
63
63
|
CSWorkList worklist;
|
|
64
64
|
SVFGNodeBS visited;
|
|
65
|
-
worklist.push(it->first->
|
|
65
|
+
worklist.push(it->first->getCallICFGNode());
|
|
66
66
|
while (!worklist.empty())
|
|
67
67
|
{
|
|
68
68
|
const CallICFGNode* cs = worklist.pop();
|
|
69
|
-
const RetICFGNode* retBlockNode = icfg->
|
|
69
|
+
const RetICFGNode* retBlockNode = icfg->getRetICFGNode(cs->getCallSite());
|
|
70
70
|
const PAGNode* pagNode = pag->getCallSiteRet(retBlockNode);
|
|
71
71
|
const SVFGNode* node = getSVFG()->getDefSVFGNode(pagNode);
|
|
72
72
|
if (visited.test(node->getId()) == 0)
|
|
@@ -55,7 +55,7 @@ PTACallGraph* CallGraphBuilder::buildCallGraph(SVFModule* svfModule)
|
|
|
55
55
|
{
|
|
56
56
|
if(const SVFFunction* callee = getCallee(inst))
|
|
57
57
|
{
|
|
58
|
-
const CallICFGNode* callBlockNode = icfg->
|
|
58
|
+
const CallICFGNode* callBlockNode = icfg->getCallICFGNode(inst);
|
|
59
59
|
const SVFFunction* caller = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(fun);
|
|
60
60
|
callgraph->addDirectCallGraphEdge(callBlockNode,caller,callee);
|
|
61
61
|
}
|
|
@@ -83,7 +83,7 @@ PTACallGraph* ThreadCallGraphBuilder::buildThreadCallGraph(SVFModule* svfModule)
|
|
|
83
83
|
const Instruction *inst = &*II;
|
|
84
84
|
if (tdAPI->isTDFork(inst))
|
|
85
85
|
{
|
|
86
|
-
const CallICFGNode* cs = icfg->
|
|
86
|
+
const CallICFGNode* cs = icfg->getCallICFGNode(inst);
|
|
87
87
|
cg->addForksite(cs);
|
|
88
88
|
const Function* forkee = SVFUtil::dyn_cast<Function>(tdAPI->getForkedFun(inst));
|
|
89
89
|
if (forkee)
|
|
@@ -98,7 +98,7 @@ PTACallGraph* ThreadCallGraphBuilder::buildThreadCallGraph(SVFModule* svfModule)
|
|
|
98
98
|
}
|
|
99
99
|
else if (tdAPI->isHareParFor(inst))
|
|
100
100
|
{
|
|
101
|
-
const CallICFGNode* cs = icfg->
|
|
101
|
+
const CallICFGNode* cs = icfg->getCallICFGNode(inst);
|
|
102
102
|
cg->addParForSite(cs);
|
|
103
103
|
const Function* taskFunc = SVFUtil::dyn_cast<Function>(tdAPI->getTaskFuncAtHareParForSite(inst));
|
|
104
104
|
if (taskFunc)
|
|
@@ -122,7 +122,7 @@ PTACallGraph* ThreadCallGraphBuilder::buildThreadCallGraph(SVFModule* svfModule)
|
|
|
122
122
|
const Instruction *inst = &*II;
|
|
123
123
|
if (tdAPI->isTDJoin(inst))
|
|
124
124
|
{
|
|
125
|
-
const CallICFGNode* cs = icfg->
|
|
125
|
+
const CallICFGNode* cs = icfg->getCallICFGNode(inst);
|
|
126
126
|
cg->addJoinsite(cs);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
@@ -58,7 +58,7 @@ void ICFGBuilder::build(SVFModule* svfModule)
|
|
|
58
58
|
*/
|
|
59
59
|
void ICFGBuilder::processFunEntry(const SVFFunction* fun, WorkList& worklist)
|
|
60
60
|
{
|
|
61
|
-
FunEntryICFGNode* FunEntryICFGNode = icfg->
|
|
61
|
+
FunEntryICFGNode* FunEntryICFGNode = icfg->getFunEntryICFGNode(fun);
|
|
62
62
|
const Instruction* entryInst = &((fun->getLLVMFun()->getEntryBlock()).front());
|
|
63
63
|
InstVec insts;
|
|
64
64
|
if (isIntrinsicInst(entryInst))
|
|
@@ -92,7 +92,7 @@ void ICFGBuilder::processFunBody(WorkList& worklist)
|
|
|
92
92
|
{
|
|
93
93
|
const Function* fun = inst->getFunction();
|
|
94
94
|
const SVFFunction* svfFun = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(fun);
|
|
95
|
-
FunExitICFGNode* FunExitICFGNode = icfg->
|
|
95
|
+
FunExitICFGNode* FunExitICFGNode = icfg->getFunExitICFGNode(svfFun);
|
|
96
96
|
icfg->addIntraEdge(srcNode, FunExitICFGNode);
|
|
97
97
|
}
|
|
98
98
|
InstVec nextInsts;
|
|
@@ -105,7 +105,7 @@ void ICFGBuilder::processFunBody(WorkList& worklist)
|
|
|
105
105
|
ICFGNode* dstNode = getOrAddBlockICFGNode(succ);
|
|
106
106
|
if (isNonInstricCallSite(inst))
|
|
107
107
|
{
|
|
108
|
-
RetICFGNode* retICFGNode =
|
|
108
|
+
RetICFGNode* retICFGNode = getRetICFGNode(inst);
|
|
109
109
|
srcNode = retICFGNode;
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -138,7 +138,7 @@ void ICFGBuilder::processFunBody(WorkList& worklist)
|
|
|
138
138
|
*/
|
|
139
139
|
void ICFGBuilder::processFunExit(const SVFFunction* fun)
|
|
140
140
|
{
|
|
141
|
-
FunExitICFGNode* FunExitICFGNode = icfg->
|
|
141
|
+
FunExitICFGNode* FunExitICFGNode = icfg->getFunExitICFGNode(fun);
|
|
142
142
|
|
|
143
143
|
for (inst_iterator II = inst_begin(fun->getLLVMFun()), EE = inst_end(fun->getLLVMFun()); II != EE; ++II)
|
|
144
144
|
{
|
|
@@ -161,7 +161,7 @@ InterICFGNode* ICFGBuilder::getOrAddInterBlockICFGNode(const Instruction* inst)
|
|
|
161
161
|
{
|
|
162
162
|
assert(SVFUtil::isCallSite(inst) && "not a call instruction?");
|
|
163
163
|
assert(SVFUtil::isNonInstricCallSite(inst) && "associating an intrinsic debug instruction with an ICFGNode!");
|
|
164
|
-
CallICFGNode* callICFGNode =
|
|
164
|
+
CallICFGNode* callICFGNode = getCallICFGNode(inst);
|
|
165
165
|
addICFGInterEdges(inst, getCallee(inst)); //creating interprocedural edges
|
|
166
166
|
return callICFGNode;
|
|
167
167
|
}
|
|
@@ -171,8 +171,8 @@ InterICFGNode* ICFGBuilder::getOrAddInterBlockICFGNode(const Instruction* inst)
|
|
|
171
171
|
*/
|
|
172
172
|
void ICFGBuilder::addICFGInterEdges(const Instruction* cs, const SVFFunction* callee)
|
|
173
173
|
{
|
|
174
|
-
CallICFGNode* CallICFGNode =
|
|
175
|
-
RetICFGNode* retBlockNode =
|
|
174
|
+
CallICFGNode* CallICFGNode = getCallICFGNode(cs);
|
|
175
|
+
RetICFGNode* retBlockNode = getRetICFGNode(cs);
|
|
176
176
|
|
|
177
177
|
/// direct call
|
|
178
178
|
if(callee){
|
|
@@ -184,8 +184,8 @@ void ICFGBuilder::addICFGInterEdges(const Instruction* cs, const SVFFunction* ca
|
|
|
184
184
|
/// otherwise connect interprocedural edges
|
|
185
185
|
else
|
|
186
186
|
{
|
|
187
|
-
FunEntryICFGNode* calleeEntryNode = icfg->
|
|
188
|
-
FunExitICFGNode* calleeExitNode = icfg->
|
|
187
|
+
FunEntryICFGNode* calleeEntryNode = icfg->getFunEntryICFGNode(callee);
|
|
188
|
+
FunExitICFGNode* calleeExitNode = icfg->getFunExitICFGNode(callee);
|
|
189
189
|
icfg->addCallEdge(CallICFGNode, calleeEntryNode, cs);
|
|
190
190
|
icfg->addRetEdge(calleeExitNode, retBlockNode, cs);
|
|
191
191
|
}
|
|
@@ -206,21 +206,9 @@ void ICFGBuilder::connectGlobalToProgEntry(SVFModule* svfModule)
|
|
|
206
206
|
if(mainFunc == nullptr)
|
|
207
207
|
return;
|
|
208
208
|
|
|
209
|
-
FunEntryICFGNode* entryNode = icfg->
|
|
210
|
-
GlobalICFGNode* globalNode = icfg->
|
|
211
|
-
|
|
212
|
-
std::vector<ICFGEdge*> toBeRemovedEdges;
|
|
213
|
-
for(ICFGEdge* edge : entryNode->getOutEdges())
|
|
214
|
-
toBeRemovedEdges.push_back(edge);
|
|
215
|
-
|
|
216
|
-
for(ICFGEdge* edge : toBeRemovedEdges){
|
|
217
|
-
assert(SVFUtil::isa<IntraCFGEdge>(edge) && "the outgoing edge of FunEntryICFGNode is not an intraCFGEdge?");
|
|
218
|
-
icfg->removeICFGEdge(edge);
|
|
219
|
-
IntraCFGEdge* intraEdge = new IntraCFGEdge(globalNode, edge->getDstNode());
|
|
220
|
-
icfg->addICFGEdge(intraEdge);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
IntraCFGEdge* intraEdge = new IntraCFGEdge(entryNode, globalNode);
|
|
209
|
+
FunEntryICFGNode* entryNode = icfg->getFunEntryICFGNode(mainFunc);
|
|
210
|
+
GlobalICFGNode* globalNode = icfg->getGlobalICFGNode();
|
|
211
|
+
IntraCFGEdge* intraEdge = new IntraCFGEdge(globalNode, entryNode);
|
|
224
212
|
icfg->addICFGEdge(intraEdge);
|
|
225
213
|
}
|
|
226
214
|
|
|
@@ -791,8 +791,8 @@ void SVFIRBuilder::visitCallSite(CallSite cs)
|
|
|
791
791
|
DBOUT(DPAGBuild,
|
|
792
792
|
outs() << "process callsite " << *cs.getInstruction() << "\n");
|
|
793
793
|
|
|
794
|
-
CallICFGNode* callBlockNode = pag->getICFG()->
|
|
795
|
-
RetICFGNode* retBlockNode = pag->getICFG()->
|
|
794
|
+
CallICFGNode* callBlockNode = pag->getICFG()->getCallICFGNode(cs.getInstruction());
|
|
795
|
+
RetICFGNode* retBlockNode = pag->getICFG()->getRetICFGNode(cs.getInstruction());
|
|
796
796
|
|
|
797
797
|
pag->addCallSite(callBlockNode);
|
|
798
798
|
|
|
@@ -893,7 +893,7 @@ void SVFIRBuilder::visitBranchInst(BranchInst &inst){
|
|
|
893
893
|
for (u32_t i = 0; i < inst.getNumSuccessors(); ++i)
|
|
894
894
|
{
|
|
895
895
|
const Instruction* succInst = &inst.getSuccessor(i)->front();
|
|
896
|
-
const ICFGNode* icfgNode = pag->getICFG()->
|
|
896
|
+
const ICFGNode* icfgNode = pag->getICFG()->getICFGNode(succInst);
|
|
897
897
|
successors.push_back(std::make_pair(icfgNode, 1-i));
|
|
898
898
|
}
|
|
899
899
|
const BranchStmt *brStmt = addBranchStmt(brinst, cond,successors);
|
|
@@ -910,7 +910,7 @@ void SVFIRBuilder::visitSwitchInst(SwitchInst &inst){
|
|
|
910
910
|
const ConstantInt* condVal = inst.findCaseDest(inst.getSuccessor(i));
|
|
911
911
|
/// default case is set to -1;
|
|
912
912
|
s64_t val = condVal ? condVal->getSExtValue() : -1;
|
|
913
|
-
const ICFGNode* icfgNode = pag->getICFG()->
|
|
913
|
+
const ICFGNode* icfgNode = pag->getICFG()->getICFGNode(succInst);
|
|
914
914
|
successors.push_back(std::make_pair(icfgNode,val));
|
|
915
915
|
}
|
|
916
916
|
const BranchStmt *brStmt = addBranchStmt(brinst, cond,successors);
|
|
@@ -960,7 +960,7 @@ void SVFIRBuilder::handleDirectCall(CallSite cs, const SVFFunction *F)
|
|
|
960
960
|
if (!cs.getType()->isVoidTy())
|
|
961
961
|
{
|
|
962
962
|
NodeID srcret = getReturnNode(F);
|
|
963
|
-
CallICFGNode* icfgNode = pag->getICFG()->
|
|
963
|
+
CallICFGNode* icfgNode = pag->getICFG()->getCallICFGNode(cs.getInstruction());
|
|
964
964
|
addRetEdge(srcret, dstrec,icfgNode);
|
|
965
965
|
}
|
|
966
966
|
//Iterators for the actual and formal parameters
|
|
@@ -982,7 +982,7 @@ void SVFIRBuilder::handleDirectCall(CallSite cs, const SVFFunction *F)
|
|
|
982
982
|
|
|
983
983
|
NodeID dstFA = getValueNode(FA);
|
|
984
984
|
NodeID srcAA = getValueNode(AA);
|
|
985
|
-
CallICFGNode* icfgNode = pag->getICFG()->
|
|
985
|
+
CallICFGNode* icfgNode = pag->getICFG()->getCallICFGNode(cs.getInstruction());
|
|
986
986
|
addCallEdge(srcAA, dstFA, icfgNode);
|
|
987
987
|
}
|
|
988
988
|
//Any remaining actual args must be varargs.
|
|
@@ -994,7 +994,7 @@ void SVFIRBuilder::handleDirectCall(CallSite cs, const SVFFunction *F)
|
|
|
994
994
|
{
|
|
995
995
|
Value *AA = *itA;
|
|
996
996
|
NodeID vnAA = getValueNode(AA);
|
|
997
|
-
CallICFGNode* icfgNode = pag->getICFG()->
|
|
997
|
+
CallICFGNode* icfgNode = pag->getICFG()->getCallICFGNode(cs.getInstruction());
|
|
998
998
|
addCallEdge(vnAA,vaF, icfgNode);
|
|
999
999
|
}
|
|
1000
1000
|
}
|
|
@@ -1477,7 +1477,7 @@ void SVFIRBuilder::handleExtCall(CallSite cs, const SVFFunction *callee)
|
|
|
1477
1477
|
/// Connect actual parameter to formal parameter of the start routine
|
|
1478
1478
|
if(SVFUtil::isa<PointerType>(actualParm->getType()) && SVFUtil::isa<PointerType>(formalParm->getType()) )
|
|
1479
1479
|
{
|
|
1480
|
-
CallICFGNode* icfgNode = pag->getICFG()->
|
|
1480
|
+
CallICFGNode* icfgNode = pag->getICFG()->getCallICFGNode(inst);
|
|
1481
1481
|
addThreadForkEdge(pag->getValueNode(actualParm), pag->getValueNode(formalParm),icfgNode);
|
|
1482
1482
|
}
|
|
1483
1483
|
}
|
|
@@ -1506,7 +1506,7 @@ void SVFIRBuilder::handleExtCall(CallSite cs, const SVFFunction *callee)
|
|
|
1506
1506
|
/// Connect actual parameter to formal parameter of the start routine
|
|
1507
1507
|
if(SVFUtil::isa<PointerType>(actualParm->getType()) && SVFUtil::isa<PointerType>(formalParm->getType()) )
|
|
1508
1508
|
{
|
|
1509
|
-
CallICFGNode* icfgNode = pag->getICFG()->
|
|
1509
|
+
CallICFGNode* icfgNode = pag->getICFG()->getCallICFGNode(inst);
|
|
1510
1510
|
addThreadForkEdge(pag->getValueNode(actualParm), pag->getValueNode(formalParm),icfgNode);
|
|
1511
1511
|
}
|
|
1512
1512
|
}
|
|
@@ -1528,7 +1528,7 @@ void SVFIRBuilder::handleExtCall(CallSite cs, const SVFFunction *callee)
|
|
|
1528
1528
|
*/
|
|
1529
1529
|
void SVFIRBuilder::handleIndCall(CallSite cs)
|
|
1530
1530
|
{
|
|
1531
|
-
const CallICFGNode* cbn = pag->getICFG()->
|
|
1531
|
+
const CallICFGNode* cbn = pag->getICFG()->getCallICFGNode(cs.getInstruction());
|
|
1532
1532
|
pag->addIndirectCallsites(cbn,pag->getValueNode(cs.getCalledValue()));
|
|
1533
1533
|
}
|
|
1534
1534
|
|
|
@@ -1618,7 +1618,7 @@ void SVFIRBuilder::setCurrentBBAndValueForPAGEdge(PAGEdge* edge)
|
|
|
1618
1618
|
edge->setValue(curVal);
|
|
1619
1619
|
// backmap in valuToEdgeMap
|
|
1620
1620
|
pag->mapValueToEdge(curVal, edge);
|
|
1621
|
-
ICFGNode* icfgNode = pag->getICFG()->
|
|
1621
|
+
ICFGNode* icfgNode = pag->getICFG()->getGlobalICFGNode();
|
|
1622
1622
|
if (const Instruction *curInst = SVFUtil::dyn_cast<Instruction>(curVal))
|
|
1623
1623
|
{
|
|
1624
1624
|
const Function* srcFun = edge->getSrcNode()->getFunction();
|
|
@@ -1637,23 +1637,23 @@ void SVFIRBuilder::setCurrentBBAndValueForPAGEdge(PAGEdge* edge)
|
|
|
1637
1637
|
/// We will have one unique function exit ICFGNode for all returns
|
|
1638
1638
|
if(const ReturnInst* retInst = SVFUtil::dyn_cast<ReturnInst>(curVal)){
|
|
1639
1639
|
const SVFFunction *fun = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(retInst->getParent()->getParent());
|
|
1640
|
-
icfgNode = pag->getICFG()->
|
|
1640
|
+
icfgNode = pag->getICFG()->getFunExitICFGNode(fun);
|
|
1641
1641
|
}
|
|
1642
1642
|
else
|
|
1643
|
-
icfgNode = pag->getICFG()->
|
|
1643
|
+
icfgNode = pag->getICFG()->getICFGNode(curInst);
|
|
1644
1644
|
}
|
|
1645
1645
|
else if (const Argument* arg = SVFUtil::dyn_cast<Argument>(curVal))
|
|
1646
1646
|
{
|
|
1647
1647
|
assert(curBB && (&curBB->getParent()->getEntryBlock() == curBB));
|
|
1648
1648
|
const SVFFunction* fun = LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(arg->getParent());
|
|
1649
|
-
icfgNode = pag->getICFG()->
|
|
1649
|
+
icfgNode = pag->getICFG()->getFunEntryICFGNode(fun);
|
|
1650
1650
|
}
|
|
1651
1651
|
else if (SVFUtil::isa<ConstantExpr>(curVal))
|
|
1652
1652
|
{
|
|
1653
1653
|
if (!curBB)
|
|
1654
1654
|
pag->addGlobalPAGEdge(edge);
|
|
1655
1655
|
else
|
|
1656
|
-
icfgNode = pag->getICFG()->
|
|
1656
|
+
icfgNode = pag->getICFG()->getICFGNode(&curBB->front());
|
|
1657
1657
|
}
|
|
1658
1658
|
else if (SVFUtil::isa<GlobalVariable>(curVal) ||
|
|
1659
1659
|
SVFUtil::isa<Function>(curVal) ||
|
package/lib/WPA/Andersen.cpp
CHANGED
|
@@ -654,7 +654,7 @@ bool Andersen::updateCallGraph(const CallSiteToFunPtrMap& callsites)
|
|
|
654
654
|
void Andersen::heapAllocatorViaIndCall(CallSite cs, NodePairSet &cpySrcNodes)
|
|
655
655
|
{
|
|
656
656
|
assert(SVFUtil::getCallee(cs) == nullptr && "not an indirect callsite?");
|
|
657
|
-
RetICFGNode* retBlockNode = pag->getICFG()->
|
|
657
|
+
RetICFGNode* retBlockNode = pag->getICFG()->getRetICFGNode(cs.getInstruction());
|
|
658
658
|
const PAGNode* cs_return = pag->getCallSiteRet(retBlockNode);
|
|
659
659
|
NodeID srcret;
|
|
660
660
|
CallSite2DummyValPN::const_iterator it = callsite2DummyValPN.find(cs);
|
|
@@ -687,8 +687,8 @@ void Andersen::connectCaller2CalleeParams(CallSite cs, const SVFFunction* F, Nod
|
|
|
687
687
|
|
|
688
688
|
DBOUT(DAndersen, outs() << "connect parameters from indirect callsite " << *cs.getInstruction() << " to callee " << *F << "\n");
|
|
689
689
|
|
|
690
|
-
CallICFGNode* callBlockNode = pag->getICFG()->
|
|
691
|
-
RetICFGNode* retBlockNode = pag->getICFG()->
|
|
690
|
+
CallICFGNode* callBlockNode = pag->getICFG()->getCallICFGNode(cs.getInstruction());
|
|
691
|
+
RetICFGNode* retBlockNode = pag->getICFG()->getRetICFGNode(cs.getInstruction());
|
|
692
692
|
|
|
693
693
|
if(SVFUtil::isHeapAllocExtFunViaRet(F) && pag->callsiteHasRet(retBlockNode))
|
|
694
694
|
{
|
package/lib/WPA/WPAPass.cpp
CHANGED
|
@@ -239,7 +239,7 @@ ModRefInfo WPAPass::getModRefInfo(const CallInst* callInst)
|
|
|
239
239
|
{
|
|
240
240
|
assert(Options::PASelected.isSet(PointerAnalysis::AndersenWaveDiff_WPA) && Options::AnderSVFG && "mod-ref query is only support with -ander and -svfg turned on");
|
|
241
241
|
ICFG* icfg = _svfg->getPAG()->getICFG();
|
|
242
|
-
const CallICFGNode* cbn = icfg->
|
|
242
|
+
const CallICFGNode* cbn = icfg->getCallICFGNode(callInst);
|
|
243
243
|
return _svfg->getMSSA()->getMRGenerator()->getModRefInfo(cbn);
|
|
244
244
|
}
|
|
245
245
|
|
|
@@ -250,7 +250,7 @@ ModRefInfo WPAPass::getModRefInfo(const CallInst* callInst, const Value* V)
|
|
|
250
250
|
{
|
|
251
251
|
assert(Options::PASelected.isSet(PointerAnalysis::AndersenWaveDiff_WPA) && Options::AnderSVFG && "mod-ref query is only support with -ander and -svfg turned on");
|
|
252
252
|
ICFG* icfg = _svfg->getPAG()->getICFG();
|
|
253
|
-
const CallICFGNode* cbn = icfg->
|
|
253
|
+
const CallICFGNode* cbn = icfg->getCallICFGNode(callInst);
|
|
254
254
|
return _svfg->getMSSA()->getMRGenerator()->getModRefInfo(cbn, V);
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -261,7 +261,7 @@ ModRefInfo WPAPass::getModRefInfo(const CallInst* callInst1, const CallInst* cal
|
|
|
261
261
|
{
|
|
262
262
|
assert(Options::PASelected.isSet(PointerAnalysis::AndersenWaveDiff_WPA) && Options::AnderSVFG && "mod-ref query is only support with -ander and -svfg turned on");
|
|
263
263
|
ICFG* icfg = _svfg->getPAG()->getICFG();
|
|
264
|
-
const CallICFGNode* cbn1 = icfg->
|
|
265
|
-
const CallICFGNode* cbn2 = icfg->
|
|
264
|
+
const CallICFGNode* cbn1 = icfg->getCallICFGNode(callInst1);
|
|
265
|
+
const CallICFGNode* cbn2 = icfg->getCallICFGNode(callInst2);
|
|
266
266
|
return _svfg->getMSSA()->getMRGenerator()->getModRefInfo(cbn1, cbn2);
|
|
267
267
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.359",
|
|
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/tools/Example/svf-ex.cpp
CHANGED
|
@@ -79,7 +79,7 @@ std::string printPts(PointerAnalysis* pta, Value* val)
|
|
|
79
79
|
*/
|
|
80
80
|
void traverseOnICFG(ICFG* icfg, const Instruction* inst)
|
|
81
81
|
{
|
|
82
|
-
ICFGNode* iNode = icfg->
|
|
82
|
+
ICFGNode* iNode = icfg->getICFGNode(inst);
|
|
83
83
|
FIFOWorkList<const ICFGNode*> worklist;
|
|
84
84
|
Set<const ICFGNode*> visited;
|
|
85
85
|
worklist.push(iNode);
|