svf-tools 1.0.358 → 1.0.362
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/ConsG_8cpp_source.html +7 -7
- package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/FlowSensitiveTBHC_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/FlowSensitive_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/Graph2Json_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 +25 -25
- package/SVF-doxygen/html/html/ICFG_8h_source.html +17 -18
- package/SVF-doxygen/html/html/IRGraph_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/LeakChecker_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/LocationSet_8h_source.html +1 -1
- 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/PAGBuilderFromFile_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 +6 -6
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +12 -12
- package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +13 -13
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +13 -13
- package/SVF-doxygen/html/html/SVFStatements_8h_source.html +91 -89
- package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +2 -1
- 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/VFGNode_8h_source.html +7 -7
- package/SVF-doxygen/html/html/VFG_8cpp_source.html +17 -17
- package/SVF-doxygen/html/html/VFG_8h_source.html +16 -16
- 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_1BinaryOPStmt.html +15 -15
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt.html +30 -30
- package/SVF-doxygen/html/html/classSVF_1_1BranchVFGNode.html +3 -3
- 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_1CallPE.html +15 -15
- package/SVF-doxygen/html/html/classSVF_1_1CmpStmt.html +16 -16
- package/SVF-doxygen/html/html/classSVF_1_1ConstraintGraph.html +7 -7
- package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveTBHC.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1ForkJoinAnalysis.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1GepStmt-members.html +7 -5
- package/SVF-doxygen/html/html/classSVF_1_1GepStmt.html +80 -12
- package/SVF-doxygen/html/html/classSVF_1_1ICFG-members.html +22 -22
- package/SVF-doxygen/html/html/classSVF_1_1ICFG.html +236 -235
- 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 +18 -18
- package/SVF-doxygen/html/html/classSVF_1_1LeakChecker.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet.html +2 -1
- 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_1MultiOpndStmt.html +25 -25
- package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +2 -2
- 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_1PhiStmt.html +15 -15
- 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_1RetPE.html +15 -15
- 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 +17 -17
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +27 -27
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +2 -2
- 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_1TDForkPE.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1TDJoinPE.html +9 -9
- package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraphBuilder.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1UnaryOPStmt.html +20 -20
- package/SVF-doxygen/html/html/classSVF_1_1VFG.html +29 -29
- 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 +36 -42
- package/SVF-doxygen/html/html/functions_func_i.html +9 -8
- package/SVF-doxygen/html/html/functions_g.html +34 -40
- package/SVF-doxygen/html/html/functions_i.html +12 -11
- 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 +13 -16
- package/SVF-doxygen/html/html/search/all_9.js +1 -1
- 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 +13 -16
- package/SVF-doxygen/html/html/search/functions_8.js +1 -1
- 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/structllvm_1_1DOTGraphTraits_3_01ICFG_01_5_01_4.html +16 -16
- package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01IRGraph_01_5_01_4.html +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/LocationSet.h +1 -1
- package/include/MemoryModel/SVFIR.h +2 -2
- package/include/MemoryModel/SVFStatements.h +11 -3
- package/include/SVF-FE/ICFGBuilder.h +5 -5
- package/include/SVF-FE/SVFIRBuilder.h +1 -1
- package/lib/Graphs/ICFG.cpp +37 -32
- 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 +15 -27
- package/lib/SVF-FE/SVFIRBuilder.cpp +15 -15
- package/lib/SVF-FE/SymbolTableBuilder.cpp +1 -1
- 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
|
@@ -84,20 +84,20 @@ private:
|
|
|
84
84
|
void addICFGInterEdges(const Instruction* cs, const SVFFunction* callee);
|
|
85
85
|
|
|
86
86
|
/// Add a call node
|
|
87
|
-
inline CallICFGNode*
|
|
87
|
+
inline CallICFGNode* getCallICFGNode(const Instruction* cs)
|
|
88
88
|
{
|
|
89
|
-
return icfg->
|
|
89
|
+
return icfg->getCallICFGNode(cs);
|
|
90
90
|
}
|
|
91
91
|
/// Add a return node
|
|
92
|
-
inline RetICFGNode*
|
|
92
|
+
inline RetICFGNode* getRetICFGNode(const Instruction* cs)
|
|
93
93
|
{
|
|
94
|
-
return icfg->
|
|
94
|
+
return icfg->getRetICFGNode(cs);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/// Add and get IntraBlock ICFGNode
|
|
98
98
|
IntraICFGNode* getOrAddIntraBlockICFGNode(const Instruction* inst)
|
|
99
99
|
{
|
|
100
|
-
return icfg->
|
|
100
|
+
return icfg->getIntraICFGNode(inst);
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
103
|
|
|
@@ -348,7 +348,7 @@ public:
|
|
|
348
348
|
{
|
|
349
349
|
IntraICFGNode* node;
|
|
350
350
|
if(const Instruction* inst = SVFUtil::dyn_cast<Instruction>(curVal))
|
|
351
|
-
node = pag->getICFG()->
|
|
351
|
+
node = pag->getICFG()->getIntraICFGNode(inst);
|
|
352
352
|
else
|
|
353
353
|
node = nullptr;
|
|
354
354
|
StoreStmt *edge = pag->addStoreStmt(src, dst, node);
|
package/lib/Graphs/ICFG.cpp
CHANGED
|
@@ -190,69 +190,69 @@ ICFG::ICFG(): totalICFGNode(0)
|
|
|
190
190
|
|
|
191
191
|
|
|
192
192
|
/// Get a basic block ICFGNode
|
|
193
|
-
ICFGNode* ICFG::
|
|
193
|
+
ICFGNode* ICFG::getICFGNode(const Instruction* inst)
|
|
194
194
|
{
|
|
195
195
|
ICFGNode* node;
|
|
196
196
|
if(SVFUtil::isNonInstricCallSite(inst))
|
|
197
|
-
node =
|
|
197
|
+
node = getCallICFGNode(inst);
|
|
198
198
|
else if(SVFUtil::isIntrinsicInst(inst))
|
|
199
|
-
node =
|
|
199
|
+
node = getIntraICFGNode(inst);
|
|
200
200
|
// assert (false && "associating an intrinsic instruction with an ICFGNode!");
|
|
201
201
|
else
|
|
202
|
-
node =
|
|
202
|
+
node = getIntraICFGNode(inst);
|
|
203
203
|
|
|
204
204
|
assert (node!=nullptr && "no ICFGNode for this instruction?");
|
|
205
205
|
return node;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
|
|
209
|
-
CallICFGNode* ICFG::
|
|
209
|
+
CallICFGNode* ICFG::getCallICFGNode(const Instruction* inst)
|
|
210
210
|
{
|
|
211
211
|
if(SVFUtil::isCallSite(inst) ==false)
|
|
212
212
|
outs() << *inst << "\n";
|
|
213
213
|
assert(SVFUtil::isCallSite(inst) && "not a call instruction?");
|
|
214
214
|
assert(SVFUtil::isNonInstricCallSite(inst) && "associating an intrinsic debug instruction with an ICFGNode!");
|
|
215
|
-
CallICFGNode* node =
|
|
215
|
+
CallICFGNode* node = getCallBlock(inst);
|
|
216
216
|
if(node==nullptr)
|
|
217
|
-
node =
|
|
217
|
+
node = addCallBlock(inst);
|
|
218
218
|
assert (node!=nullptr && "no CallICFGNode for this instruction?");
|
|
219
219
|
return node;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
RetICFGNode* ICFG::
|
|
222
|
+
RetICFGNode* ICFG::getRetICFGNode(const Instruction* inst)
|
|
223
223
|
{
|
|
224
224
|
assert(SVFUtil::isCallSite(inst) && "not a call instruction?");
|
|
225
225
|
assert(SVFUtil::isNonInstricCallSite(inst) && "associating an intrinsic debug instruction with an ICFGNode!");
|
|
226
|
-
RetICFGNode* node =
|
|
226
|
+
RetICFGNode* node = getRetBlock(inst);
|
|
227
227
|
if(node==nullptr)
|
|
228
|
-
node =
|
|
228
|
+
node = addRetBlock(inst);
|
|
229
229
|
assert (node!=nullptr && "no RetICFGNode for this instruction?");
|
|
230
230
|
return node;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
IntraICFGNode* ICFG::
|
|
233
|
+
IntraICFGNode* ICFG::getIntraICFGNode(const Instruction* inst)
|
|
234
234
|
{
|
|
235
|
-
IntraICFGNode* node =
|
|
235
|
+
IntraICFGNode* node = getIntraBlock(inst);
|
|
236
236
|
if(node==nullptr)
|
|
237
|
-
node =
|
|
237
|
+
node = addIntraBlock(inst);
|
|
238
238
|
return node;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
/// Add a function entry node
|
|
242
|
-
FunEntryICFGNode* ICFG::
|
|
242
|
+
FunEntryICFGNode* ICFG::getFunEntryICFGNode(const SVFFunction* fun)
|
|
243
243
|
{
|
|
244
|
-
FunEntryICFGNode* b =
|
|
244
|
+
FunEntryICFGNode* b = getFunEntryBlock(fun);
|
|
245
245
|
if (b == nullptr)
|
|
246
|
-
return
|
|
246
|
+
return addFunEntryBlock(fun);
|
|
247
247
|
else
|
|
248
248
|
return b;
|
|
249
249
|
}
|
|
250
250
|
/// Add a function exit node
|
|
251
|
-
FunExitICFGNode* ICFG::
|
|
251
|
+
FunExitICFGNode* ICFG::getFunExitICFGNode(const SVFFunction* fun)
|
|
252
252
|
{
|
|
253
|
-
FunExitICFGNode* b =
|
|
253
|
+
FunExitICFGNode* b = getFunExitBlock(fun);
|
|
254
254
|
if (b == nullptr)
|
|
255
|
-
return
|
|
255
|
+
return addFunExitBlock(fun);
|
|
256
256
|
else
|
|
257
257
|
return b;
|
|
258
258
|
}
|
|
@@ -436,20 +436,25 @@ void ICFG::updateCallGraph(PTACallGraph* callgraph)
|
|
|
436
436
|
for (PTACallGraph::FunctionSet::const_iterator func_iter = functions.begin(); func_iter != functions.end(); func_iter++)
|
|
437
437
|
{
|
|
438
438
|
const SVFFunction* callee = *func_iter;
|
|
439
|
-
CallICFGNode*
|
|
440
|
-
RetICFGNode* retBlockNode =
|
|
441
|
-
|
|
442
|
-
FunExitICFGNode* calleeExitNode = getFunExitICFGNode(callee);
|
|
443
|
-
addCallEdge(callBlockNode, calleeEntryNode, cs);
|
|
444
|
-
addRetEdge(calleeExitNode, retBlockNode, cs);
|
|
445
|
-
|
|
446
|
-
/// if this is an external function (no function body), connect calleeEntryNode to calleeExitNode
|
|
439
|
+
CallICFGNode* callICFGNode = getCallICFGNode(cs);
|
|
440
|
+
RetICFGNode* retBlockNode = getRetICFGNode(cs);
|
|
441
|
+
/// if this is an external function (no function body or specified in ExAPI.cpp)
|
|
447
442
|
if (isExtCall(callee))
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
443
|
+
{
|
|
444
|
+
addIntraEdge(callICFGNode, retBlockNode);
|
|
445
|
+
}
|
|
446
|
+
/// otherwise connect interprocedural edges
|
|
447
|
+
else
|
|
448
|
+
{
|
|
449
|
+
FunEntryICFGNode* calleeEntryNode = getFunEntryICFGNode(callee);
|
|
450
|
+
FunExitICFGNode* calleeExitNode = getFunExitICFGNode(callee);
|
|
451
|
+
addCallEdge(callICFGNode, calleeEntryNode, cs);
|
|
452
|
+
addRetEdge(calleeExitNode, retBlockNode, cs);
|
|
453
|
+
|
|
454
|
+
/// Remove callBlockNode to retBlockNode intraICFGEdge since we found at least one inter procedural edge
|
|
455
|
+
if(ICFGEdge* edge = hasIntraICFGEdge(callICFGNode,retBlockNode, ICFGEdge::IntraCF))
|
|
456
|
+
removeICFGEdge(edge);
|
|
457
|
+
}
|
|
453
458
|
}
|
|
454
459
|
}
|
|
455
460
|
// dump ICFG
|
package/lib/Graphs/SVFG.cpp
CHANGED
|
@@ -242,7 +242,7 @@ void SVFG::addSVFGNodesForAddrTakenVars()
|
|
|
242
242
|
{
|
|
243
243
|
for(PHISet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi){
|
|
244
244
|
MemSSA::PHI* phi = *pi;
|
|
245
|
-
addIntraMSSAPHISVFGNode(pag->getICFG()->
|
|
245
|
+
addIntraMSSAPHISVFGNode(pag->getICFG()->getICFGNode(&(phi->getBasicBlock()->front())), phi->opVerBegin(), phi->opVerEnd(),phi->getResVer(), totalVFGNode++);
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
/// initialize memory SSA entry chi nodes
|
|
@@ -251,7 +251,7 @@ void SVFG::addSVFGNodesForAddrTakenVars()
|
|
|
251
251
|
{
|
|
252
252
|
for(CHISet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi){
|
|
253
253
|
const MemSSA::ENTRYCHI* chi = SVFUtil::cast<ENTRYCHI>(*pi);
|
|
254
|
-
addFormalINSVFGNode(pag->getICFG()->
|
|
254
|
+
addFormalINSVFGNode(pag->getICFG()->getFunEntryICFGNode(chi->getFunction()), chi->getResVer(), totalVFGNode++);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
/// initialize memory SSA return mu nodes
|
|
@@ -260,7 +260,7 @@ void SVFG::addSVFGNodesForAddrTakenVars()
|
|
|
260
260
|
{
|
|
261
261
|
for(MUSet::iterator pi = it->second.begin(), epi = it->second.end(); pi!=epi; ++pi){
|
|
262
262
|
const MemSSA::RETMU* mu = SVFUtil::cast<RETMU>(*pi);
|
|
263
|
-
addFormalOUTSVFGNode(pag->getICFG()->
|
|
263
|
+
addFormalOUTSVFGNode(pag->getICFG()->getFunExitICFGNode(mu->getFunction()), mu->getMRVer(), totalVFGNode++);
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
/// initialize memory SSA callsite mu nodes
|
|
@@ -567,7 +567,7 @@ std::set<const SVFGNode*> SVFG::fromValue(const llvm::Value* value) const
|
|
|
567
567
|
void SVFG::getInterVFEdgesForIndirectCallSite(const CallICFGNode* callBlockNode, const SVFFunction* callee, SVFGEdgeSetTy& edges)
|
|
568
568
|
{
|
|
569
569
|
CallSiteID csId = getCallSiteID(callBlockNode, callee);
|
|
570
|
-
RetICFGNode* retBlockNode = pag->getICFG()->
|
|
570
|
+
RetICFGNode* retBlockNode = pag->getICFG()->getRetICFGNode(callBlockNode->getCallSite());
|
|
571
571
|
|
|
572
572
|
// Find inter direct call edges between actual param and formal param.
|
|
573
573
|
if (pag->hasCallSiteArgsMap(callBlockNode) && pag->hasFunArgsList(callee))
|
package/lib/Graphs/VFG.cpp
CHANGED
|
@@ -407,7 +407,7 @@ void VFG::addVFGNodes()
|
|
|
407
407
|
if(isInterestedPAGNode(it->second) == false || hasDef(it->second))
|
|
408
408
|
continue;
|
|
409
409
|
|
|
410
|
-
addActualRetVFGNode(it->second,it->first->
|
|
410
|
+
addActualRetVFGNode(it->second,it->first->getCallICFGNode());
|
|
411
411
|
}
|
|
412
412
|
|
|
413
413
|
// initialize formal parameter nodes
|
|
@@ -674,7 +674,7 @@ void VFG::connectDirectVFGEdges()
|
|
|
674
674
|
{
|
|
675
675
|
ActualRetVFGNode* callsiteRev = getActualRetVFGNode((*it)->getLHSVar());
|
|
676
676
|
const CallICFGNode* retBlockNode = (*it)->getCallSite();
|
|
677
|
-
CallICFGNode* callBlockNode = pag->getICFG()->
|
|
677
|
+
CallICFGNode* callBlockNode = pag->getICFG()->getCallICFGNode(retBlockNode->getCallSite());
|
|
678
678
|
addInterEdgeFromFRToAR(calleeRet,callsiteRev, getCallSiteID(callBlockNode, calleeRet->getFun()));
|
|
679
679
|
}
|
|
680
680
|
}
|
|
@@ -813,7 +813,7 @@ void VFG::connectCallerAndCallee(const CallICFGNode* callBlockNode, const SVFFun
|
|
|
813
813
|
SVFIR * pag = SVFIR::getPAG();
|
|
814
814
|
ICFG * icfg = pag->getICFG();
|
|
815
815
|
CallSiteID csId = getCallSiteID(callBlockNode, callee);
|
|
816
|
-
RetICFGNode* retBlockNode = icfg->
|
|
816
|
+
RetICFGNode* retBlockNode = icfg->getRetICFGNode(callBlockNode->getCallSite());
|
|
817
817
|
// connect actual and formal param
|
|
818
818
|
if (pag->hasCallSiteArgsMap(callBlockNode) && pag->hasFunArgsList(callee))
|
|
819
819
|
{
|
package/lib/MSSA/MemRegion.cpp
CHANGED
|
@@ -152,18 +152,18 @@ bool MRGenerator::hasSVFStmtList(const Instruction* inst)
|
|
|
152
152
|
{
|
|
153
153
|
SVFIR* pag = pta->getPAG();
|
|
154
154
|
if (ptrOnlyMSSA)
|
|
155
|
-
return pag->hasPTASVFStmtList(pag->getICFG()->
|
|
155
|
+
return pag->hasPTASVFStmtList(pag->getICFG()->getICFGNode(inst));
|
|
156
156
|
else
|
|
157
|
-
return pag->hasSVFStmtList(pag->getICFG()->
|
|
157
|
+
return pag->hasSVFStmtList(pag->getICFG()->getICFGNode(inst));
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
SVFIR::SVFStmtList& MRGenerator::getPAGEdgesFromInst(const Instruction* inst)
|
|
161
161
|
{
|
|
162
162
|
SVFIR* pag = pta->getPAG();
|
|
163
163
|
if (ptrOnlyMSSA)
|
|
164
|
-
return pag->getPTASVFStmtList(pag->getICFG()->
|
|
164
|
+
return pag->getPTASVFStmtList(pag->getICFG()->getICFGNode(inst));
|
|
165
165
|
else
|
|
166
|
-
return pag->getSVFStmtList(pag->getICFG()->
|
|
166
|
+
return pag->getSVFStmtList(pag->getICFG()->getICFGNode(inst));
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
/*!
|
|
@@ -259,7 +259,7 @@ void MRGenerator::collectModRefForCall()
|
|
|
259
259
|
|
|
260
260
|
for (CallSite cs : SymbolTableInfo::SymbolInfo()->getCallSiteSet())
|
|
261
261
|
{
|
|
262
|
-
const CallICFGNode* callBlockNode = pta->getPAG()->getICFG()->
|
|
262
|
+
const CallICFGNode* callBlockNode = pta->getPAG()->getICFG()->getCallICFGNode(cs.getInstruction());
|
|
263
263
|
if(hasRefSideEffectOfCallSite(callBlockNode))
|
|
264
264
|
{
|
|
265
265
|
NodeBS refs = getRefSideEffectOfCallSite(callBlockNode);
|
|
@@ -481,8 +481,8 @@ void MRGenerator::collectCallSitePts(const CallICFGNode* cs)
|
|
|
481
481
|
/// collect the pts chain of the callsite arguments
|
|
482
482
|
NodeBS& argsPts = csToCallSiteArgsPtsMap[cs];
|
|
483
483
|
SVFIR* pag = pta->getPAG();
|
|
484
|
-
CallICFGNode* callBlockNode = pag->getICFG()->
|
|
485
|
-
RetICFGNode* retBlockNode = pag->getICFG()->
|
|
484
|
+
CallICFGNode* callBlockNode = pag->getICFG()->getCallICFGNode(cs->getCallSite());
|
|
485
|
+
RetICFGNode* retBlockNode = pag->getICFG()->getRetICFGNode(cs->getCallSite());
|
|
486
486
|
|
|
487
487
|
WorkList worklist;
|
|
488
488
|
if (pag->hasCallSiteArgsMap(callBlockNode))
|
package/lib/MSSA/MemSSA.cpp
CHANGED
|
@@ -174,7 +174,7 @@ void MemSSA::createMUCHI(const SVFFunction& fun)
|
|
|
174
174
|
}
|
|
175
175
|
if (isNonInstricCallSite(inst))
|
|
176
176
|
{
|
|
177
|
-
const CallICFGNode* cs = pag->getICFG()->
|
|
177
|
+
const CallICFGNode* cs = pag->getICFG()->getCallICFGNode(inst);
|
|
178
178
|
if(mrGen->hasRefMRSet(cs))
|
|
179
179
|
AddCallSiteMU(cs,mrGen->getCallSiteRefMRSet(cs));
|
|
180
180
|
|
|
@@ -318,7 +318,7 @@ void MemSSA::SSARenameBB(const BasicBlock& bb)
|
|
|
318
318
|
}
|
|
319
319
|
if (isNonInstricCallSite(inst))
|
|
320
320
|
{
|
|
321
|
-
const CallICFGNode* cs = pag->getICFG()->
|
|
321
|
+
const CallICFGNode* cs = pag->getICFG()->getCallICFGNode(inst);
|
|
322
322
|
if(mrGen->hasRefMRSet(cs))
|
|
323
323
|
RenameMuSet(getMUSet(cs));
|
|
324
324
|
|
|
@@ -634,7 +634,7 @@ void MemSSA::dumpMSSA(raw_ostream& Out)
|
|
|
634
634
|
bool isAppCall = isNonInstricCallSite(&inst) && !isExtCall(&inst);
|
|
635
635
|
if (isAppCall || isHeapAllocExtCall(&inst))
|
|
636
636
|
{
|
|
637
|
-
const CallICFGNode* cs = pag->getICFG()->
|
|
637
|
+
const CallICFGNode* cs = pag->getICFG()->getCallICFGNode(&inst);
|
|
638
638
|
if(hasMU(cs))
|
|
639
639
|
{
|
|
640
640
|
if (!last_is_chi)
|
package/lib/MTA/LockAnalysis.cpp
CHANGED
|
@@ -406,7 +406,7 @@ void LockAnalysis::handleFork(const CxtStmt& cts)
|
|
|
406
406
|
{
|
|
407
407
|
const CallInst* call = SVFUtil::cast<CallInst>(cts.getStmt());
|
|
408
408
|
const CallStrCxt& curCxt = cts.getContext();
|
|
409
|
-
CallICFGNode* cbn = tct->
|
|
409
|
+
CallICFGNode* cbn = tct->getCallICFGNode(call);
|
|
410
410
|
if(getTCG()->hasThreadForkEdge(cbn))
|
|
411
411
|
{
|
|
412
412
|
for (ThreadCallGraph::ForkEdgeSet::const_iterator cgIt = getTCG()->getForkEdgeBegin(cbn),
|
|
@@ -429,7 +429,7 @@ void LockAnalysis::handleCall(const CxtStmt& cts)
|
|
|
429
429
|
|
|
430
430
|
const CallInst* call = SVFUtil::cast<CallInst>(cts.getStmt());
|
|
431
431
|
const CallStrCxt& curCxt = cts.getContext();
|
|
432
|
-
CallICFGNode* cbn = tct->
|
|
432
|
+
CallICFGNode* cbn = tct->getCallICFGNode(call);
|
|
433
433
|
if (getTCG()->hasCallGraphEdge(cbn))
|
|
434
434
|
{
|
|
435
435
|
for (PTACallGraph::CallGraphEdgeSet::const_iterator cgIt = getTCG()->getCallEdgeBegin(cbn), ecgIt = getTCG()->getCallEdgeEnd(cbn);
|
|
@@ -518,7 +518,7 @@ void LockAnalysis::pushCxt(CallStrCxt& cxt, const Instruction* call, const Funct
|
|
|
518
518
|
const Function* caller = call->getParent()->getParent();
|
|
519
519
|
const SVFFunction* svfcallee = tct->getSVFFun(callee);
|
|
520
520
|
const SVFFunction* svfcaller = tct->getSVFFun(caller);
|
|
521
|
-
CallICFGNode* cbn = tct->
|
|
521
|
+
CallICFGNode* cbn = tct->getCallICFGNode(call);
|
|
522
522
|
CallSiteID csId = getTCG()->getCallSiteID(cbn, svfcallee);
|
|
523
523
|
|
|
524
524
|
// /// handle calling context for candidate functions only
|
|
@@ -537,7 +537,7 @@ bool LockAnalysis::matchCxt(CallStrCxt& cxt, const Instruction* call, const Func
|
|
|
537
537
|
const Function* caller = call->getParent()->getParent();
|
|
538
538
|
const SVFFunction* svfcallee = tct->getSVFFun(callee);
|
|
539
539
|
const SVFFunction* svfcaller = tct->getSVFFun(caller);
|
|
540
|
-
CallICFGNode* cbn = tct->
|
|
540
|
+
CallICFGNode* cbn = tct->getCallICFGNode(call);
|
|
541
541
|
CallSiteID csId = getTCG()->getCallSiteID(cbn, svfcallee);
|
|
542
542
|
|
|
543
543
|
// /// handle calling context for candidate functions only
|
|
@@ -96,7 +96,7 @@ CallStrCxt MTAResultValidator::getCxtArg(const Instruction* inst, unsigned int a
|
|
|
96
96
|
const SVFFunction* callee = SVFUtil::getFunction(y[1]);
|
|
97
97
|
CallSite cs = SVFUtil::getLLVMCallSite(csnumToInstMap[atoi(y[0].c_str())]);
|
|
98
98
|
assert(callee && "callee error");
|
|
99
|
-
CallICFGNode* cbn = mhp->getTCT()->
|
|
99
|
+
CallICFGNode* cbn = mhp->getTCT()->getCallICFGNode(cs.getInstruction());
|
|
100
100
|
CallSiteID csId = tcg->getCallSiteID(cbn, callee);
|
|
101
101
|
cxt.push_back(csId);
|
|
102
102
|
}
|
package/lib/MTA/PCG.cpp
CHANGED
|
@@ -206,7 +206,7 @@ void PCG::identifyFollowers()
|
|
|
206
206
|
// if this is an call/invoke instruction but not a spawn site
|
|
207
207
|
if ((SVFUtil::isa<CallInst>(inst) || SVFUtil::isa<InvokeInst>(inst)) && !isSpawnsite(inst))
|
|
208
208
|
{
|
|
209
|
-
CallICFGNode* cbn =
|
|
209
|
+
CallICFGNode* cbn = getCallICFGNode(inst);
|
|
210
210
|
if (callgraph->hasCallGraphEdge(cbn))
|
|
211
211
|
{
|
|
212
212
|
for (PTACallGraph::CallGraphEdgeSet::const_iterator cgIt = callgraph->getCallEdgeBegin(cbn),
|
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,28 +171,28 @@ InterICFGNode* ICFGBuilder::getOrAddInterBlockICFGNode(const Instruction* inst)
|
|
|
171
171
|
*/
|
|
172
172
|
void ICFGBuilder::addICFGInterEdges(const Instruction* cs, const SVFFunction* callee)
|
|
173
173
|
{
|
|
174
|
-
CallICFGNode*
|
|
175
|
-
RetICFGNode* retBlockNode =
|
|
174
|
+
CallICFGNode* callICFGNode = getCallICFGNode(cs);
|
|
175
|
+
RetICFGNode* retBlockNode = getRetICFGNode(cs);
|
|
176
176
|
|
|
177
177
|
/// direct call
|
|
178
178
|
if(callee){
|
|
179
179
|
/// if this is an external function (no function body)
|
|
180
180
|
if (isExtCall(callee))
|
|
181
181
|
{
|
|
182
|
-
icfg->addIntraEdge(
|
|
182
|
+
icfg->addIntraEdge(callICFGNode, retBlockNode);
|
|
183
183
|
}
|
|
184
184
|
/// otherwise connect interprocedural edges
|
|
185
185
|
else
|
|
186
186
|
{
|
|
187
|
-
FunEntryICFGNode* calleeEntryNode = icfg->
|
|
188
|
-
FunExitICFGNode* calleeExitNode = icfg->
|
|
189
|
-
icfg->addCallEdge(
|
|
187
|
+
FunEntryICFGNode* calleeEntryNode = icfg->getFunEntryICFGNode(callee);
|
|
188
|
+
FunExitICFGNode* calleeExitNode = icfg->getFunExitICFGNode(callee);
|
|
189
|
+
icfg->addCallEdge(callICFGNode, calleeEntryNode, cs);
|
|
190
190
|
icfg->addRetEdge(calleeExitNode, retBlockNode, cs);
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
/// indirect call (don't know callee)
|
|
194
194
|
else{
|
|
195
|
-
icfg->addIntraEdge(
|
|
195
|
+
icfg->addIntraEdge(callICFGNode, retBlockNode);
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
/*
|
|
@@ -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
|
|