svf-lib 1.0.2319 → 1.0.2321
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-linux-aarch64/Release-build/include/{Util → SVF/Util}/WorkList.h +0 -0
- package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/Modules/FindZ3.cmake +93 -0
- package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/SVFConfig.cmake +106 -0
- package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/SVFConfigVersion.cmake +43 -0
- package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/SVFTargets-release.cmake +101 -0
- package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/SVFTargets.cmake +180 -0
- package/SVF-linux-aarch64/Release-build/lib/libSvfCore.so.3.1 +0 -0
- package/SVF-linux-aarch64/Release-build/lib/libSvfLLVM.so.3.1 +0 -0
- package/SVF-linux-aarch64/Release-build/lib/pkgconfig/SVF.pc +12 -0
- package/SVF-osx/Release-build/bin/ae +0 -0
- package/SVF-osx/Release-build/bin/cfl +0 -0
- package/SVF-osx/Release-build/bin/dvf +0 -0
- package/SVF-osx/Release-build/bin/llvm2svf +0 -0
- package/SVF-osx/Release-build/bin/mta +0 -0
- package/SVF-osx/Release-build/bin/saber +0 -0
- package/SVF-osx/Release-build/bin/svf-ex +0 -0
- package/SVF-osx/Release-build/bin/wpa +0 -0
- package/SVF-osx/Release-build/include/SVF/AE/Core/AbstractState.h +425 -0
- package/SVF-osx/Release-build/include/SVF/AE/Core/AbstractValue.h +157 -0
- package/SVF-osx/Release-build/include/SVF/AE/Core/AddressValue.h +225 -0
- package/SVF-osx/Release-build/include/SVF/AE/Core/ICFGWTO.h +135 -0
- package/SVF-osx/Release-build/include/SVF/AE/Core/IntervalValue.h +1055 -0
- package/SVF-osx/Release-build/include/SVF/AE/Core/NumericValue.h +1292 -0
- package/SVF-osx/Release-build/include/SVF/AE/Core/RelExeState.h +226 -0
- package/SVF-osx/Release-build/include/SVF/AE/Core/RelationSolver.h +91 -0
- package/SVF-osx/Release-build/include/SVF/AE/Svfexe/AEDetector.h +439 -0
- package/SVF-osx/Release-build/include/SVF/AE/Svfexe/AbsExtAPI.h +138 -0
- package/SVF-osx/Release-build/include/SVF/AE/Svfexe/AbstractInterpretation.h +384 -0
- package/SVF-osx/Release-build/include/SVF/CFL/CFGNormalizer.h +84 -0
- package/SVF-osx/Release-build/include/SVF/CFL/CFGrammar.h +468 -0
- package/SVF-osx/Release-build/include/SVF/CFL/CFLAlias.h +168 -0
- package/SVF-osx/Release-build/include/SVF/CFL/CFLBase.h +118 -0
- package/SVF-osx/Release-build/include/SVF/CFL/CFLGramGraphChecker.h +74 -0
- package/SVF-osx/Release-build/include/SVF/CFL/CFLGraphBuilder.h +168 -0
- package/SVF-osx/Release-build/include/SVF/CFL/CFLSVFGBuilder.h +58 -0
- package/SVF-osx/Release-build/include/SVF/CFL/CFLSolver.h +374 -0
- package/SVF-osx/Release-build/include/SVF/CFL/CFLStat.h +67 -0
- package/SVF-osx/Release-build/include/SVF/CFL/CFLVF.h +68 -0
- package/SVF-osx/Release-build/include/SVF/CFL/GrammarBuilder.h +100 -0
- package/SVF-osx/Release-build/include/SVF/DDA/ContextDDA.h +230 -0
- package/SVF-osx/Release-build/include/SVF/DDA/DDAClient.h +163 -0
- package/SVF-osx/Release-build/include/SVF/DDA/DDAPass.h +102 -0
- package/SVF-osx/Release-build/include/SVF/DDA/DDAStat.h +121 -0
- package/SVF-osx/Release-build/include/SVF/DDA/DDAVFSolver.h +794 -0
- package/SVF-osx/Release-build/include/SVF/DDA/FlowDDA.h +178 -0
- package/SVF-osx/Release-build/include/SVF/FastCluster/fastcluster.h +80 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/BasicBlockG.h +318 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/CDG.h +482 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/CFLGraph.h +232 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/CHG.h +368 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/CallGraph.h +497 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/ConsG.h +402 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/ConsGEdge.h +355 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/ConsGNode.h +418 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/DOTGraphTraits.h +188 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/GenericGraph.h +628 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/GraphPrinter.h +111 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/GraphTraits.h +150 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/GraphWriter.h +380 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/ICFG.h +331 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/ICFGEdge.h +281 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/ICFGNode.h +669 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/ICFGStat.h +164 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/IRGraph.h +398 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/SCC.h +375 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/SVFG.h +491 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/SVFGEdge.h +237 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/SVFGNode.h +501 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/SVFGOPT.h +372 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/SVFGStat.h +273 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/ThreadCallGraph.h +399 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/VFG.h +726 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/VFGEdge.h +295 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/VFGNode.h +1266 -0
- package/SVF-osx/Release-build/include/SVF/Graphs/WTO.h +872 -0
- package/SVF-osx/Release-build/include/SVF/MSSA/MSSAMuChi.h +722 -0
- package/SVF-osx/Release-build/include/SVF/MSSA/MemPartition.h +169 -0
- package/SVF-osx/Release-build/include/SVF/MSSA/MemRegion.h +489 -0
- package/SVF-osx/Release-build/include/SVF/MSSA/MemSSA.h +452 -0
- package/SVF-osx/Release-build/include/SVF/MSSA/SVFGBuilder.h +104 -0
- package/SVF-osx/Release-build/include/SVF/MTA/LockAnalysis.h +533 -0
- package/SVF-osx/Release-build/include/SVF/MTA/MHP.h +546 -0
- package/SVF-osx/Release-build/include/SVF/MTA/MTA.h +97 -0
- package/SVF-osx/Release-build/include/SVF/MTA/MTAStat.h +73 -0
- package/SVF-osx/Release-build/include/SVF/MTA/TCT.h +620 -0
- package/SVF-osx/Release-build/include/SVF/MemoryModel/AbstractPointsToDS.h +316 -0
- package/SVF-osx/Release-build/include/SVF/MemoryModel/AccessPath.h +194 -0
- package/SVF-osx/Release-build/include/SVF/MemoryModel/ConditionalPT.h +878 -0
- package/SVF-osx/Release-build/include/SVF/MemoryModel/MutablePointsToDS.h +1025 -0
- package/SVF-osx/Release-build/include/SVF/MemoryModel/PersistentPointsToCache.h +463 -0
- package/SVF-osx/Release-build/include/SVF/MemoryModel/PersistentPointsToDS.h +955 -0
- package/SVF-osx/Release-build/include/SVF/MemoryModel/PointerAnalysis.h +428 -0
- package/SVF-osx/Release-build/include/SVF/MemoryModel/PointerAnalysisImpl.h +602 -0
- package/SVF-osx/Release-build/include/SVF/MemoryModel/PointsTo.h +255 -0
- package/SVF-osx/Release-build/include/SVF/MemoryModel/SVFLoop.h +167 -0
- package/SVF-osx/Release-build/include/SVF/SABER/DoubleFreeChecker.h +76 -0
- package/SVF-osx/Release-build/include/SVF/SABER/FileChecker.h +80 -0
- package/SVF-osx/Release-build/include/SVF/SABER/LeakChecker.h +122 -0
- package/SVF-osx/Release-build/include/SVF/SABER/ProgSlice.h +327 -0
- package/SVF-osx/Release-build/include/SVF/SABER/SaberCheckerAPI.h +151 -0
- package/SVF-osx/Release-build/include/SVF/SABER/SaberCondAllocator.h +317 -0
- package/SVF-osx/Release-build/include/SVF/SABER/SaberSVFGBuilder.h +114 -0
- package/SVF-osx/Release-build/include/SVF/SABER/SrcSnkDDA.h +327 -0
- package/SVF-osx/Release-build/include/SVF/SABER/SrcSnkSolver.h +186 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/BasicTypes.h +280 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/BreakConstantExpr.h +93 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/CHGBuilder.h +78 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/CppUtil.h +184 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/DCHG.h +474 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/GEPTypeBridgeIterator.h +183 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/ICFGBuilder.h +160 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/LLVMLoopAnalysis.h +60 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/LLVMModule.h +527 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/LLVMUtil.h +433 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/ObjTypeInference.h +129 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/SVFIRBuilder.h +523 -0
- package/SVF-osx/Release-build/include/SVF/SVF-LLVM/SymbolTableBuilder.h +132 -0
- package/SVF-osx/Release-build/include/SVF/SVFIR/ObjTypeInfo.h +224 -0
- package/SVF-osx/Release-build/include/SVF/SVFIR/PAGBuilderFromFile.h +80 -0
- package/SVF-osx/Release-build/include/SVF/SVFIR/SVFIR.h +856 -0
- package/SVF-osx/Release-build/include/SVF/SVFIR/SVFStatements.h +1330 -0
- package/SVF-osx/Release-build/include/SVF/SVFIR/SVFType.h +606 -0
- package/SVF-osx/Release-build/include/SVF/SVFIR/SVFValue.h +338 -0
- package/SVF-osx/Release-build/include/SVF/SVFIR/SVFVariables.h +2212 -0
- package/SVF-osx/Release-build/include/SVF/Util/Annotator.h +180 -0
- package/SVF-osx/Release-build/include/SVF/Util/BitVector.h +55 -0
- package/SVF-osx/Release-build/include/SVF/Util/CDGBuilder.h +107 -0
- package/SVF-osx/Release-build/include/SVF/Util/CallGraphBuilder.h +61 -0
- package/SVF-osx/Release-build/include/SVF/Util/Casting.h +426 -0
- package/SVF-osx/Release-build/include/SVF/Util/CommandLine.h +530 -0
- package/SVF-osx/Release-build/include/SVF/Util/CoreBitVector.h +214 -0
- package/SVF-osx/Release-build/include/SVF/Util/CxtStmt.h +502 -0
- package/SVF-osx/Release-build/include/SVF/Util/DPItem.h +618 -0
- package/SVF-osx/Release-build/include/SVF/Util/ExtAPI.h +117 -0
- package/SVF-osx/Release-build/include/SVF/Util/GeneralType.h +127 -0
- package/SVF-osx/Release-build/include/SVF/Util/GraphReachSolver.h +186 -0
- package/SVF-osx/Release-build/include/SVF/Util/NodeIDAllocator.h +203 -0
- package/SVF-osx/Release-build/include/SVF/Util/Options.h +273 -0
- package/SVF-osx/Release-build/include/SVF/Util/PTAStat.h +83 -0
- package/SVF-osx/Release-build/include/SVF/Util/SVFBugReport.h +427 -0
- package/SVF-osx/Release-build/include/SVF/Util/SVFLoopAndDomInfo.h +169 -0
- package/SVF-osx/Release-build/include/SVF/Util/SVFStat.h +103 -0
- package/SVF-osx/Release-build/include/SVF/Util/SVFUtil.h +478 -0
- package/SVF-osx/Release-build/include/SVF/Util/SparseBitVector.h +1252 -0
- package/SVF-osx/Release-build/include/SVF/Util/ThreadAPI.h +188 -0
- package/SVF-osx/Release-build/include/SVF/Util/WorkList.h +317 -0
- package/SVF-osx/Release-build/include/SVF/Util/Z3Expr.h +325 -0
- package/SVF-osx/Release-build/include/SVF/Util/cJSON.h +300 -0
- package/SVF-osx/Release-build/include/SVF/Util/config.h +46 -0
- package/SVF-osx/Release-build/include/SVF/Util/iterator.h +407 -0
- package/SVF-osx/Release-build/include/SVF/Util/iterator_range.h +76 -0
- package/SVF-osx/Release-build/include/SVF/WPA/Andersen.h +434 -0
- package/SVF-osx/Release-build/include/SVF/WPA/AndersenPWC.h +160 -0
- package/SVF-osx/Release-build/include/SVF/WPA/CSC.h +95 -0
- package/SVF-osx/Release-build/include/SVF/WPA/FlowSensitive.h +322 -0
- package/SVF-osx/Release-build/include/SVF/WPA/Steensgaard.h +131 -0
- package/SVF-osx/Release-build/include/SVF/WPA/TypeAnalysis.h +90 -0
- package/SVF-osx/Release-build/include/SVF/WPA/VersionedFlowSensitive.h +295 -0
- package/SVF-osx/Release-build/include/SVF/WPA/WPAFSSolver.h +246 -0
- package/SVF-osx/Release-build/include/SVF/WPA/WPAPass.h +115 -0
- package/SVF-osx/Release-build/include/SVF/WPA/WPASolver.h +205 -0
- package/SVF-osx/Release-build/include/SVF/WPA/WPAStat.h +222 -0
- package/SVF-osx/Release-build/include/SVF/extapi.bc +2384 -0
- package/SVF-osx/Release-build/lib/cmake/SVF/Modules/FindZ3.cmake +93 -0
- package/SVF-osx/Release-build/lib/cmake/SVF/SVFConfig.cmake +106 -0
- package/SVF-osx/Release-build/lib/cmake/SVF/SVFConfigVersion.cmake +43 -0
- package/SVF-osx/Release-build/lib/cmake/SVF/SVFTargets-release.cmake +101 -0
- package/SVF-osx/Release-build/lib/cmake/SVF/SVFTargets.cmake +180 -0
- package/SVF-osx/Release-build/lib/libSvfCore.3.1.dylib +0 -0
- package/SVF-osx/Release-build/lib/libSvfLLVM.3.1.dylib +0 -0
- package/SVF-osx/Release-build/lib/pkgconfig/SVF.pc +12 -0
- package/package.json +1 -1
- package/SVF-linux-aarch64/Release-build/include/CFL/grammar/PAGGrammar.txt +0 -15
- package/SVF-linux-aarch64/Release-build/include/CFL/grammar/PEGGrammar.txt +0 -11
- package/SVF-linux-aarch64/Release-build/include/CFL/grammar/VFGGrammar.txt +0 -7
- package/SVF-linux-aarch64/Release-build/include/FastCluster/LICENSE.TXT +0 -13
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/AbstractState.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/AbstractValue.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/AddressValue.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/ICFGWTO.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/IntervalValue.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/NumericValue.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/RelExeState.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/RelationSolver.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Svfexe/AEDetector.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Svfexe/AbsExtAPI.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Svfexe/AbstractInterpretation.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFGNormalizer.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFGrammar.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLAlias.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLBase.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLGramGraphChecker.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLGraphBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLSVFGBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLSolver.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLStat.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLVF.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/GrammarBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/ContextDDA.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/DDAClient.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/DDAPass.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/DDAStat.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/DDAVFSolver.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/FlowDDA.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{FastCluster → SVF/FastCluster}/fastcluster.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/BasicBlockG.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/CDG.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/CFLGraph.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/CHG.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/CallGraph.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ConsG.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ConsGEdge.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ConsGNode.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/DOTGraphTraits.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/GenericGraph.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/GraphPrinter.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/GraphTraits.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/GraphWriter.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ICFG.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ICFGEdge.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ICFGNode.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ICFGStat.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/IRGraph.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SCC.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SVFG.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SVFGEdge.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SVFGNode.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SVFGOPT.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SVFGStat.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ThreadCallGraph.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/VFG.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/VFGEdge.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/VFGNode.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/WTO.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MSSA → SVF/MSSA}/MSSAMuChi.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MSSA → SVF/MSSA}/MemPartition.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MSSA → SVF/MSSA}/MemRegion.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MSSA → SVF/MSSA}/MemSSA.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MSSA → SVF/MSSA}/SVFGBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MTA → SVF/MTA}/LockAnalysis.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MTA → SVF/MTA}/MHP.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MTA → SVF/MTA}/MTA.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MTA → SVF/MTA}/MTAStat.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MTA → SVF/MTA}/TCT.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/AbstractPointsToDS.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/AccessPath.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/ConditionalPT.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/MutablePointsToDS.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/PersistentPointsToCache.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/PersistentPointsToDS.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/PointerAnalysis.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/PointerAnalysisImpl.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/PointsTo.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/SVFLoop.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/DoubleFreeChecker.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/FileChecker.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/LeakChecker.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/ProgSlice.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/SaberCheckerAPI.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/SaberCondAllocator.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/SaberSVFGBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/SrcSnkDDA.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/SrcSnkSolver.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/BasicTypes.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/BreakConstantExpr.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/CHGBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/CppUtil.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/DCHG.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/GEPTypeBridgeIterator.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/ICFGBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/LLVMLoopAnalysis.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/LLVMModule.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/LLVMUtil.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/ObjTypeInference.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/SVFIRBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/SymbolTableBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/ObjTypeInfo.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/PAGBuilderFromFile.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/SVFIR.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/SVFStatements.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/SVFType.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/SVFValue.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/SVFVariables.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/Annotator.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/BitVector.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/CDGBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/CallGraphBuilder.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/Casting.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/CommandLine.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/CoreBitVector.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/CxtStmt.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/DPItem.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/ExtAPI.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/GeneralType.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/GraphReachSolver.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/NodeIDAllocator.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/Options.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/PTAStat.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/SVFBugReport.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/SVFLoopAndDomInfo.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/SVFStat.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/SVFUtil.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/SparseBitVector.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/ThreadAPI.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/Z3Expr.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/cJSON.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/iterator.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/iterator_range.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/Andersen.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/AndersenPWC.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/CSC.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/FlowSensitive.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/Steensgaard.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/TypeAnalysis.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/VersionedFlowSensitive.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/WPAFSSolver.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/WPAPass.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/WPASolver.h +0 -0
- /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/WPAStat.h +0 -0
- /package/SVF-linux-aarch64/Release-build/{lib → include/SVF}/extapi.bc +0 -0
|
@@ -0,0 +1,794 @@
|
|
|
1
|
+
//===- DDAVFSolver.h -- Demand-driven analysis value-flow solver------------//
|
|
2
|
+
//
|
|
3
|
+
// SVF: Static Value-Flow Analysis
|
|
4
|
+
//
|
|
5
|
+
// Copyright (C) <2013-> <Yulei Sui>
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
// This program is free software: you can redistribute it and/or modify
|
|
9
|
+
// it under the terms of the GNU Affero General Public License as published by
|
|
10
|
+
// the Free Software Foundation, either version 3 of the License, or
|
|
11
|
+
// (at your option) any later version.
|
|
12
|
+
|
|
13
|
+
// This program is distributed in the hope that it will be useful,
|
|
14
|
+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
+
// GNU Affero General Public License for more details.
|
|
17
|
+
|
|
18
|
+
// You should have received a copy of the GNU Affero General Public License
|
|
19
|
+
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
+
//
|
|
21
|
+
//===----------------------------------------------------------------------===//
|
|
22
|
+
|
|
23
|
+
/*
|
|
24
|
+
* DDAVFSolver.h
|
|
25
|
+
*
|
|
26
|
+
* Created on: Jul 3, 2014
|
|
27
|
+
* Author: Yulei Sui
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
#ifndef VALUEFLOWDDA_H_
|
|
31
|
+
#define VALUEFLOWDDA_H_
|
|
32
|
+
|
|
33
|
+
#include "DDA/DDAStat.h"
|
|
34
|
+
#include "Graphs/SCC.h"
|
|
35
|
+
#include "MSSA/SVFGBuilder.h"
|
|
36
|
+
#include "MemoryModel/PointsTo.h"
|
|
37
|
+
#include "WPA/Andersen.h"
|
|
38
|
+
#include <algorithm>
|
|
39
|
+
|
|
40
|
+
namespace SVF
|
|
41
|
+
{
|
|
42
|
+
|
|
43
|
+
/*!
|
|
44
|
+
* Value-Flow Based Demand-Driven Points-to Analysis
|
|
45
|
+
*/
|
|
46
|
+
template<class CVar, class CPtSet, class DPIm>
|
|
47
|
+
class DDAVFSolver
|
|
48
|
+
{
|
|
49
|
+
friend class DDAStat;
|
|
50
|
+
public:
|
|
51
|
+
typedef SCCDetection<SVFG*> SVFGSCC;
|
|
52
|
+
typedef SCCDetection<CallGraph*> CallGraphSCC;
|
|
53
|
+
typedef CallGraphEdge::CallInstSet CallInstSet;
|
|
54
|
+
typedef SVFIR::CallSiteSet CallSiteSet;
|
|
55
|
+
typedef OrderedSet<DPIm> DPTItemSet;
|
|
56
|
+
typedef OrderedMap<DPIm, CPtSet> DPImToCPtSetMap;
|
|
57
|
+
typedef OrderedMap<DPIm,CVar> DPMToCVarMap;
|
|
58
|
+
typedef OrderedMap<DPIm,DPIm> DPMToDPMMap;
|
|
59
|
+
typedef OrderedMap<NodeID, DPTItemSet> LocToDPMVecMap;
|
|
60
|
+
typedef OrderedSet<const SVFGEdge* > ConstSVFGEdgeSet;
|
|
61
|
+
typedef SVFGEdge::SVFGEdgeSetTy SVFGEdgeSet;
|
|
62
|
+
typedef OrderedMap<const SVFGNode*, DPTItemSet> StoreToPMSetMap;
|
|
63
|
+
|
|
64
|
+
///Constructor
|
|
65
|
+
DDAVFSolver(): outOfBudgetQuery(false),_pag(nullptr),_svfg(nullptr),_ander(nullptr),_callGraph(nullptr), _callGraphSCC(nullptr), _svfgSCC(nullptr), ddaStat(nullptr)
|
|
66
|
+
{
|
|
67
|
+
}
|
|
68
|
+
/// Destructor
|
|
69
|
+
virtual ~DDAVFSolver()
|
|
70
|
+
{
|
|
71
|
+
if(_ander != nullptr)
|
|
72
|
+
{
|
|
73
|
+
// AndersenWaveDiff::releaseAndersenWaveDiff();
|
|
74
|
+
_ander = nullptr;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (_svfg != nullptr)
|
|
78
|
+
{
|
|
79
|
+
// DDASVFGBuilder::releaseDDASVFG();
|
|
80
|
+
_svfg = nullptr;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (_svfgSCC != nullptr)
|
|
84
|
+
delete _svfgSCC;
|
|
85
|
+
_svfgSCC = nullptr;
|
|
86
|
+
|
|
87
|
+
_callGraph = nullptr;
|
|
88
|
+
_callGraphSCC = nullptr;
|
|
89
|
+
}
|
|
90
|
+
/// Return candidate pointers for DDA
|
|
91
|
+
inline NodeBS& getCandidateQueries()
|
|
92
|
+
{
|
|
93
|
+
return candidateQueries;
|
|
94
|
+
}
|
|
95
|
+
/// Given CVar and location (SVFGNode) return a new DPItem
|
|
96
|
+
virtual inline DPIm getDPIm(const CVar& var, const SVFGNode* loc) const
|
|
97
|
+
{
|
|
98
|
+
DPIm dpm(var,loc);
|
|
99
|
+
return dpm;
|
|
100
|
+
}
|
|
101
|
+
/// Union pts
|
|
102
|
+
virtual bool unionDDAPts(CPtSet& pts, const CPtSet& targetPts)
|
|
103
|
+
{
|
|
104
|
+
return (pts |= targetPts);
|
|
105
|
+
}
|
|
106
|
+
/// Union pts
|
|
107
|
+
virtual bool unionDDAPts(DPIm dpm, const CPtSet& targetPts)
|
|
108
|
+
{
|
|
109
|
+
CPtSet& pts = isTopLevelPtrStmt(dpm.getLoc()) ? dpmToTLCPtSetMap[dpm] : dpmToADCPtSetMap[dpm];
|
|
110
|
+
return pts |= targetPts;
|
|
111
|
+
}
|
|
112
|
+
/// Add pts
|
|
113
|
+
virtual void addDDAPts(CPtSet& pts, const CVar& var)
|
|
114
|
+
{
|
|
115
|
+
pts.set(var);
|
|
116
|
+
}
|
|
117
|
+
/// Return SVFG
|
|
118
|
+
inline SVFG* getSVFG() const
|
|
119
|
+
{
|
|
120
|
+
return _svfg;
|
|
121
|
+
}
|
|
122
|
+
/// Return SVFGSCC
|
|
123
|
+
inline SVFGSCC* getSVFGSCC() const
|
|
124
|
+
{
|
|
125
|
+
return _svfgSCC;
|
|
126
|
+
}
|
|
127
|
+
// Dump cptsSet
|
|
128
|
+
inline void dumpCPtSet(const CPtSet& cpts) const
|
|
129
|
+
{
|
|
130
|
+
SVFUtil::outs() << "{";
|
|
131
|
+
for(typename CPtSet::iterator it = cpts.begin(), eit = cpts.end(); it!=eit; ++it)
|
|
132
|
+
{
|
|
133
|
+
SVFUtil::outs() << (*it) << " ";
|
|
134
|
+
}
|
|
135
|
+
SVFUtil::outs() << "}\n";
|
|
136
|
+
}
|
|
137
|
+
/// Compute points-to
|
|
138
|
+
virtual const CPtSet& findPT(const DPIm& dpm)
|
|
139
|
+
{
|
|
140
|
+
|
|
141
|
+
if(isbkVisited(dpm))
|
|
142
|
+
{
|
|
143
|
+
const CPtSet& cpts = getCachedPointsTo(dpm);
|
|
144
|
+
DBOUT(DDDA, SVFUtil::outs() << "\t already backward visited dpm: ");
|
|
145
|
+
DBOUT(DDDA, dpm.dump());
|
|
146
|
+
DBOUT(DDDA, SVFUtil::outs() << "\t return points-to: ");
|
|
147
|
+
DBOUT(DDDA, dumpCPtSet(cpts));
|
|
148
|
+
return cpts;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
DBOUT(DDDA, SVFUtil::outs() << "\t backward visit dpm: ");
|
|
152
|
+
DBOUT(DDDA, dpm.dump());
|
|
153
|
+
markbkVisited(dpm);
|
|
154
|
+
addDpmToLoc(dpm);
|
|
155
|
+
|
|
156
|
+
if(testOutOfBudget(dpm) == false)
|
|
157
|
+
{
|
|
158
|
+
|
|
159
|
+
CPtSet pts;
|
|
160
|
+
handleSingleStatement(dpm, pts);
|
|
161
|
+
|
|
162
|
+
/// Add successors of current stmt if its pts has been changed.
|
|
163
|
+
updateCachedPointsTo(dpm, pts);
|
|
164
|
+
}
|
|
165
|
+
return getCachedPointsTo(dpm);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
protected:
|
|
169
|
+
/// Handle single statement
|
|
170
|
+
virtual void handleSingleStatement(const DPIm& dpm, CPtSet& pts)
|
|
171
|
+
{
|
|
172
|
+
/// resolve function pointer first at indirect callsite
|
|
173
|
+
resolveFunPtr(dpm);
|
|
174
|
+
|
|
175
|
+
const SVFGNode* node = dpm.getLoc();
|
|
176
|
+
if(SVFUtil::isa<AddrSVFGNode>(node))
|
|
177
|
+
{
|
|
178
|
+
handleAddr(pts,dpm,SVFUtil::cast<AddrSVFGNode>(node));
|
|
179
|
+
}
|
|
180
|
+
else if (SVFUtil::isa<CopySVFGNode, PHISVFGNode, ActualParmSVFGNode,
|
|
181
|
+
FormalParmSVFGNode, ActualRetSVFGNode,
|
|
182
|
+
FormalRetSVFGNode, NullPtrSVFGNode>(node))
|
|
183
|
+
{
|
|
184
|
+
backtraceAlongDirectVF(pts,dpm);
|
|
185
|
+
}
|
|
186
|
+
else if(SVFUtil::isa<GepSVFGNode>(node))
|
|
187
|
+
{
|
|
188
|
+
CPtSet gepPts;
|
|
189
|
+
backtraceAlongDirectVF(gepPts,dpm);
|
|
190
|
+
unionDDAPts(pts, processGepPts(SVFUtil::cast<GepSVFGNode>(node),gepPts));
|
|
191
|
+
}
|
|
192
|
+
else if(const LoadSVFGNode* load = SVFUtil::dyn_cast<LoadSVFGNode>(node))
|
|
193
|
+
{
|
|
194
|
+
if(load->getPAGDstNode()->isPointer() == false)
|
|
195
|
+
return;
|
|
196
|
+
|
|
197
|
+
CPtSet loadpts;
|
|
198
|
+
startNewPTCompFromLoadSrc(loadpts,dpm);
|
|
199
|
+
for(typename CPtSet::iterator it = loadpts.begin(), eit = loadpts.end(); it!=eit; ++it)
|
|
200
|
+
{
|
|
201
|
+
backtraceAlongIndirectVF(pts,getDPImWithOldCond(dpm,*it,load));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
else if(const StoreSVFGNode* store = SVFUtil::dyn_cast<StoreSVFGNode>(node))
|
|
205
|
+
{
|
|
206
|
+
if(store->getPAGSrcNode()->isPointer() == false)
|
|
207
|
+
return;
|
|
208
|
+
|
|
209
|
+
if(isMustAlias(getLoadDpm(dpm),dpm))
|
|
210
|
+
{
|
|
211
|
+
DBOUT(DDDA, SVFUtil::outs() << "+++must alias for load and store:");
|
|
212
|
+
DBOUT(DDDA, getLoadDpm(dpm).dump());
|
|
213
|
+
DBOUT(DDDA, dpm.dump());
|
|
214
|
+
DBOUT(DDDA, SVFUtil::outs() << "+++\n");
|
|
215
|
+
DOSTAT(ddaStat->_NumOfMustAliases++);
|
|
216
|
+
backtraceToStoreSrc(pts,dpm);
|
|
217
|
+
}
|
|
218
|
+
else
|
|
219
|
+
{
|
|
220
|
+
CPtSet storepts;
|
|
221
|
+
startNewPTCompFromStoreDst(storepts,dpm);
|
|
222
|
+
for(typename CPtSet::iterator it = storepts.begin(), eit = storepts.end(); it!=eit; ++it)
|
|
223
|
+
{
|
|
224
|
+
if(propagateViaObj(*it,getLoadCVar(dpm)))
|
|
225
|
+
{
|
|
226
|
+
backtraceToStoreSrc(pts,getDPImWithOldCond(dpm,*it,store));
|
|
227
|
+
|
|
228
|
+
if(isStrongUpdate(storepts,store))
|
|
229
|
+
{
|
|
230
|
+
DBOUT(DDDA, SVFUtil::outs() << "backward strong update for obj " << dpm.getCurNodeID() << "\n");
|
|
231
|
+
DOSTAT(addSUStat(dpm,store);)
|
|
232
|
+
}
|
|
233
|
+
else
|
|
234
|
+
{
|
|
235
|
+
DOSTAT(rmSUStat(dpm,store);)
|
|
236
|
+
backtraceAlongIndirectVF(pts,getDPImWithOldCond(dpm,*it,store));
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
else
|
|
240
|
+
{
|
|
241
|
+
backtraceAlongIndirectVF(pts,dpm);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
else if(SVFUtil::isa<MRSVFGNode>(node))
|
|
247
|
+
{
|
|
248
|
+
backtraceAlongIndirectVF(pts,dpm);
|
|
249
|
+
}
|
|
250
|
+
else
|
|
251
|
+
assert(false && "unexpected kind of SVFG nodes");
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/// recompute points-to for value-flow cycles and indirect calls
|
|
255
|
+
void reCompute(const DPIm& dpm)
|
|
256
|
+
{
|
|
257
|
+
/// re-compute due to indirect calls
|
|
258
|
+
SVFGEdgeSet newIndirectEdges;
|
|
259
|
+
if(_pag->isFunPtr(dpm.getCurNodeID()))
|
|
260
|
+
{
|
|
261
|
+
const CallSiteSet& csSet = _pag->getIndCallSites(dpm.getCurNodeID());
|
|
262
|
+
for(CallSiteSet::const_iterator it = csSet.begin(), eit = csSet.end(); it!=eit; ++it)
|
|
263
|
+
updateCallGraphAndSVFG(dpm, (*it),newIndirectEdges);
|
|
264
|
+
}
|
|
265
|
+
/// callgraph scc detection for local variable in recursion
|
|
266
|
+
if(!newIndirectEdges.empty())
|
|
267
|
+
_callGraphSCC->find();
|
|
268
|
+
reComputeForEdges(dpm,newIndirectEdges,true);
|
|
269
|
+
|
|
270
|
+
/// re-compute for transitive closures
|
|
271
|
+
SVFGEdgeSet edgeSet(dpm.getLoc()->getOutEdges());
|
|
272
|
+
reComputeForEdges(dpm,edgeSet,false);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/// Traverse along out edges to find all nodes which may be affected by locDPM.
|
|
276
|
+
void reComputeForEdges(const DPIm& dpm, const SVFGEdgeSet& edgeSet, bool indirectCall = false)
|
|
277
|
+
{
|
|
278
|
+
for (SVFGNode::const_iterator it = edgeSet.begin(), eit = edgeSet.end(); it != eit; ++it)
|
|
279
|
+
{
|
|
280
|
+
const SVFGEdge* edge = *it;
|
|
281
|
+
const SVFGNode* dst = edge->getDstNode();
|
|
282
|
+
typename LocToDPMVecMap::const_iterator locIt = getLocToDPMVecMap().find(dst->getId());
|
|
283
|
+
/// Only collect nodes we have traversed
|
|
284
|
+
if (locIt == getLocToDPMVecMap().end())
|
|
285
|
+
continue;
|
|
286
|
+
DPTItemSet dpmSet(locIt->second.begin(), locIt->second.end());
|
|
287
|
+
for(typename DPTItemSet::const_iterator it = dpmSet.begin(),eit = dpmSet.end(); it!=eit; ++it)
|
|
288
|
+
{
|
|
289
|
+
const DPIm& dstDpm = *it;
|
|
290
|
+
if(!indirectCall && SVFUtil::isa<IndirectSVFGEdge>(edge) && !SVFUtil::isa<LoadSVFGNode>(edge->getDstNode()))
|
|
291
|
+
{
|
|
292
|
+
if(dstDpm.getCurNodeID() == dpm.getCurNodeID())
|
|
293
|
+
{
|
|
294
|
+
DBOUT(DDDA,SVFUtil::outs() << "\t Recompute, forward from :");
|
|
295
|
+
DBOUT(DDDA, dpm.dump());
|
|
296
|
+
DOSTAT(ddaStat->_NumOfStepInCycle++);
|
|
297
|
+
clearbkVisited(dstDpm);
|
|
298
|
+
findPT(dstDpm);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
else
|
|
302
|
+
{
|
|
303
|
+
if(indirectCall)
|
|
304
|
+
DBOUT(DDDA,SVFUtil::outs() << "\t Recompute for indirect call from :");
|
|
305
|
+
else
|
|
306
|
+
DBOUT(DDDA,SVFUtil::outs() << "\t Recompute forward from :");
|
|
307
|
+
DBOUT(DDDA, dpm.dump());
|
|
308
|
+
DOSTAT(ddaStat->_NumOfStepInCycle++);
|
|
309
|
+
clearbkVisited(dstDpm);
|
|
310
|
+
findPT(dstDpm);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/// Build SVFG
|
|
317
|
+
virtual inline void buildSVFG(SVFIR* pag)
|
|
318
|
+
{
|
|
319
|
+
_ander = AndersenWaveDiff::createAndersenWaveDiff(pag);
|
|
320
|
+
_svfg = svfgBuilder.buildPTROnlySVFG(_ander);
|
|
321
|
+
_pag = _svfg->getPAG();
|
|
322
|
+
}
|
|
323
|
+
/// Reset visited map for next points-to query
|
|
324
|
+
virtual inline void resetQuery()
|
|
325
|
+
{
|
|
326
|
+
if(outOfBudgetQuery)
|
|
327
|
+
OOBResetVisited();
|
|
328
|
+
|
|
329
|
+
locToDpmSetMap.clear();
|
|
330
|
+
dpmToloadDpmMap.clear();
|
|
331
|
+
loadToPTCVarMap.clear();
|
|
332
|
+
outOfBudgetQuery = false;
|
|
333
|
+
ddaStat->_NumOfStep = 0;
|
|
334
|
+
}
|
|
335
|
+
/// Reset visited map if the current query is out-of-budget
|
|
336
|
+
inline void OOBResetVisited()
|
|
337
|
+
{
|
|
338
|
+
for(typename LocToDPMVecMap::const_iterator it = locToDpmSetMap.begin(),eit = locToDpmSetMap.end(); it!=eit; ++it)
|
|
339
|
+
{
|
|
340
|
+
DPTItemSet dpmSet(it->second.begin(), it->second.end());
|
|
341
|
+
for(typename DPTItemSet::const_iterator dit = dpmSet.begin(),deit=dpmSet.end(); dit!=deit; ++dit)
|
|
342
|
+
if(isOutOfBudgetDpm(*dit)==false)
|
|
343
|
+
clearbkVisited(*dit);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
/// GetDefinition SVFG
|
|
347
|
+
inline const SVFGNode* getDefSVFGNode(const PAGNode* pagNode) const
|
|
348
|
+
{
|
|
349
|
+
return getSVFG()->getDefSVFGNode(pagNode);
|
|
350
|
+
}
|
|
351
|
+
/// Backward traverse along indirect value flows
|
|
352
|
+
void backtraceAlongIndirectVF(CPtSet& pts, const DPIm& oldDpm)
|
|
353
|
+
{
|
|
354
|
+
const SVFGNode* node = oldDpm.getLoc();
|
|
355
|
+
NodeID obj = oldDpm.getCurNodeID();
|
|
356
|
+
if (_pag->isConstantObj(obj))
|
|
357
|
+
return;
|
|
358
|
+
const SVFGEdgeSet edgeSet(node->getInEdges());
|
|
359
|
+
for (SVFGNode::const_iterator it = edgeSet.begin(), eit = edgeSet.end(); it != eit; ++it)
|
|
360
|
+
{
|
|
361
|
+
if(const IndirectSVFGEdge* indirEdge = SVFUtil::dyn_cast<IndirectSVFGEdge>(*it))
|
|
362
|
+
{
|
|
363
|
+
const NodeBS& guard = indirEdge->getPointsTo();
|
|
364
|
+
if(guard.test(obj))
|
|
365
|
+
{
|
|
366
|
+
DBOUT(DDDA, SVFUtil::outs() << "\t\t==backtrace indirectVF svfgNode " <<
|
|
367
|
+
indirEdge->getDstID() << " --> " << indirEdge->getSrcID() << "\n");
|
|
368
|
+
backwardPropDpm(pts,oldDpm.getCurNodeID(),oldDpm,indirEdge);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
/// Backward traverse along direct value flows
|
|
374
|
+
void backtraceAlongDirectVF(CPtSet& pts, const DPIm& oldDpm)
|
|
375
|
+
{
|
|
376
|
+
const SVFGNode* node = oldDpm.getLoc();
|
|
377
|
+
const SVFGEdgeSet edgeSet(node->getInEdges());
|
|
378
|
+
for (SVFGNode::const_iterator it = edgeSet.begin(), eit = edgeSet.end(); it != eit; ++it)
|
|
379
|
+
{
|
|
380
|
+
if(const DirectSVFGEdge* dirEdge = SVFUtil::dyn_cast<DirectSVFGEdge>(*it))
|
|
381
|
+
{
|
|
382
|
+
DBOUT(DDDA, SVFUtil::outs() << "\t\t==backtrace directVF svfgNode " <<
|
|
383
|
+
dirEdge->getDstID() << " --> " << dirEdge->getSrcID() << "\n");
|
|
384
|
+
const SVFGNode* srcNode = dirEdge->getSrcNode();
|
|
385
|
+
backwardPropDpm(pts,getSVFG()->getLHSTopLevPtr(srcNode)->getId(),oldDpm,dirEdge);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/// Backward traverse for top-level pointers of load/store statements
|
|
391
|
+
///@{
|
|
392
|
+
inline void startNewPTCompFromLoadSrc(CPtSet& pts, const DPIm& oldDpm)
|
|
393
|
+
{
|
|
394
|
+
const LoadSVFGNode* load = SVFUtil::cast<LoadSVFGNode>(oldDpm.getLoc());
|
|
395
|
+
const SVFGNode* loadSrc = getDefSVFGNode(load->getPAGSrcNode());
|
|
396
|
+
DBOUT(DDDA, SVFUtil::outs() << "!##start new computation from loadSrc svfgNode " <<
|
|
397
|
+
load->getId() << " --> " << loadSrc->getId() << "\n");
|
|
398
|
+
const SVFGEdge* edge = getSVFG()->getIntraVFGEdge(loadSrc,load,SVFGEdge::IntraDirectVF);
|
|
399
|
+
assert(edge && "Edge not found!!");
|
|
400
|
+
backwardPropDpm(pts,load->getPAGSrcNodeID(),oldDpm,edge);
|
|
401
|
+
|
|
402
|
+
}
|
|
403
|
+
inline void startNewPTCompFromStoreDst(CPtSet& pts, const DPIm& oldDpm)
|
|
404
|
+
{
|
|
405
|
+
const StoreSVFGNode* store = SVFUtil::cast<StoreSVFGNode>(oldDpm.getLoc());
|
|
406
|
+
const SVFGNode* storeDst = getDefSVFGNode(store->getPAGDstNode());
|
|
407
|
+
DBOUT(DDDA, SVFUtil::outs() << "!##start new computation from storeDst svfgNode " <<
|
|
408
|
+
store->getId() << " --> " << storeDst->getId() << "\n");
|
|
409
|
+
const SVFGEdge* edge = getSVFG()->getIntraVFGEdge(storeDst,store,SVFGEdge::IntraDirectVF);
|
|
410
|
+
assert(edge && "Edge not found!!");
|
|
411
|
+
backwardPropDpm(pts,store->getPAGDstNodeID(),oldDpm,edge);
|
|
412
|
+
}
|
|
413
|
+
inline void backtraceToStoreSrc(CPtSet& pts, const DPIm& oldDpm)
|
|
414
|
+
{
|
|
415
|
+
const StoreSVFGNode* store = SVFUtil::cast<StoreSVFGNode>(oldDpm.getLoc());
|
|
416
|
+
const SVFGNode* storeSrc = getDefSVFGNode(store->getPAGSrcNode());
|
|
417
|
+
DBOUT(DDDA, SVFUtil::outs() << "++backtrace to storeSrc from svfgNode " << getLoadDpm(oldDpm).getLoc()->getId() << " to "<<
|
|
418
|
+
store->getId() << " to " << storeSrc->getId() <<"\n");
|
|
419
|
+
const SVFGEdge* edge = getSVFG()->getIntraVFGEdge(storeSrc,store,SVFGEdge::IntraDirectVF);
|
|
420
|
+
assert(edge && "Edge not found!!");
|
|
421
|
+
backwardPropDpm(pts,store->getPAGSrcNodeID(),oldDpm,edge);
|
|
422
|
+
}
|
|
423
|
+
//@}
|
|
424
|
+
|
|
425
|
+
/// dpm transit during backward tracing
|
|
426
|
+
virtual void backwardPropDpm(CPtSet& pts, NodeID ptr,const DPIm& oldDpm,const SVFGEdge* edge)
|
|
427
|
+
{
|
|
428
|
+
DPIm dpm(oldDpm);
|
|
429
|
+
dpm.setLocVar(edge->getSrcNode(),ptr);
|
|
430
|
+
DOTIMESTAT(double start = DDAStat::getClk(true));
|
|
431
|
+
/// handle context-/path- sensitivity
|
|
432
|
+
if(handleBKCondition(dpm,edge)==false)
|
|
433
|
+
{
|
|
434
|
+
DOTIMESTAT(ddaStat->_TotalTimeOfBKCondition += DDAStat::getClk(true) - start);
|
|
435
|
+
DBOUT(DDDA, SVFUtil::outs() << "\t!!! infeasible path svfgNode: " << edge->getDstID() << " --| " << edge->getSrcID() << "\n");
|
|
436
|
+
DOSTAT(ddaStat->_NumOfInfeasiblePath++);
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/// record the source of load dpm
|
|
441
|
+
if(SVFUtil::isa<IndirectSVFGEdge>(edge))
|
|
442
|
+
addLoadDpmAndCVar(dpm,getLoadDpm(oldDpm),getLoadCVar(oldDpm));
|
|
443
|
+
|
|
444
|
+
DOSTAT(ddaStat->_NumOfDPM++);
|
|
445
|
+
/// handle out of budget case
|
|
446
|
+
unionDDAPts(pts,findPT(dpm));
|
|
447
|
+
}
|
|
448
|
+
/// whether load and store are aliased
|
|
449
|
+
virtual bool isMustAlias(const DPIm&, const DPIm&)
|
|
450
|
+
{
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
453
|
+
/// Return TRUE if this is a strong update STORE statement.
|
|
454
|
+
virtual bool isStrongUpdate(const CPtSet& dstCPSet, const StoreSVFGNode* store)
|
|
455
|
+
{
|
|
456
|
+
if (dstCPSet.count() == 1)
|
|
457
|
+
{
|
|
458
|
+
/// Find the unique element in cpts
|
|
459
|
+
typename CPtSet::iterator it = dstCPSet.begin();
|
|
460
|
+
const CVar& var = *it;
|
|
461
|
+
// Strong update can be made if this points-to target is not heap, array or field-insensitive.
|
|
462
|
+
if (!isHeapCondMemObj(var,store) && !isArrayCondMemObj(var)
|
|
463
|
+
&& !isFieldInsenCondMemObj(var) && !isLocalCVarInRecursion(var))
|
|
464
|
+
{
|
|
465
|
+
return true;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
470
|
+
/// Whether a local variable is in function recursions
|
|
471
|
+
virtual inline bool isLocalCVarInRecursion(const CVar& var) const
|
|
472
|
+
{
|
|
473
|
+
NodeID id = getPtrNodeID(var);
|
|
474
|
+
const BaseObjVar* baseObj = _pag->getBaseObject(id);
|
|
475
|
+
assert(baseObj && "base object is null??");
|
|
476
|
+
if(SVFUtil::isa<StackObjVar>(baseObj))
|
|
477
|
+
{
|
|
478
|
+
if(const FunObjVar* svffun = _pag->getGNode(id)->getFunction())
|
|
479
|
+
{
|
|
480
|
+
return _callGraphSCC->isInCycle(_callGraph->getCallGraphNode(svffun)->getId());
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
/// If the points-to contain the object obj, we could move forward along indirect value-flow edge
|
|
487
|
+
virtual inline bool propagateViaObj(const CVar& storeObj, const CVar& loadObj)
|
|
488
|
+
{
|
|
489
|
+
return getPtrNodeID(storeObj) == getPtrNodeID(loadObj);
|
|
490
|
+
}
|
|
491
|
+
/// resolve function pointer
|
|
492
|
+
void resolveFunPtr(const DPIm& dpm)
|
|
493
|
+
{
|
|
494
|
+
if(const CallICFGNode* cbn= getSVFG()->isCallSiteRetSVFGNode(dpm.getLoc()))
|
|
495
|
+
{
|
|
496
|
+
if(_pag->isIndirectCallSites(cbn))
|
|
497
|
+
{
|
|
498
|
+
NodeID funPtr = _pag->getFunPtr(cbn);
|
|
499
|
+
DPIm funPtrDpm(dpm);
|
|
500
|
+
funPtrDpm.setLocVar(getSVFG()->getDefSVFGNode(_pag->getGNode(funPtr)),funPtr);
|
|
501
|
+
findPT(funPtrDpm);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
else if(const FunObjVar* fun = getSVFG()->isFunEntrySVFGNode(dpm.getLoc()))
|
|
505
|
+
{
|
|
506
|
+
CallInstSet csSet;
|
|
507
|
+
/// use pre-analysis call graph to approximate all potential callsites
|
|
508
|
+
_ander->getCallGraph()->getIndCallSitesInvokingCallee(fun,csSet);
|
|
509
|
+
for(CallInstSet::const_iterator it = csSet.begin(), eit = csSet.end(); it!=eit; ++it)
|
|
510
|
+
{
|
|
511
|
+
NodeID funPtr = _pag->getFunPtr(*it);
|
|
512
|
+
DPIm funPtrDpm(dpm);
|
|
513
|
+
funPtrDpm.setLocVar(getSVFG()->getDefSVFGNode(_pag->getGNode(funPtr)),funPtr);
|
|
514
|
+
findPT(funPtrDpm);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
/// Methods to be implemented in child class
|
|
519
|
+
//@{
|
|
520
|
+
/// Get variable ID (PAGNodeID) according to CVar
|
|
521
|
+
virtual NodeID getPtrNodeID(const CVar& var) const = 0;
|
|
522
|
+
/// ProcessGep node to generate field object nodes of a struct
|
|
523
|
+
virtual CPtSet processGepPts(const GepSVFGNode* gep, const CPtSet& srcPts) = 0;
|
|
524
|
+
/// Handle AddrSVFGNode to add proper points-to
|
|
525
|
+
virtual void handleAddr(CPtSet& pts,const DPIm& dpm,const AddrSVFGNode* addr) = 0;
|
|
526
|
+
/// Get conservative points-to results when the query is out of budget
|
|
527
|
+
virtual CPtSet getConservativeCPts(const DPIm& dpm) = 0;
|
|
528
|
+
/// Handle condition for context or path analysis (backward analysis)
|
|
529
|
+
virtual inline bool handleBKCondition(DPIm&, const SVFGEdge*)
|
|
530
|
+
{
|
|
531
|
+
return true;
|
|
532
|
+
}
|
|
533
|
+
/// Update call graph
|
|
534
|
+
virtual inline void updateCallGraphAndSVFG(const DPIm&, const CallICFGNode*, SVFGEdgeSet&) {}
|
|
535
|
+
//@}
|
|
536
|
+
|
|
537
|
+
///Visited flags to avoid cycles
|
|
538
|
+
//@{
|
|
539
|
+
inline void markbkVisited(const DPIm& dpm)
|
|
540
|
+
{
|
|
541
|
+
backwardVisited.insert(dpm);
|
|
542
|
+
}
|
|
543
|
+
inline bool isbkVisited(const DPIm& dpm)
|
|
544
|
+
{
|
|
545
|
+
return backwardVisited.find(dpm)!=backwardVisited.end();
|
|
546
|
+
}
|
|
547
|
+
inline void clearbkVisited(const DPIm& dpm)
|
|
548
|
+
{
|
|
549
|
+
assert(backwardVisited.find(dpm)!=backwardVisited.end() && "dpm not found!");
|
|
550
|
+
backwardVisited.erase(dpm);
|
|
551
|
+
}
|
|
552
|
+
//@}
|
|
553
|
+
|
|
554
|
+
/// Points-to Caching for top-level pointers and address-taken objects
|
|
555
|
+
//@{
|
|
556
|
+
virtual inline const CPtSet& getCachedPointsTo(const DPIm& dpm)
|
|
557
|
+
{
|
|
558
|
+
if (isTopLevelPtrStmt(dpm.getLoc()))
|
|
559
|
+
return getCachedTLPointsTo(dpm);
|
|
560
|
+
else
|
|
561
|
+
return getCachedADPointsTo(dpm);
|
|
562
|
+
}
|
|
563
|
+
virtual inline void updateCachedPointsTo(const DPIm& dpm, const CPtSet& pts)
|
|
564
|
+
{
|
|
565
|
+
if (unionDDAPts(dpm, pts))
|
|
566
|
+
{
|
|
567
|
+
DOSTAT(double start = DDAStat::getClk(true));
|
|
568
|
+
reCompute(dpm);
|
|
569
|
+
DOSTAT(ddaStat->_AnaTimeCyclePerQuery += DDAStat::getClk(true) - start);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
virtual inline const CPtSet& getCachedTLPointsTo(const DPIm& dpm)
|
|
573
|
+
{
|
|
574
|
+
return dpmToTLCPtSetMap[dpm];
|
|
575
|
+
}
|
|
576
|
+
virtual inline const CPtSet& getCachedADPointsTo(const DPIm& dpm)
|
|
577
|
+
{
|
|
578
|
+
return dpmToADCPtSetMap[dpm];
|
|
579
|
+
}
|
|
580
|
+
//@}
|
|
581
|
+
|
|
582
|
+
/// Whether this is a top-level pointer statement
|
|
583
|
+
inline bool isTopLevelPtrStmt(const SVFGNode* stmt)
|
|
584
|
+
{
|
|
585
|
+
return !SVFUtil::isa<StoreSVFGNode, MRSVFGNode>(stmt);
|
|
586
|
+
}
|
|
587
|
+
/// Return dpm with old context and path conditions
|
|
588
|
+
virtual inline DPIm getDPImWithOldCond(const DPIm& oldDpm,const CVar& var, const SVFGNode* loc)
|
|
589
|
+
{
|
|
590
|
+
DPIm dpm(oldDpm);
|
|
591
|
+
dpm.setLocVar(loc,getPtrNodeID(var));
|
|
592
|
+
|
|
593
|
+
if(SVFUtil::isa<StoreSVFGNode>(loc))
|
|
594
|
+
addLoadDpmAndCVar(dpm,getLoadDpm(oldDpm),var);
|
|
595
|
+
|
|
596
|
+
if(SVFUtil::isa<LoadSVFGNode>(loc))
|
|
597
|
+
addLoadDpmAndCVar(dpm,oldDpm,var);
|
|
598
|
+
|
|
599
|
+
DOSTAT(ddaStat->_NumOfDPM++);
|
|
600
|
+
return dpm;
|
|
601
|
+
}
|
|
602
|
+
/// SVFG SCC detection
|
|
603
|
+
inline void SVFGSCCDetection()
|
|
604
|
+
{
|
|
605
|
+
if(_svfgSCC==nullptr)
|
|
606
|
+
{
|
|
607
|
+
_svfgSCC = new SVFGSCC(getSVFG());
|
|
608
|
+
}
|
|
609
|
+
_svfgSCC->find();
|
|
610
|
+
}
|
|
611
|
+
/// Get SCC rep node of a SVFG node.
|
|
612
|
+
inline NodeID getSVFGSCCRepNode(NodeID id)
|
|
613
|
+
{
|
|
614
|
+
return _svfgSCC->repNode(id);
|
|
615
|
+
}
|
|
616
|
+
/// Return whether this SVFGNode is in cycle
|
|
617
|
+
inline bool isSVFGNodeInCycle(const SVFGNode* node)
|
|
618
|
+
{
|
|
619
|
+
return _svfgSCC->isInCycle(node->getId());
|
|
620
|
+
}
|
|
621
|
+
/// Return TRUE if this edge is inside a SVFG SCC, i.e., src node and dst node are in the same SCC on the SVFG.
|
|
622
|
+
inline bool edgeInSVFGSCC(const SVFGEdge* edge)
|
|
623
|
+
{
|
|
624
|
+
return (getSVFGSCCRepNode(edge->getSrcID()) == getSVFGSCCRepNode(edge->getDstID()));
|
|
625
|
+
}
|
|
626
|
+
/// Set callgraph
|
|
627
|
+
inline void setCallGraph (CallGraph* cg)
|
|
628
|
+
{
|
|
629
|
+
_callGraph = cg;
|
|
630
|
+
}
|
|
631
|
+
/// Set callgraphSCC
|
|
632
|
+
inline void setCallGraphSCC (CallGraphSCC* scc)
|
|
633
|
+
{
|
|
634
|
+
_callGraphSCC = scc;
|
|
635
|
+
}
|
|
636
|
+
/// Check heap and array object
|
|
637
|
+
//@{
|
|
638
|
+
virtual inline bool isHeapCondMemObj(const CVar& var, const StoreSVFGNode*)
|
|
639
|
+
{
|
|
640
|
+
const BaseObjVar* pVar = _pag->getBaseObject(getPtrNodeID(var));
|
|
641
|
+
return pVar && SVFUtil::isa<HeapObjVar, DummyObjVar>(pVar);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
inline bool isArrayCondMemObj(const CVar& var) const
|
|
645
|
+
{
|
|
646
|
+
const BaseObjVar* obj = _pag->getBaseObject(getPtrNodeID(var));
|
|
647
|
+
assert(obj && "base object is null??");
|
|
648
|
+
return obj->isArray();
|
|
649
|
+
}
|
|
650
|
+
inline bool isFieldInsenCondMemObj(const CVar& var) const
|
|
651
|
+
{
|
|
652
|
+
const BaseObjVar* baseObj = _pag->getBaseObject(getPtrNodeID(var));
|
|
653
|
+
return baseObj->isFieldInsensitive();
|
|
654
|
+
}
|
|
655
|
+
//@}
|
|
656
|
+
private:
|
|
657
|
+
/// Map a SVFGNode to its dpms for handling value-flow cycles
|
|
658
|
+
//@{
|
|
659
|
+
inline const LocToDPMVecMap& getLocToDPMVecMap() const
|
|
660
|
+
{
|
|
661
|
+
return locToDpmSetMap;
|
|
662
|
+
}
|
|
663
|
+
inline const DPTItemSet& getDpmSetAtLoc(const SVFGNode* loc)
|
|
664
|
+
{
|
|
665
|
+
return locToDpmSetMap[loc->getId()];
|
|
666
|
+
}
|
|
667
|
+
inline void addDpmToLoc(const DPIm& dpm)
|
|
668
|
+
{
|
|
669
|
+
locToDpmSetMap[dpm.getLoc()->getId()].insert(dpm);
|
|
670
|
+
}
|
|
671
|
+
inline void removeDpmFromLoc(const DPIm& dpm)
|
|
672
|
+
{
|
|
673
|
+
assert(dpm == locToDpmSetMap[dpm.getLoc()].back() && "dpm not match with the end of vector");
|
|
674
|
+
locToDpmSetMap[dpm.getLoc()->getId()].erase(dpm);
|
|
675
|
+
}
|
|
676
|
+
//@}
|
|
677
|
+
protected:
|
|
678
|
+
/// LoadDpm for must-alias analysis
|
|
679
|
+
//@{
|
|
680
|
+
inline void addLoadDpmAndCVar(const DPIm& dpm,const DPIm& loadDpm,const CVar& loadVar)
|
|
681
|
+
{
|
|
682
|
+
addLoadCVar(dpm,loadVar);
|
|
683
|
+
addLoadDpm(dpm,loadDpm);
|
|
684
|
+
}
|
|
685
|
+
/// Note that simply use "dpmToloadDpmMap[dpm]=loadDpm", requires DPIm have a default constructor
|
|
686
|
+
inline void addLoadDpm(const DPIm& dpm,const DPIm& loadDpm)
|
|
687
|
+
{
|
|
688
|
+
typename DPMToDPMMap::iterator it = dpmToloadDpmMap.find(dpm);
|
|
689
|
+
if(it!=dpmToloadDpmMap.end())
|
|
690
|
+
it->second = loadDpm;
|
|
691
|
+
else
|
|
692
|
+
dpmToloadDpmMap.insert(std::make_pair(dpm,loadDpm));
|
|
693
|
+
}
|
|
694
|
+
inline const DPIm& getLoadDpm(const DPIm& dpm) const
|
|
695
|
+
{
|
|
696
|
+
typename DPMToDPMMap::const_iterator it = dpmToloadDpmMap.find(dpm);
|
|
697
|
+
assert(it!=dpmToloadDpmMap.end() && "not found??");
|
|
698
|
+
return it->second;
|
|
699
|
+
}
|
|
700
|
+
inline void addLoadCVar(const DPIm& dpm, const CVar& loadVar)
|
|
701
|
+
{
|
|
702
|
+
typename DPMToCVarMap::iterator it = loadToPTCVarMap.find(dpm);
|
|
703
|
+
if(it!=loadToPTCVarMap.end())
|
|
704
|
+
it->second = loadVar;
|
|
705
|
+
else
|
|
706
|
+
loadToPTCVarMap.insert(std::make_pair(dpm,loadVar));
|
|
707
|
+
}
|
|
708
|
+
inline const CVar& getLoadCVar(const DPIm& dpm) const
|
|
709
|
+
{
|
|
710
|
+
typename DPMToCVarMap::const_iterator it = loadToPTCVarMap.find(dpm);
|
|
711
|
+
assert(it!=loadToPTCVarMap.end() && "not found??");
|
|
712
|
+
return it->second;
|
|
713
|
+
}
|
|
714
|
+
//@}
|
|
715
|
+
/// Return Andersen's analysis
|
|
716
|
+
inline AndersenWaveDiff* getAndersenAnalysis() const
|
|
717
|
+
{
|
|
718
|
+
return _ander;
|
|
719
|
+
}
|
|
720
|
+
/// handle out-of-budget queries
|
|
721
|
+
//@{
|
|
722
|
+
/// Handle out-of-budget dpm
|
|
723
|
+
inline void handleOutOfBudgetDpm(const DPIm& dpm) {}
|
|
724
|
+
inline bool testOutOfBudget(const DPIm& dpm)
|
|
725
|
+
{
|
|
726
|
+
if(outOfBudgetQuery) return true;
|
|
727
|
+
if(++ddaStat->_NumOfStep > DPIm::getMaxBudget())
|
|
728
|
+
outOfBudgetQuery = true;
|
|
729
|
+
return isOutOfBudgetDpm(dpm) || outOfBudgetQuery;
|
|
730
|
+
}
|
|
731
|
+
inline bool isOutOfBudgetQuery() const
|
|
732
|
+
{
|
|
733
|
+
return outOfBudgetQuery;
|
|
734
|
+
}
|
|
735
|
+
inline void addOutOfBudgetDpm(const DPIm& dpm)
|
|
736
|
+
{
|
|
737
|
+
outOfBudgetDpms.insert(dpm);
|
|
738
|
+
}
|
|
739
|
+
inline bool isOutOfBudgetDpm(const DPIm& dpm) const
|
|
740
|
+
{
|
|
741
|
+
return outOfBudgetDpms.find(dpm) != outOfBudgetDpms.end();
|
|
742
|
+
}
|
|
743
|
+
//@}
|
|
744
|
+
|
|
745
|
+
/// Set DDAStat
|
|
746
|
+
inline DDAStat* setDDAStat(DDAStat* s)
|
|
747
|
+
{
|
|
748
|
+
ddaStat = s;
|
|
749
|
+
return ddaStat;
|
|
750
|
+
}
|
|
751
|
+
/// stat strong updates num
|
|
752
|
+
inline void addSUStat(const DPIm& dpm, const SVFGNode* node)
|
|
753
|
+
{
|
|
754
|
+
if (storeToDPMs[node].insert(dpm).second)
|
|
755
|
+
{
|
|
756
|
+
ddaStat->_NumOfStrongUpdates++;
|
|
757
|
+
ddaStat->_StrongUpdateStores.set(node->getId());
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
/// remove strong updates num if the dpm goes to weak updates branch
|
|
761
|
+
inline void rmSUStat(const DPIm& dpm, const SVFGNode* node)
|
|
762
|
+
{
|
|
763
|
+
DPTItemSet& dpmSet = storeToDPMs[node];
|
|
764
|
+
if (dpmSet.erase(dpm))
|
|
765
|
+
{
|
|
766
|
+
ddaStat->_NumOfStrongUpdates--;
|
|
767
|
+
if(dpmSet.empty())
|
|
768
|
+
ddaStat->_StrongUpdateStores.reset(node->getId());
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
bool outOfBudgetQuery; ///< Whether the current query is out of step limits
|
|
773
|
+
SVFIR* _pag; ///< SVFIR
|
|
774
|
+
SVFG* _svfg; ///< SVFG
|
|
775
|
+
AndersenWaveDiff* _ander; ///< Andersen's analysis
|
|
776
|
+
NodeBS candidateQueries; ///< candidate pointers;
|
|
777
|
+
CallGraph* _callGraph; ///< PTACallGraph
|
|
778
|
+
CallGraphSCC* _callGraphSCC; ///< SCC for PTACallGraph
|
|
779
|
+
SVFGSCC* _svfgSCC; ///< SCC for SVFG
|
|
780
|
+
DPTItemSet backwardVisited; ///< visited map during backward traversing
|
|
781
|
+
DPImToCPtSetMap dpmToTLCPtSetMap; ///< points-to caching map for top-level vars
|
|
782
|
+
DPImToCPtSetMap dpmToADCPtSetMap; ///< points-to caching map for address-taken vars
|
|
783
|
+
LocToDPMVecMap locToDpmSetMap; ///< map location to its dpms
|
|
784
|
+
DPMToDPMMap dpmToloadDpmMap; ///< dpms at loads for may/must-alias analysis with stores
|
|
785
|
+
DPMToCVarMap loadToPTCVarMap; ///< map a load dpm to its cvar pointed by its pointer operand
|
|
786
|
+
DPTItemSet outOfBudgetDpms; ///< out of budget dpm set
|
|
787
|
+
StoreToPMSetMap storeToDPMs; ///< map store to set of DPM which have been stong updated there
|
|
788
|
+
DDAStat* ddaStat; ///< DDA stat
|
|
789
|
+
SVFGBuilder svfgBuilder; ///< SVFG Builder
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
} // End namespace SVF
|
|
793
|
+
|
|
794
|
+
#endif /* VALUEFLOWDDA_H_ */
|