svf-tools 1.0.355 → 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/AndersenSFR_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/Andersen_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/CHGBuilder_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/CallGraphBuilder_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/ConsG_8h_source.html +2 -2
- package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +6 -6
- package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/ICFGBuilder_8cpp_source.html +2 -4
- package/SVF-doxygen/html/html/ICFGBuilder_8h_source.html +7 -7
- 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/IRGraph_8h_source.html +2 -2
- package/SVF-doxygen/html/html/LeakChecker_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/LocationSet_8cpp_source.html +12 -12
- 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 +10 -10
- package/SVF-doxygen/html/html/MemSSA_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PAGBuilderFromFile_8cpp_source.html +1 -1
- 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/PTAStat_8cpp_source.html +15 -15
- package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +2 -2
- package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +8 -8
- package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +5 -5
- 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 +2 -2
- package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +2 -2
- package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +7 -7
- package/SVF-doxygen/html/html/SVFIR_8h_source.html +8 -8
- package/SVF-doxygen/html/html/SVFModule_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFStatements_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SVFStatements_8h_source.html +1 -1
- package/SVF-doxygen/html/html/SVFVariables_8h_source.html +5 -5
- package/SVF-doxygen/html/html/SaberSVFGBuilder_8cpp_source.html +1 -1
- package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +22 -22
- package/SVF-doxygen/html/html/SymbolTableBuilder_8h_source.html +1 -1
- package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +52 -50
- package/SVF-doxygen/html/html/SymbolTableInfo_8h_source.html +86 -83
- 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/ThreadCallGraph_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8cpp_source.html +3 -3
- package/SVF-doxygen/html/html/TypeBasedHeapCloning_8h_source.html +1 -1
- 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/VersionedFlowSensitiveStat_8cpp_source.html +3 -3
- 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_1AndersenSFR.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1BranchStmt.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +1 -1
- 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_1ContextDDA.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1ForkJoinAnalysis.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1GepStmt.html +1 -1
- 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 +48 -51
- 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_1IRGraph.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1LeakChecker.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1LocationSet.html +27 -29
- 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 +16 -16
- package/SVF-doxygen/html/html/classSVF_1_1MTAResultValidator.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1MemObj.html +87 -87
- package/SVF-doxygen/html/html/classSVF_1_1MemSSA.html +6 -6
- package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo.html +99 -99
- package/SVF-doxygen/html/html/classSVF_1_1ObjVar.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +1 -1
- 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_1PTAStat.html +16 -16
- package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +11 -11
- 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 +20 -20
- package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +31 -31
- package/SVF-doxygen/html/html/classSVF_1_1SVFModule.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +1 -1
- package/SVF-doxygen/html/html/classSVF_1_1StInfo-members.html +20 -15
- package/SVF-doxygen/html/html/classSVF_1_1StInfo.html +239 -89
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +35 -35
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo-members.html +6 -4
- package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo.html +178 -130
- 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_1ThreadCallGraph.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraphBuilder.html +2 -2
- package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +4 -4
- package/SVF-doxygen/html/html/classSVF_1_1VFG.html +16 -16
- package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +3 -3
- package/SVF-doxygen/html/html/classSVF_1_1WPAPass.html +6 -6
- package/SVF-doxygen/html/html/functions_a.html +13 -13
- package/SVF-doxygen/html/html/functions_e.html +3 -0
- package/SVF-doxygen/html/html/functions_f.html +15 -20
- package/SVF-doxygen/html/html/functions_func.html +13 -13
- package/SVF-doxygen/html/html/functions_func_g.html +51 -50
- package/SVF-doxygen/html/html/functions_func_s.html +8 -5
- package/SVF-doxygen/html/html/functions_g.html +45 -44
- package/SVF-doxygen/html/html/functions_i.html +3 -3
- package/SVF-doxygen/html/html/functions_l.html +6 -6
- package/SVF-doxygen/html/html/functions_n.html +6 -0
- package/SVF-doxygen/html/html/functions_p.html +9 -9
- package/SVF-doxygen/html/html/functions_r.html +2 -4
- package/SVF-doxygen/html/html/functions_s.html +22 -19
- package/SVF-doxygen/html/html/functions_t.html +7 -7
- package/SVF-doxygen/html/html/functions_vars_e.html +3 -0
- package/SVF-doxygen/html/html/functions_vars_f.html +0 -3
- package/SVF-doxygen/html/html/functions_vars_n.html +6 -0
- package/SVF-doxygen/html/html/search/all_1.js +6 -6
- package/SVF-doxygen/html/html/search/all_10.js +6 -6
- package/SVF-doxygen/html/html/search/all_12.js +2 -2
- package/SVF-doxygen/html/html/search/all_13.js +9 -8
- package/SVF-doxygen/html/html/search/all_14.js +4 -4
- package/SVF-doxygen/html/html/search/all_15.js +1 -1
- package/SVF-doxygen/html/html/search/all_16.js +1 -1
- package/SVF-doxygen/html/html/search/all_5.js +1 -0
- package/SVF-doxygen/html/html/search/all_6.js +0 -1
- package/SVF-doxygen/html/html/search/all_7.js +18 -19
- package/SVF-doxygen/html/html/search/all_9.js +1 -1
- package/SVF-doxygen/html/html/search/all_c.js +2 -2
- package/SVF-doxygen/html/html/search/all_d.js +1 -1
- package/SVF-doxygen/html/html/search/all_e.js +4 -2
- package/SVF-doxygen/html/html/search/functions_0.js +6 -6
- package/SVF-doxygen/html/html/search/functions_10.js +1 -0
- package/SVF-doxygen/html/html/search/functions_6.js +18 -19
- 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_15.js +1 -1
- package/SVF-doxygen/html/html/search/variables_5.js +1 -0
- package/SVF-doxygen/html/html/search/variables_6.js +0 -1
- package/SVF-doxygen/html/html/search/variables_d.js +1 -1
- package/SVF-doxygen/html/html/search/variables_e.js +3 -1
- 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 +7 -7
- 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/MemoryModel/SymbolTableInfo.h +37 -41
- 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/LocationSet.cpp +42 -37
- package/lib/MemoryModel/PointerAnalysis.cpp +1 -1
- package/lib/MemoryModel/SymbolTableInfo.cpp +71 -8
- package/lib/SABER/LeakChecker.cpp +3 -3
- package/lib/SVF-FE/CallGraphBuilder.cpp +4 -4
- package/lib/SVF-FE/ICFGBuilder.cpp +19 -27
- 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/include/Graphs/VFG.h
CHANGED
|
@@ -408,13 +408,13 @@ protected:
|
|
|
408
408
|
}
|
|
409
409
|
else
|
|
410
410
|
{
|
|
411
|
-
assert((it->second == node->getId()) && "a
|
|
411
|
+
assert((it->second == node->getId()) && "a SVFVar can only have unique definition ");
|
|
412
412
|
}
|
|
413
413
|
}
|
|
414
414
|
inline NodeID getDef(const PAGNode* pagNode) const
|
|
415
415
|
{
|
|
416
416
|
PAGNodeToDefMapTy::const_iterator it = PAGNodeToDefMap.find(pagNode);
|
|
417
|
-
assert(it!=PAGNodeToDefMap.end() && "
|
|
417
|
+
assert(it!=PAGNodeToDefMap.end() && "SVFVar does not have a definition??");
|
|
418
418
|
return it->second;
|
|
419
419
|
}
|
|
420
420
|
inline bool hasDef(const PAGNode* pagNode) const
|
|
@@ -479,7 +479,7 @@ protected:
|
|
|
479
479
|
inline void addNullPtrVFGNode(const PAGNode* pagNode)
|
|
480
480
|
{
|
|
481
481
|
NullPtrVFGNode* sNode = new NullPtrVFGNode(totalVFGNode++,pagNode);
|
|
482
|
-
addVFGNode(sNode, pag->getICFG()->
|
|
482
|
+
addVFGNode(sNode, pag->getICFG()->getGlobalICFGNode());
|
|
483
483
|
setDef(pagNode,sNode);
|
|
484
484
|
}
|
|
485
485
|
/// Add an Address VFG node
|
|
@@ -524,7 +524,7 @@ protected:
|
|
|
524
524
|
inline void addActualParmVFGNode(const PAGNode* aparm, const CallICFGNode* cs)
|
|
525
525
|
{
|
|
526
526
|
ActualParmVFGNode* sNode = new ActualParmVFGNode(totalVFGNode++,aparm,cs);
|
|
527
|
-
addVFGNode(sNode, pag->getICFG()->
|
|
527
|
+
addVFGNode(sNode, pag->getICFG()->getCallICFGNode(cs->getCallSite()));
|
|
528
528
|
PAGNodeToActualParmMap[std::make_pair(aparm->getId(),cs)] = sNode;
|
|
529
529
|
/// do not set def here, this node is not a variable definition
|
|
530
530
|
}
|
|
@@ -532,7 +532,7 @@ protected:
|
|
|
532
532
|
inline void addFormalParmVFGNode(const PAGNode* fparm, const SVFFunction* fun, CallPESet& callPEs)
|
|
533
533
|
{
|
|
534
534
|
FormalParmVFGNode* sNode = new FormalParmVFGNode(totalVFGNode++,fparm,fun);
|
|
535
|
-
addVFGNode(sNode, pag->getICFG()->
|
|
535
|
+
addVFGNode(sNode, pag->getICFG()->getFunEntryICFGNode(fun));
|
|
536
536
|
for(CallPESet::const_iterator it = callPEs.begin(), eit=callPEs.end();
|
|
537
537
|
it!=eit; ++it)
|
|
538
538
|
sNode->addCallPE(*it);
|
|
@@ -546,7 +546,7 @@ protected:
|
|
|
546
546
|
inline void addFormalRetVFGNode(const PAGNode* uniqueFunRet, const SVFFunction* fun, RetPESet& retPEs)
|
|
547
547
|
{
|
|
548
548
|
FormalRetVFGNode *sNode = new FormalRetVFGNode(totalVFGNode++, uniqueFunRet, fun);
|
|
549
|
-
addVFGNode(sNode, pag->getICFG()->
|
|
549
|
+
addVFGNode(sNode, pag->getICFG()->getFunExitICFGNode(fun));
|
|
550
550
|
for (RetPESet::const_iterator it = retPEs.begin(), eit = retPEs.end(); it != eit; ++it)
|
|
551
551
|
sNode->addRetPE(*it);
|
|
552
552
|
|
|
@@ -564,7 +564,7 @@ protected:
|
|
|
564
564
|
inline void addActualRetVFGNode(const PAGNode* ret,const CallICFGNode* cs)
|
|
565
565
|
{
|
|
566
566
|
ActualRetVFGNode* sNode = new ActualRetVFGNode(totalVFGNode++,ret,cs);
|
|
567
|
-
addVFGNode(sNode, pag->getICFG()->
|
|
567
|
+
addVFGNode(sNode, pag->getICFG()->getRetICFGNode(cs->getCallSite()));
|
|
568
568
|
setDef(ret,sNode);
|
|
569
569
|
PAGNodeToActualRetMap[ret] = sNode;
|
|
570
570
|
}
|
|
@@ -35,7 +35,7 @@ public:
|
|
|
35
35
|
private:
|
|
36
36
|
// Get CallICFGNode
|
|
37
37
|
inline CallICFGNode* getCBN(const Instruction* inst) {
|
|
38
|
-
return _la->getTCT()->
|
|
38
|
+
return _la->getTCT()->getCallICFGNode(inst);
|
|
39
39
|
}
|
|
40
40
|
const Instruction *getPreviousMemoryAccessInst( const Instruction *I) {
|
|
41
41
|
I = I->getPrevNode();
|
package/include/MTA/MHP.h
CHANGED
|
@@ -63,7 +63,7 @@ public:
|
|
|
63
63
|
|
|
64
64
|
// Get CallICFGNode
|
|
65
65
|
inline CallICFGNode* getCBN(const Instruction* inst) {
|
|
66
|
-
return tct->
|
|
66
|
+
return tct->getCallICFGNode(inst);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
/// Whether the function is connected from main function in thread call graph
|
|
@@ -381,7 +381,7 @@ private:
|
|
|
381
381
|
}
|
|
382
382
|
// Get CallICFGNode
|
|
383
383
|
inline CallICFGNode* getCBN(const Instruction* inst) {
|
|
384
|
-
return tct->
|
|
384
|
+
return tct->getCallICFGNode(inst);
|
|
385
385
|
}
|
|
386
386
|
/// Mark thread flags for cxtStmt
|
|
387
387
|
//@{
|
package/include/MTA/PCG.h
CHANGED
|
@@ -123,8 +123,8 @@ public:
|
|
|
123
123
|
{
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
-
CallICFGNode*
|
|
127
|
-
return pta->getICFG()->
|
|
126
|
+
CallICFGNode* getCallICFGNode(const Instruction* inst) {
|
|
127
|
+
return pta->getICFG()->getCallICFGNode(inst);
|
|
128
128
|
}
|
|
129
129
|
const SVFFunction* getSVFFun(const Function* fun) const {
|
|
130
130
|
return LLVMModuleSet::getLLVMModuleSet()->getSVFFunction(fun);
|
package/include/MTA/TCT.h
CHANGED
|
@@ -148,8 +148,8 @@ public:
|
|
|
148
148
|
destroy();
|
|
149
149
|
}
|
|
150
150
|
/// Get CallICFGNode given inst
|
|
151
|
-
CallICFGNode*
|
|
152
|
-
return pta->getICFG()->
|
|
151
|
+
CallICFGNode* getCallICFGNode(const Instruction* inst) {
|
|
152
|
+
return pta->getICFG()->getCallICFGNode(inst);
|
|
153
153
|
}
|
|
154
154
|
/// Get SVFFuntion given Function
|
|
155
155
|
const SVFFunction* getSVFFun(const Function* fun) const {
|
|
@@ -493,14 +493,14 @@ private:
|
|
|
493
493
|
/// Add function arguments
|
|
494
494
|
inline void addFunArgs(const SVFFunction* fun, const SVFVar* arg)
|
|
495
495
|
{
|
|
496
|
-
FunEntryICFGNode* funEntryBlockNode = icfg->
|
|
496
|
+
FunEntryICFGNode* funEntryBlockNode = icfg->getFunEntryICFGNode(fun);
|
|
497
497
|
funEntryBlockNode->addFormalParms(arg);
|
|
498
498
|
funArgsListMap[fun].push_back(arg);
|
|
499
499
|
}
|
|
500
500
|
/// Add function returns
|
|
501
501
|
inline void addFunRet(const SVFFunction* fun, const SVFVar* ret)
|
|
502
502
|
{
|
|
503
|
-
FunExitICFGNode* funExitBlockNode = icfg->
|
|
503
|
+
FunExitICFGNode* funExitBlockNode = icfg->getFunExitICFGNode(fun);
|
|
504
504
|
funExitBlockNode->addFormalRet(ret);
|
|
505
505
|
funRetMap[fun] = ret;
|
|
506
506
|
}
|
|
@@ -344,18 +344,7 @@ public:
|
|
|
344
344
|
/// Get struct info
|
|
345
345
|
//@{
|
|
346
346
|
///Get an iterator for StructInfo, designed as internal methods
|
|
347
|
-
TypeToFieldInfoMap::iterator getStructInfoIter(const Type *T)
|
|
348
|
-
{
|
|
349
|
-
assert(T);
|
|
350
|
-
TypeToFieldInfoMap::iterator it = typeToFieldInfo.find(T);
|
|
351
|
-
if (it != typeToFieldInfo.end())
|
|
352
|
-
return it;
|
|
353
|
-
else
|
|
354
|
-
{
|
|
355
|
-
collectTypeInfo(T);
|
|
356
|
-
return typeToFieldInfo.find(T);
|
|
357
|
-
}
|
|
358
|
-
}
|
|
347
|
+
TypeToFieldInfoMap::iterator getStructInfoIter(const Type *T);
|
|
359
348
|
|
|
360
349
|
///Get a reference to StructInfo.
|
|
361
350
|
inline StInfo* getStructInfo(const Type *T)
|
|
@@ -364,8 +353,12 @@ public:
|
|
|
364
353
|
}
|
|
365
354
|
|
|
366
355
|
///Get a reference to the components of struct_info.
|
|
367
|
-
///
|
|
368
|
-
const
|
|
356
|
+
/// Number of flattenned elements of an array or struct
|
|
357
|
+
const u32_t getNumOfFlattenElements(const Type *T);
|
|
358
|
+
/// Number of flattenned fields of a struct
|
|
359
|
+
const u32_t getNumOfFlattenFields(const StructType *T);
|
|
360
|
+
/// Flatterned element idx of an array or struct by considering stride
|
|
361
|
+
const std::vector<u32_t>& getFlattenedElemIdxVec(const Type *T);
|
|
369
362
|
/// Flatterned field index information of a struct ignoring any array field
|
|
370
363
|
const std::vector<u32_t>& getFlattenedFieldIdxVec(const StructType *T);
|
|
371
364
|
|
|
@@ -513,14 +506,18 @@ class StInfo
|
|
|
513
506
|
private:
|
|
514
507
|
/// flattened field indices of a struct (ignoring arrays)
|
|
515
508
|
std::vector<u32_t> fldIdxVec;
|
|
516
|
-
/// flattened
|
|
517
|
-
std::vector<u32_t>
|
|
509
|
+
/// flattened element indices including structs and arrays by considering strides
|
|
510
|
+
std::vector<u32_t> elemIdxVec;
|
|
518
511
|
/// Types of all fields of a struct
|
|
519
512
|
Map<u32_t, const Type*> fldIdx2TypeMap;
|
|
520
513
|
/// All field infos after flattening a struct
|
|
521
514
|
std::vector<FlattenedFieldInfo> finfo;
|
|
522
515
|
/// stride represents the number of repetitive elements if this StInfo represent an ArrayType. stride is 1 by default.
|
|
523
516
|
u32_t stride;
|
|
517
|
+
/// number of elements after flattenning (including array elements)
|
|
518
|
+
u32_t numOfFlattenElements;
|
|
519
|
+
/// number of fields after flattenning (ignoring array elements)
|
|
520
|
+
u32_t numOfFlattenFields;
|
|
524
521
|
/// Max field limit
|
|
525
522
|
static u32_t maxFieldLimit;
|
|
526
523
|
|
|
@@ -530,7 +527,7 @@ private:
|
|
|
530
527
|
|
|
531
528
|
public:
|
|
532
529
|
/// Constructor
|
|
533
|
-
StInfo(u32_t s) : stride(s)
|
|
530
|
+
StInfo(u32_t s) : stride(s), numOfFlattenElements(s), numOfFlattenFields(s)
|
|
534
531
|
{
|
|
535
532
|
}
|
|
536
533
|
/// Destructor
|
|
@@ -552,28 +549,16 @@ public:
|
|
|
552
549
|
/// OriginalFieldType of b with field_idx 1 : Struct A
|
|
553
550
|
/// FlatternedFieldType of b with field_idx 1 : int
|
|
554
551
|
//{@
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
if(it!=fldIdx2TypeMap.end())
|
|
559
|
-
return it->second;
|
|
560
|
-
return nullptr;
|
|
561
|
-
}
|
|
562
|
-
inline const Type* getFlatternedFieldType(u32_t fldIdx)
|
|
563
|
-
{
|
|
564
|
-
for(FlattenedFieldInfo& fallenedFld : finfo){
|
|
565
|
-
if(fallenedFld.getFlattenFldIdx() == fldIdx)
|
|
566
|
-
return fallenedFld.getFlattenElemTy();
|
|
567
|
-
}
|
|
568
|
-
return nullptr;
|
|
569
|
-
}
|
|
552
|
+
const Type* getOriginalFieldType(u32_t fldIdx);
|
|
553
|
+
const Type* getFlatternedFieldType(u32_t fldIdx);
|
|
554
|
+
|
|
570
555
|
inline std::vector<u32_t>& getFlattenedFieldIdxVec()
|
|
571
556
|
{
|
|
572
557
|
return fldIdxVec;
|
|
573
558
|
}
|
|
574
|
-
inline std::vector<u32_t>&
|
|
559
|
+
inline std::vector<u32_t>& getFlattenedElemIdxVec()
|
|
575
560
|
{
|
|
576
|
-
return
|
|
561
|
+
return elemIdxVec;
|
|
577
562
|
}
|
|
578
563
|
inline std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec()
|
|
579
564
|
{
|
|
@@ -581,16 +566,27 @@ public:
|
|
|
581
566
|
}
|
|
582
567
|
//@}
|
|
583
568
|
|
|
584
|
-
/// Add field
|
|
585
|
-
|
|
569
|
+
/// Add field index and element index and their corresponding type
|
|
570
|
+
void addFldWithType(u32_t fldIdx, const Type* type, u32_t elemIdx);
|
|
571
|
+
|
|
572
|
+
/// Set number of fields and elements of an aggrate
|
|
573
|
+
inline void setNumOfFieldsAndElems(u32_t nf, u32_t ne)
|
|
586
574
|
{
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
fldIdx2TypeMap[fldIdx] = type;
|
|
575
|
+
numOfFlattenFields = nf;
|
|
576
|
+
numOfFlattenElements = ne;
|
|
590
577
|
}
|
|
591
578
|
|
|
592
|
-
///
|
|
593
|
-
inline u32_t
|
|
579
|
+
/// Return number of elements after flattenning (including array elements)
|
|
580
|
+
inline u32_t getNumOfFlattenElements() const {
|
|
581
|
+
return numOfFlattenElements;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
/// Return the number of fields after flattenning (ignoring array elements)
|
|
585
|
+
inline u32_t getNumOfFlattenFields() const {
|
|
586
|
+
return numOfFlattenFields;
|
|
587
|
+
}
|
|
588
|
+
/// Return the stride
|
|
589
|
+
inline u32_t getStride() const{
|
|
594
590
|
return stride;
|
|
595
591
|
}
|
|
596
592
|
};
|
|
@@ -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,10 +436,10 @@ 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* callBlockNode =
|
|
440
|
-
RetICFGNode* retBlockNode =
|
|
441
|
-
FunEntryICFGNode* calleeEntryNode =
|
|
442
|
-
FunExitICFGNode* calleeExitNode =
|
|
439
|
+
CallICFGNode* callBlockNode = getCallICFGNode(cs);
|
|
440
|
+
RetICFGNode* retBlockNode = getRetICFGNode(cs);
|
|
441
|
+
FunEntryICFGNode* calleeEntryNode = getFunEntryBlock(callee);
|
|
442
|
+
FunExitICFGNode* calleeExitNode = getFunExitBlock(callee);
|
|
443
443
|
addCallEdge(callBlockNode, calleeEntryNode, cs);
|
|
444
444
|
addRetEdge(calleeExitNode, retBlockNode, cs);
|
|
445
445
|
|
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)
|