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,1025 @@
|
|
|
1
|
+
//===- MutablePointsToDS.h -- Mutable points-to data structure-------------//
|
|
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
|
+
/// PTData (AbstractPointsToDS.h) implementations with a mutable backend.
|
|
24
|
+
/// Each Key is given a points-to set which is itself updated till the analysis terminates.
|
|
25
|
+
|
|
26
|
+
/*
|
|
27
|
+
* MutablePointsToDS.h
|
|
28
|
+
*
|
|
29
|
+
* Authors: Mohamad Barbar and Yulei Sui
|
|
30
|
+
*
|
|
31
|
+
* The implementation is based on
|
|
32
|
+
* Mohamad Barbar and Yulei Sui. Hash Consed Points-To Sets.
|
|
33
|
+
* 28th Static Analysis Symposium (SAS'21)
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
#ifndef MUTABLE_POINTSTO_H_
|
|
37
|
+
#define MUTABLE_POINTSTO_H_
|
|
38
|
+
|
|
39
|
+
#include<fstream>
|
|
40
|
+
|
|
41
|
+
#include "MemoryModel/AbstractPointsToDS.h"
|
|
42
|
+
#include "SVFIR/SVFType.h"
|
|
43
|
+
#include "Util/SVFUtil.h"
|
|
44
|
+
|
|
45
|
+
namespace SVF
|
|
46
|
+
{
|
|
47
|
+
|
|
48
|
+
template <typename Key, typename KeySet, typename Data, typename DataSet>
|
|
49
|
+
class MutableDFPTData;
|
|
50
|
+
|
|
51
|
+
/// PTData implemented using points-to sets which are created once and updated continuously.
|
|
52
|
+
template <typename Key, typename KeySet, typename Data, typename DataSet>
|
|
53
|
+
class MutablePTData : public PTData<Key, KeySet, Data, DataSet>
|
|
54
|
+
{
|
|
55
|
+
friend class MutableDFPTData<Key, KeySet, Data, DataSet>;
|
|
56
|
+
public:
|
|
57
|
+
typedef PTData<Key, KeySet, Data, DataSet> BasePTData;
|
|
58
|
+
typedef typename BasePTData::PTDataTy PTDataTy;
|
|
59
|
+
|
|
60
|
+
typedef Map<Key, DataSet> PtsMap;
|
|
61
|
+
typedef Map<Data, KeySet> RevPtsMap;
|
|
62
|
+
typedef typename PtsMap::iterator PtsMapIter;
|
|
63
|
+
typedef typename PtsMap::const_iterator PtsMapConstIter;
|
|
64
|
+
typedef typename DataSet::iterator iterator;
|
|
65
|
+
|
|
66
|
+
/// Constructor
|
|
67
|
+
MutablePTData(bool reversePT = true, PTDataTy ty = PTDataTy::MutBase) : BasePTData(reversePT, ty) { }
|
|
68
|
+
|
|
69
|
+
virtual ~MutablePTData() { }
|
|
70
|
+
|
|
71
|
+
/// Return Points-to map
|
|
72
|
+
virtual inline const PtsMap& getPtsMap() const
|
|
73
|
+
{
|
|
74
|
+
return ptsMap;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
virtual inline void clear() override
|
|
78
|
+
{
|
|
79
|
+
ptsMap.clear();
|
|
80
|
+
revPtsMap.clear();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
virtual inline const DataSet& getPts(const Key& var) override
|
|
84
|
+
{
|
|
85
|
+
return ptsMap[var];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
virtual inline const KeySet& getRevPts(const Data& datum) override
|
|
89
|
+
{
|
|
90
|
+
assert(this->rev && "MutablePTData::getRevPts: constructed without reverse PT support!");
|
|
91
|
+
return revPtsMap[datum];
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
virtual inline bool addPts(const Key &dstKey, const Data& element) override
|
|
95
|
+
{
|
|
96
|
+
addSingleRevPts(revPtsMap[element], dstKey);
|
|
97
|
+
return addPts(ptsMap[dstKey], element);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
virtual inline bool unionPts(const Key& dstKey, const Key& srcKey) override
|
|
101
|
+
{
|
|
102
|
+
addRevPts(ptsMap[srcKey], dstKey);
|
|
103
|
+
return unionPts(ptsMap[dstKey], getPts(srcKey));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
virtual inline bool unionPts(const Key& dstKey, const DataSet& srcDataSet) override
|
|
107
|
+
{
|
|
108
|
+
addRevPts(srcDataSet,dstKey);
|
|
109
|
+
return unionPts(ptsMap[dstKey], srcDataSet);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
virtual inline void dumpPTData() override
|
|
113
|
+
{
|
|
114
|
+
dumpPts(ptsMap);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
virtual void clearPts(const Key& var, const Data& element) override
|
|
118
|
+
{
|
|
119
|
+
clearSingleRevPts(revPtsMap[element], var);
|
|
120
|
+
ptsMap[var].reset(element);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
virtual void clearFullPts(const Key& var) override
|
|
124
|
+
{
|
|
125
|
+
DataSet &pts = ptsMap[var];
|
|
126
|
+
clearRevPts(pts, var);
|
|
127
|
+
pts.clear();
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
virtual void remapAllPts(void) override
|
|
131
|
+
{
|
|
132
|
+
for (typename PtsMap::value_type &ppt : ptsMap) ppt.second.checkAndRemap();
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
virtual inline Map<DataSet, unsigned> getAllPts(bool liveOnly) const override
|
|
136
|
+
{
|
|
137
|
+
Map<DataSet, unsigned> allPts;
|
|
138
|
+
for (typename PtsMap::value_type ppt : ptsMap)
|
|
139
|
+
{
|
|
140
|
+
const DataSet &pt = ppt.second;
|
|
141
|
+
++allPts[pt];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return allPts;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/// Methods to support type inquiry through isa, cast, and dyn_cast:
|
|
148
|
+
///@{
|
|
149
|
+
static inline bool classof(const MutablePTData<Key, KeySet, Data, DataSet> *)
|
|
150
|
+
{
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
static inline bool classof(const PTData<Key, KeySet, Data, DataSet>* ptd)
|
|
155
|
+
{
|
|
156
|
+
return ptd->getPTDTY() == PTDataTy::MutBase;
|
|
157
|
+
}
|
|
158
|
+
///@}
|
|
159
|
+
|
|
160
|
+
protected:
|
|
161
|
+
virtual inline void dumpPts(const PtsMap & ptsSet,OutStream & O = SVFUtil::outs()) const
|
|
162
|
+
{
|
|
163
|
+
for (PtsMapConstIter nodeIt = ptsSet.begin(); nodeIt != ptsSet.end(); nodeIt++)
|
|
164
|
+
{
|
|
165
|
+
const Key& var = nodeIt->first;
|
|
166
|
+
const DataSet & pts = nodeIt->second;
|
|
167
|
+
if (pts.empty())
|
|
168
|
+
continue;
|
|
169
|
+
O << var << " ==> { ";
|
|
170
|
+
for(typename DataSet::iterator cit = pts.begin(), ecit=pts.end(); cit!=ecit; ++cit)
|
|
171
|
+
{
|
|
172
|
+
O << *cit << " ";
|
|
173
|
+
}
|
|
174
|
+
O << "}\n";
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
private:
|
|
179
|
+
/// Internal union/add points-to helper methods.
|
|
180
|
+
///@{
|
|
181
|
+
inline bool unionPts(DataSet& dstDataSet, const DataSet& srcDataSet)
|
|
182
|
+
{
|
|
183
|
+
return dstDataSet |= srcDataSet;
|
|
184
|
+
}
|
|
185
|
+
inline bool addPts(DataSet &d, const Data& e)
|
|
186
|
+
{
|
|
187
|
+
return d.test_and_set(e);
|
|
188
|
+
}
|
|
189
|
+
inline void addSingleRevPts(KeySet &revData, const Key& tgr)
|
|
190
|
+
{
|
|
191
|
+
if (this->rev)
|
|
192
|
+
{
|
|
193
|
+
SVFUtil::insertKey(tgr, revData);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
inline void addRevPts(const DataSet &ptsData, const Key& tgr)
|
|
197
|
+
{
|
|
198
|
+
if (this->rev)
|
|
199
|
+
{
|
|
200
|
+
for(iterator it = ptsData.begin(), eit = ptsData.end(); it!=eit; ++it)
|
|
201
|
+
addSingleRevPts(revPtsMap[*it], tgr);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
inline void clearSingleRevPts(KeySet &revSet, const Key &k)
|
|
205
|
+
{
|
|
206
|
+
if (this->rev)
|
|
207
|
+
{
|
|
208
|
+
SVFUtil::removeKey(k, revSet);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
inline void clearRevPts(const DataSet &pts, const Key &k)
|
|
212
|
+
{
|
|
213
|
+
if (this->rev)
|
|
214
|
+
{
|
|
215
|
+
for (const Data &d : pts) clearSingleRevPts(revPtsMap[d], k);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
///@}
|
|
219
|
+
|
|
220
|
+
protected:
|
|
221
|
+
PtsMap ptsMap;
|
|
222
|
+
RevPtsMap revPtsMap;
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
/// DiffPTData implemented with points-to sets which are updated continuously.
|
|
226
|
+
template <typename Key, typename KeySet, typename Data, typename DataSet>
|
|
227
|
+
class MutableDiffPTData : public DiffPTData<Key, KeySet, Data, DataSet>
|
|
228
|
+
{
|
|
229
|
+
public:
|
|
230
|
+
typedef PTData<Key, KeySet, Data, DataSet> BasePTData;
|
|
231
|
+
typedef DiffPTData<Key, KeySet, Data, DataSet> BaseDiffPTData;
|
|
232
|
+
typedef typename BasePTData::PTDataTy PTDataTy;
|
|
233
|
+
|
|
234
|
+
typedef typename MutablePTData<Key, KeySet, Data, DataSet>::PtsMap PtsMap;
|
|
235
|
+
|
|
236
|
+
/// Constructor
|
|
237
|
+
explicit MutableDiffPTData(bool reversePT = true, PTDataTy ty = PTDataTy::Diff) : BaseDiffPTData(reversePT, ty), mutPTData(reversePT) { }
|
|
238
|
+
|
|
239
|
+
~MutableDiffPTData() override = default;
|
|
240
|
+
|
|
241
|
+
virtual inline const PtsMap& getPtsMap() const
|
|
242
|
+
{
|
|
243
|
+
return mutPTData.getPtsMap();
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
inline void clear() override
|
|
247
|
+
{
|
|
248
|
+
mutPTData.clear();
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
virtual inline const DataSet& getPts(const Key& var) override
|
|
252
|
+
{
|
|
253
|
+
return mutPTData.getPts(var);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
virtual inline const KeySet& getRevPts(const Data& datum) override
|
|
257
|
+
{
|
|
258
|
+
assert(this->rev && "MutableDiffPTData::getRevPts: constructed without reverse PT support!");
|
|
259
|
+
return mutPTData.getRevPts(datum);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
virtual inline bool addPts(const Key &dstKey, const Data& element) override
|
|
263
|
+
{
|
|
264
|
+
return mutPTData.addPts(dstKey, element);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
virtual inline bool unionPts(const Key& dstKey, const Key& srcKey) override
|
|
268
|
+
{
|
|
269
|
+
return mutPTData.unionPts(dstKey, srcKey);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
virtual inline bool unionPts(const Key& dstKey, const DataSet& srcDataSet) override
|
|
273
|
+
{
|
|
274
|
+
return mutPTData.unionPts(dstKey, srcDataSet);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
virtual void clearPts(const Key& var, const Data& element) override
|
|
278
|
+
{
|
|
279
|
+
mutPTData.clearPts(var, element);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
virtual void clearFullPts(const Key& var) override
|
|
283
|
+
{
|
|
284
|
+
mutPTData.clearFullPts(var);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
virtual void remapAllPts(void) override
|
|
288
|
+
{
|
|
289
|
+
mutPTData.remapAllPts();
|
|
290
|
+
for (typename PtsMap::value_type &ppt : diffPtsMap) ppt.second.checkAndRemap();
|
|
291
|
+
for (typename PtsMap::value_type &ppt : propaPtsMap) ppt.second.checkAndRemap();
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
virtual inline void dumpPTData() override
|
|
295
|
+
{
|
|
296
|
+
mutPTData.dumpPTData();
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
virtual inline const DataSet &getDiffPts(Key &var) override
|
|
300
|
+
{
|
|
301
|
+
return diffPtsMap[var];
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
virtual inline bool computeDiffPts(Key &var, const DataSet &all) override
|
|
305
|
+
{
|
|
306
|
+
/// Clear diff pts.
|
|
307
|
+
DataSet& diff = diffPtsMap[var];
|
|
308
|
+
diff.clear();
|
|
309
|
+
/// Get all pts.
|
|
310
|
+
DataSet& propa = getPropaPts(var);
|
|
311
|
+
diff.intersectWithComplement(all, propa);
|
|
312
|
+
propa = all;
|
|
313
|
+
return !diff.empty();
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
virtual inline void updatePropaPtsMap(Key &src, Key &dst) override
|
|
317
|
+
{
|
|
318
|
+
DataSet& srcPropa = getPropaPts(src);
|
|
319
|
+
DataSet& dstPropa = getPropaPts(dst);
|
|
320
|
+
dstPropa &= srcPropa;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
virtual inline void clearPropaPts(Key &var) override
|
|
324
|
+
{
|
|
325
|
+
getPropaPts(var).clear();
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
virtual inline Map<DataSet, unsigned> getAllPts(bool liveOnly) const override
|
|
329
|
+
{
|
|
330
|
+
return mutPTData.getAllPts(liveOnly);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/// Methods to support type inquiry through isa, cast, and dyn_cast:
|
|
334
|
+
///@{
|
|
335
|
+
static inline bool classof(const MutableDiffPTData<Key, KeySet, Data, DataSet> *)
|
|
336
|
+
{
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
static inline bool classof(const PTData<Key, KeySet, Data, DataSet>* ptd)
|
|
341
|
+
{
|
|
342
|
+
return ptd->getPTDTY() == PTDataTy::MutDiff;
|
|
343
|
+
}
|
|
344
|
+
///@}
|
|
345
|
+
|
|
346
|
+
protected:
|
|
347
|
+
/// Get propagated points to.
|
|
348
|
+
inline DataSet &getPropaPts(Key &var)
|
|
349
|
+
{
|
|
350
|
+
return propaPtsMap[var];
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
private:
|
|
354
|
+
/// Backing to implement the basic PTData methods. This allows us to avoid multiple-inheritance.
|
|
355
|
+
MutablePTData<Key, KeySet, Data, DataSet> mutPTData;
|
|
356
|
+
/// Diff points-to to be propagated.
|
|
357
|
+
PtsMap diffPtsMap;
|
|
358
|
+
/// Points-to already propagated.
|
|
359
|
+
PtsMap propaPtsMap;
|
|
360
|
+
};
|
|
361
|
+
|
|
362
|
+
template <typename Key, typename KeySet, typename Data, typename DataSet>
|
|
363
|
+
class MutableDFPTData : public DFPTData<Key, KeySet, Data, DataSet>
|
|
364
|
+
{
|
|
365
|
+
public:
|
|
366
|
+
typedef PTData<Key, KeySet, Data, DataSet> BasePTData;
|
|
367
|
+
typedef MutablePTData<Key, KeySet, Data, DataSet> BaseMutPTData;
|
|
368
|
+
typedef DFPTData<Key, KeySet, Data, DataSet> BaseDFPTData;
|
|
369
|
+
typedef typename BasePTData::PTDataTy PTDataTy;
|
|
370
|
+
|
|
371
|
+
typedef typename BaseDFPTData::LocID LocID;
|
|
372
|
+
typedef typename BaseMutPTData::PtsMap PtsMap;
|
|
373
|
+
typedef typename BaseMutPTData::PtsMapConstIter PtsMapConstIter;
|
|
374
|
+
typedef Map<LocID, PtsMap> DFPtsMap; ///< Data-flow point-to map
|
|
375
|
+
typedef typename DFPtsMap::iterator DFPtsMapIter;
|
|
376
|
+
typedef typename DFPtsMap::const_iterator DFPtsMapconstIter;
|
|
377
|
+
|
|
378
|
+
/// Constructor
|
|
379
|
+
MutableDFPTData(bool reversePT = true, PTDataTy ty = BaseDFPTData::MutDataFlow) : BaseDFPTData(reversePT, ty), mutPTData(reversePT) { }
|
|
380
|
+
|
|
381
|
+
virtual ~MutableDFPTData() { }
|
|
382
|
+
|
|
383
|
+
virtual inline const PtsMap& getPtsMap() const
|
|
384
|
+
{
|
|
385
|
+
return mutPTData.getPtsMap();
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
virtual inline void clear() override
|
|
389
|
+
{
|
|
390
|
+
mutPTData.clear();
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
virtual inline const DataSet& getPts(const Key& var) override
|
|
394
|
+
{
|
|
395
|
+
return mutPTData.getPts(var);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
virtual inline const KeySet& getRevPts(const Data& datum) override
|
|
399
|
+
{
|
|
400
|
+
assert(this->rev && "MutableDFPTData::getRevPts: constructed without reverse PT support!");
|
|
401
|
+
return mutPTData.getRevPts(datum);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
virtual inline bool hasDFInSet(LocID loc) const override
|
|
405
|
+
{
|
|
406
|
+
return (dfInPtsMap.find(loc) != dfInPtsMap.end());
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
virtual inline bool hasDFOutSet(LocID loc) const override
|
|
410
|
+
{
|
|
411
|
+
return (dfOutPtsMap.find(loc) != dfOutPtsMap.end());
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
virtual inline bool hasDFInSet(LocID loc,const Key& var) const override
|
|
415
|
+
{
|
|
416
|
+
DFPtsMapconstIter it = dfInPtsMap.find(loc);
|
|
417
|
+
if ( it == dfInPtsMap.end())
|
|
418
|
+
return false;
|
|
419
|
+
const PtsMap& ptsMap = it->second;
|
|
420
|
+
return (ptsMap.find(var) != ptsMap.end());
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
virtual inline bool hasDFOutSet(LocID loc, const Key& var) const override
|
|
424
|
+
{
|
|
425
|
+
DFPtsMapconstIter it = dfOutPtsMap.find(loc);
|
|
426
|
+
if ( it == dfOutPtsMap.end())
|
|
427
|
+
return false;
|
|
428
|
+
const PtsMap& ptsMap = it->second;
|
|
429
|
+
return (ptsMap.find(var) != ptsMap.end());
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
virtual inline DataSet& getDFInPtsSet(LocID loc, const Key& var) override
|
|
433
|
+
{
|
|
434
|
+
PtsMap& inSet = dfInPtsMap[loc];
|
|
435
|
+
return inSet[var];
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
virtual inline DataSet& getDFOutPtsSet(LocID loc, const Key& var) override
|
|
439
|
+
{
|
|
440
|
+
PtsMap& outSet = dfOutPtsMap[loc];
|
|
441
|
+
return outSet[var];
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/// Get internal flow-sensitive data structures.
|
|
445
|
+
///@{
|
|
446
|
+
inline const PtsMap& getDFInPtsMap(LocID loc)
|
|
447
|
+
{
|
|
448
|
+
return dfInPtsMap[loc];
|
|
449
|
+
}
|
|
450
|
+
inline const PtsMap& getDFOutPtsMap(LocID loc)
|
|
451
|
+
{
|
|
452
|
+
return dfOutPtsMap[loc];
|
|
453
|
+
}
|
|
454
|
+
inline const DFPtsMap& getDFIn()
|
|
455
|
+
{
|
|
456
|
+
return dfInPtsMap;
|
|
457
|
+
}
|
|
458
|
+
inline const DFPtsMap& getDFOut()
|
|
459
|
+
{
|
|
460
|
+
return dfOutPtsMap;
|
|
461
|
+
}
|
|
462
|
+
///@}
|
|
463
|
+
|
|
464
|
+
virtual inline bool updateDFInFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
465
|
+
{
|
|
466
|
+
return this->unionPts(getDFInPtsSet(dstLoc,dstVar), getDFInPtsSet(srcLoc,srcVar));
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
virtual inline bool updateDFInFromOut(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
470
|
+
{
|
|
471
|
+
return this->unionPts(getDFInPtsSet(dstLoc,dstVar), getDFOutPtsSet(srcLoc,srcVar));
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
virtual inline bool updateDFOutFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
475
|
+
{
|
|
476
|
+
return this->unionPts(getDFOutPtsSet(dstLoc,dstVar), getDFInPtsSet(srcLoc,srcVar));
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
virtual inline bool updateAllDFInFromOut(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
480
|
+
{
|
|
481
|
+
return this->updateDFInFromOut(srcLoc,srcVar,dstLoc,dstVar);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
virtual inline bool updateAllDFInFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
485
|
+
{
|
|
486
|
+
return this->updateDFInFromIn(srcLoc,srcVar,dstLoc,dstVar);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
virtual inline bool updateAllDFOutFromIn(LocID loc, const Key& singleton, bool strongUpdates) override
|
|
490
|
+
{
|
|
491
|
+
bool changed = false;
|
|
492
|
+
if (this->hasDFInSet(loc))
|
|
493
|
+
{
|
|
494
|
+
/// Only variables has new pts from IN set need to be updated.
|
|
495
|
+
const PtsMap & ptsMap = getDFInPtsMap(loc);
|
|
496
|
+
for (typename PtsMap::const_iterator ptsIt = ptsMap.begin(), ptsEit = ptsMap.end(); ptsIt != ptsEit; ++ptsIt)
|
|
497
|
+
{
|
|
498
|
+
const Key var = ptsIt->first;
|
|
499
|
+
/// Enable strong updates if it is required to do so
|
|
500
|
+
if (strongUpdates && var == singleton)
|
|
501
|
+
continue;
|
|
502
|
+
if (updateDFOutFromIn(loc, var, loc, var))
|
|
503
|
+
changed = true;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
return changed;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
virtual inline bool updateTLVPts(LocID srcLoc, const Key& srcVar, const Key& dstVar) override
|
|
510
|
+
{
|
|
511
|
+
return this->unionPts(dstVar, this->getDFInPtsSet(srcLoc,srcVar));
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
virtual inline bool updateATVPts(const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
515
|
+
{
|
|
516
|
+
return (this->unionPts(this->getDFOutPtsSet(dstLoc, dstVar), this->getPts(srcVar)));
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
virtual inline void clearAllDFOutUpdatedVar(LocID) override
|
|
520
|
+
{
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/// Override the methods defined in PTData.
|
|
524
|
+
/// Union/add points-to without adding reverse points-to, used internally
|
|
525
|
+
///@{
|
|
526
|
+
virtual inline bool addPts(const Key &dstKey, const Key& srcKey) override
|
|
527
|
+
{
|
|
528
|
+
return addPts(mutPTData.ptsMap[dstKey], srcKey);
|
|
529
|
+
}
|
|
530
|
+
virtual inline bool unionPts(const Key& dstKey, const Key& srcKey) override
|
|
531
|
+
{
|
|
532
|
+
return unionPts(mutPTData.ptsMap[dstKey], getPts(srcKey));
|
|
533
|
+
}
|
|
534
|
+
virtual inline bool unionPts(const Key& dstKey, const DataSet& srcDataSet) override
|
|
535
|
+
{
|
|
536
|
+
return unionPts(mutPTData.ptsMap[dstKey], srcDataSet);
|
|
537
|
+
}
|
|
538
|
+
virtual void clearPts(const Key& var, const Data& element) override
|
|
539
|
+
{
|
|
540
|
+
mutPTData.clearPts(var, element);
|
|
541
|
+
}
|
|
542
|
+
virtual void clearFullPts(const Key& var) override
|
|
543
|
+
{
|
|
544
|
+
mutPTData.clearFullPts(var);
|
|
545
|
+
}
|
|
546
|
+
virtual void remapAllPts(void) override
|
|
547
|
+
{
|
|
548
|
+
mutPTData.remapAllPts();
|
|
549
|
+
for (typename DFPtsMap::value_type &lopt : dfInPtsMap)
|
|
550
|
+
{
|
|
551
|
+
for (typename PtsMap::value_type &opt : lopt.second) opt.second.checkAndRemap();
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
for (typename DFPtsMap::value_type &lopt : dfOutPtsMap)
|
|
555
|
+
{
|
|
556
|
+
for (typename PtsMap::value_type &opt : lopt.second) opt.second.checkAndRemap();
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
///@}
|
|
560
|
+
|
|
561
|
+
virtual inline Map<DataSet, unsigned> getAllPts(bool liveOnly) const override
|
|
562
|
+
{
|
|
563
|
+
Map<DataSet, unsigned> allPts = mutPTData.getAllPts(liveOnly);
|
|
564
|
+
for (typename DFPtsMap::value_type lptsmap : dfInPtsMap)
|
|
565
|
+
{
|
|
566
|
+
for (typename PtsMap::value_type vpt : lptsmap.second)
|
|
567
|
+
{
|
|
568
|
+
++allPts[vpt.second];
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
for (typename DFPtsMap::value_type lptm : dfOutPtsMap)
|
|
573
|
+
{
|
|
574
|
+
for (typename PtsMap::value_type vpt : lptm.second)
|
|
575
|
+
{
|
|
576
|
+
++allPts[vpt.second];
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
return allPts;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/// Methods to support type inquiry through isa, cast, and dyn_cast:
|
|
584
|
+
///@{
|
|
585
|
+
static inline bool classof(const MutableDFPTData<Key, KeySet, Data, DataSet> *)
|
|
586
|
+
{
|
|
587
|
+
return true;
|
|
588
|
+
}
|
|
589
|
+
static inline bool classof(const PTData<Key, KeySet, Data, DataSet>* ptd)
|
|
590
|
+
{
|
|
591
|
+
return ptd->getPTDTY() == BaseDFPTData::MutDataFlow
|
|
592
|
+
|| ptd->getPTDTY() == BaseDFPTData::MutIncDataFlow;
|
|
593
|
+
}
|
|
594
|
+
///@}
|
|
595
|
+
|
|
596
|
+
protected:
|
|
597
|
+
/// Internal union/add points-to helper methods.
|
|
598
|
+
///@{
|
|
599
|
+
inline bool unionPts(DataSet& dstDataSet, const DataSet& srcDataSet)
|
|
600
|
+
{
|
|
601
|
+
return dstDataSet |= srcDataSet;
|
|
602
|
+
}
|
|
603
|
+
inline bool addPts(DataSet &d, const Data& e)
|
|
604
|
+
{
|
|
605
|
+
return d.test_and_set(e);
|
|
606
|
+
}
|
|
607
|
+
///@}
|
|
608
|
+
|
|
609
|
+
public:
|
|
610
|
+
/// Dump the DF IN/OUT set information for debugging purpose
|
|
611
|
+
///@{
|
|
612
|
+
virtual inline void dumpPTData() override
|
|
613
|
+
{
|
|
614
|
+
/// dump points-to of top-level pointers
|
|
615
|
+
mutPTData.dumpPTData();
|
|
616
|
+
/// dump points-to of address-taken variables
|
|
617
|
+
std::error_code ErrInfo;
|
|
618
|
+
std::fstream f("svfg_pts.data", std::ios_base::out);
|
|
619
|
+
if (f.good())
|
|
620
|
+
{
|
|
621
|
+
NodeBS locs;
|
|
622
|
+
for(DFPtsMapconstIter it = dfInPtsMap.begin(), eit = dfInPtsMap.end(); it!=eit; ++it)
|
|
623
|
+
locs.set(it->first);
|
|
624
|
+
|
|
625
|
+
for(DFPtsMapconstIter it = dfOutPtsMap.begin(), eit = dfOutPtsMap.end(); it!=eit; ++it)
|
|
626
|
+
locs.set(it->first);
|
|
627
|
+
|
|
628
|
+
for (NodeBS::iterator it = locs.begin(), eit = locs.end(); it != eit; it++)
|
|
629
|
+
{
|
|
630
|
+
LocID loc = *it;
|
|
631
|
+
if (this->hasDFInSet(loc))
|
|
632
|
+
{
|
|
633
|
+
f << "Loc:" << loc << " IN:{";
|
|
634
|
+
this->dumpPts(this->getDFInPtsMap(loc), f);
|
|
635
|
+
f << "}\n";
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
if (this->hasDFOutSet(loc))
|
|
639
|
+
{
|
|
640
|
+
f << "Loc:" << loc << " OUT:{";
|
|
641
|
+
this->dumpPts(this->getDFOutPtsMap(loc), f);
|
|
642
|
+
f << "}\n";
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
f.close();
|
|
646
|
+
if (f.good())
|
|
647
|
+
{
|
|
648
|
+
SVFUtil::outs() << "\n";
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
SVFUtil::outs() << " error opening file for writing!\n";
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
virtual inline void dumpPts(const PtsMap & ptsSet,OutStream & O = SVFUtil::outs()) const
|
|
656
|
+
{
|
|
657
|
+
for (PtsMapConstIter nodeIt = ptsSet.begin(); nodeIt != ptsSet.end(); nodeIt++)
|
|
658
|
+
{
|
|
659
|
+
const Key& var = nodeIt->first;
|
|
660
|
+
const DataSet & pts = nodeIt->second;
|
|
661
|
+
if (pts.empty())
|
|
662
|
+
continue;
|
|
663
|
+
O << "<" << var << ",{";
|
|
664
|
+
SVFUtil::dumpSet(pts,O);
|
|
665
|
+
O << "}> ";
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
///@}
|
|
669
|
+
|
|
670
|
+
protected:
|
|
671
|
+
/// Data-flow IN set.
|
|
672
|
+
DFPtsMap dfInPtsMap;
|
|
673
|
+
/// Data-flow OUT set.
|
|
674
|
+
DFPtsMap dfOutPtsMap;
|
|
675
|
+
/// Backing to implement the basic PTData methods which are not overridden.
|
|
676
|
+
/// This allows us to avoid multiple-inheritance.
|
|
677
|
+
MutablePTData<Key, KeySet, Data, DataSet> mutPTData;
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
/// Incremental version of the mutable data-flow points-to data structure.
|
|
681
|
+
template <typename Key, typename KeySet, typename Data, typename DataSet>
|
|
682
|
+
class MutableIncDFPTData : public MutableDFPTData<Key, KeySet, Data, DataSet>
|
|
683
|
+
{
|
|
684
|
+
public:
|
|
685
|
+
typedef PTData<Key, KeySet, Data, DataSet> BasePTData;
|
|
686
|
+
typedef MutablePTData<Key, KeySet, Data, DataSet> BaseMutPTData;
|
|
687
|
+
typedef DFPTData<Key, KeySet, Data, DataSet> BaseDFPTData;
|
|
688
|
+
typedef MutableDFPTData<Key, KeySet, Data, DataSet> BaseMutDFPTData;
|
|
689
|
+
typedef typename BasePTData::PTDataTy PTDataTy;
|
|
690
|
+
|
|
691
|
+
typedef typename BaseDFPTData::LocID LocID;
|
|
692
|
+
typedef Map<LocID, DataSet> UpdatedVarMap; ///< for propagating only newly added variable in IN/OUT set
|
|
693
|
+
typedef typename UpdatedVarMap::iterator UpdatedVarMapIter;
|
|
694
|
+
typedef typename UpdatedVarMap::const_iterator UpdatedVarconstIter;
|
|
695
|
+
typedef typename DataSet::iterator DataIter;
|
|
696
|
+
|
|
697
|
+
private:
|
|
698
|
+
UpdatedVarMap outUpdatedVarMap;
|
|
699
|
+
UpdatedVarMap inUpdatedVarMap;
|
|
700
|
+
|
|
701
|
+
public:
|
|
702
|
+
/// Constructor
|
|
703
|
+
MutableIncDFPTData(bool reversePT = true, PTDataTy ty = BasePTData::MutIncDataFlow) : BaseMutDFPTData(reversePT, ty) { }
|
|
704
|
+
|
|
705
|
+
virtual ~MutableIncDFPTData() { }
|
|
706
|
+
|
|
707
|
+
virtual inline bool updateDFInFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
708
|
+
{
|
|
709
|
+
if(varHasNewDFInPts(srcLoc, srcVar) &&
|
|
710
|
+
this->unionPts(this->getDFInPtsSet(dstLoc,dstVar), this->getDFInPtsSet(srcLoc,srcVar)))
|
|
711
|
+
{
|
|
712
|
+
setVarDFInSetUpdated(dstLoc,dstVar);
|
|
713
|
+
return true;
|
|
714
|
+
}
|
|
715
|
+
return false;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
virtual inline bool updateDFInFromOut(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
719
|
+
{
|
|
720
|
+
if(varHasNewDFOutPts(srcLoc, srcVar) &&
|
|
721
|
+
this->unionPts(this->getDFInPtsSet(dstLoc,dstVar), this->getDFOutPtsSet(srcLoc,srcVar)))
|
|
722
|
+
{
|
|
723
|
+
setVarDFInSetUpdated(dstLoc,dstVar);
|
|
724
|
+
return true;
|
|
725
|
+
}
|
|
726
|
+
return false;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
virtual inline bool updateDFOutFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
730
|
+
{
|
|
731
|
+
if(varHasNewDFInPts(srcLoc,srcVar))
|
|
732
|
+
{
|
|
733
|
+
removeVarFromDFInUpdatedSet(srcLoc,srcVar);
|
|
734
|
+
if (this->unionPts(this->getDFOutPtsSet(dstLoc,dstVar), this->getDFInPtsSet(srcLoc,srcVar)))
|
|
735
|
+
{
|
|
736
|
+
setVarDFOutSetUpdated(dstLoc,dstVar);
|
|
737
|
+
return true;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
return false;
|
|
741
|
+
}
|
|
742
|
+
|
|
743
|
+
virtual inline bool updateAllDFInFromOut(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
744
|
+
{
|
|
745
|
+
if(this->unionPts(this->getDFInPtsSet(dstLoc,dstVar), this->getDFOutPtsSet(srcLoc,srcVar)))
|
|
746
|
+
{
|
|
747
|
+
setVarDFInSetUpdated(dstLoc,dstVar);
|
|
748
|
+
return true;
|
|
749
|
+
}
|
|
750
|
+
return false;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
virtual inline bool updateAllDFInFromIn(LocID srcLoc, const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
754
|
+
{
|
|
755
|
+
if(this->unionPts(this->getDFInPtsSet(dstLoc,dstVar), this->getDFInPtsSet(srcLoc,srcVar)))
|
|
756
|
+
{
|
|
757
|
+
setVarDFInSetUpdated(dstLoc,dstVar);
|
|
758
|
+
return true;
|
|
759
|
+
}
|
|
760
|
+
return false;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
virtual inline bool updateAllDFOutFromIn(LocID loc, const Key& singleton, bool strongUpdates) override
|
|
764
|
+
{
|
|
765
|
+
bool changed = false;
|
|
766
|
+
if (this->hasDFInSet(loc))
|
|
767
|
+
{
|
|
768
|
+
/// Only variables has new pts from IN set need to be updated.
|
|
769
|
+
DataSet pts = getDFInUpdatedVar(loc);
|
|
770
|
+
for (DataIter ptsIt = pts.begin(), ptsEit = pts.end(); ptsIt != ptsEit; ++ptsIt)
|
|
771
|
+
{
|
|
772
|
+
const Key var = *ptsIt;
|
|
773
|
+
/// Enable strong updates if it is required to do so
|
|
774
|
+
if (strongUpdates && var == singleton)
|
|
775
|
+
continue;
|
|
776
|
+
if (updateDFOutFromIn(loc, var, loc, var))
|
|
777
|
+
changed = true;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
return changed;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
virtual inline bool updateTLVPts(LocID srcLoc, const Key& srcVar, const Key& dstVar) override
|
|
784
|
+
{
|
|
785
|
+
if(varHasNewDFInPts(srcLoc,srcVar))
|
|
786
|
+
{
|
|
787
|
+
removeVarFromDFInUpdatedSet(srcLoc,srcVar);
|
|
788
|
+
return this->mutPTData.unionPts(dstVar, this->getDFInPtsSet(srcLoc,srcVar));
|
|
789
|
+
}
|
|
790
|
+
return false;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
virtual inline bool updateATVPts(const Key& srcVar, LocID dstLoc, const Key& dstVar) override
|
|
794
|
+
{
|
|
795
|
+
if (this->unionPts(this->getDFOutPtsSet(dstLoc, dstVar), this->mutPTData.getPts(srcVar)))
|
|
796
|
+
{
|
|
797
|
+
setVarDFOutSetUpdated(dstLoc, dstVar);
|
|
798
|
+
return true;
|
|
799
|
+
}
|
|
800
|
+
return false;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
virtual inline void clearAllDFOutUpdatedVar(LocID loc) override
|
|
804
|
+
{
|
|
805
|
+
if (this->hasDFOutSet(loc))
|
|
806
|
+
{
|
|
807
|
+
DataSet pts = getDFOutUpdatedVar(loc);
|
|
808
|
+
for (DataIter ptsIt = pts.begin(), ptsEit = pts.end(); ptsIt != ptsEit; ++ptsIt)
|
|
809
|
+
{
|
|
810
|
+
const Key var = *ptsIt;
|
|
811
|
+
removeVarFromDFOutUpdatedSet(loc, var);
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/// Methods to support type inquiry through isa, cast, and dyn_cast:
|
|
817
|
+
///@{
|
|
818
|
+
static inline bool classof(const MutableIncDFPTData<Key, KeySet, Data, DataSet> *)
|
|
819
|
+
{
|
|
820
|
+
return true;
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
static inline bool classof(const PTData<Key, KeySet, Data, DataSet>* ptd)
|
|
824
|
+
{
|
|
825
|
+
return ptd->getPTDTY() == BasePTData::MutIncDataFlow;
|
|
826
|
+
}
|
|
827
|
+
///@}
|
|
828
|
+
private:
|
|
829
|
+
/// Handle address-taken variables whose IN pts changed
|
|
830
|
+
//@{
|
|
831
|
+
/// Add var into loc's IN updated set. Called when var's pts in loc's IN set changed
|
|
832
|
+
inline void setVarDFInSetUpdated(LocID loc,const Key& var)
|
|
833
|
+
{
|
|
834
|
+
inUpdatedVarMap[loc].set(var);
|
|
835
|
+
}
|
|
836
|
+
/// Remove var from loc's IN updated set
|
|
837
|
+
inline void removeVarFromDFInUpdatedSet(LocID loc,const Key& var)
|
|
838
|
+
{
|
|
839
|
+
UpdatedVarMapIter it = inUpdatedVarMap.find(loc);
|
|
840
|
+
if (it != inUpdatedVarMap.end())
|
|
841
|
+
it->second.reset(var);
|
|
842
|
+
}
|
|
843
|
+
/// Return TRUE if var has new pts in loc's IN set
|
|
844
|
+
inline bool varHasNewDFInPts(LocID loc,const Key& var)
|
|
845
|
+
{
|
|
846
|
+
UpdatedVarMapIter it = inUpdatedVarMap.find(loc);
|
|
847
|
+
if (it != inUpdatedVarMap.end())
|
|
848
|
+
return it->second.test(var);
|
|
849
|
+
return false;
|
|
850
|
+
}
|
|
851
|
+
/// Get all var which have new pts information in loc's IN set
|
|
852
|
+
inline const DataSet& getDFInUpdatedVar(LocID loc)
|
|
853
|
+
{
|
|
854
|
+
return inUpdatedVarMap[loc];
|
|
855
|
+
}
|
|
856
|
+
//@}
|
|
857
|
+
|
|
858
|
+
/// Handle address-taken variables whose OUT pts changed
|
|
859
|
+
//@{
|
|
860
|
+
/// Add var into loc's OUT updated set. Called when var's pts in loc's OUT set changed
|
|
861
|
+
inline void setVarDFOutSetUpdated(LocID loc,const Key& var)
|
|
862
|
+
{
|
|
863
|
+
outUpdatedVarMap[loc].set(var);
|
|
864
|
+
}
|
|
865
|
+
/// Remove var from loc's OUT updated set
|
|
866
|
+
inline void removeVarFromDFOutUpdatedSet(LocID loc,const Key& var)
|
|
867
|
+
{
|
|
868
|
+
UpdatedVarMapIter it = outUpdatedVarMap.find(loc);
|
|
869
|
+
if (it != outUpdatedVarMap.end())
|
|
870
|
+
it->second.reset(var);
|
|
871
|
+
}
|
|
872
|
+
/// Return TRUE if var has new pts in loc's OUT set
|
|
873
|
+
inline bool varHasNewDFOutPts(LocID loc,const Key& var)
|
|
874
|
+
{
|
|
875
|
+
UpdatedVarMapIter it = outUpdatedVarMap.find(loc);
|
|
876
|
+
if (it != outUpdatedVarMap.end())
|
|
877
|
+
return it->second.test(var);
|
|
878
|
+
return false;
|
|
879
|
+
}
|
|
880
|
+
/// Get all var which have new pts information in loc's OUT set
|
|
881
|
+
inline const DataSet& getDFOutUpdatedVar(LocID loc)
|
|
882
|
+
{
|
|
883
|
+
return outUpdatedVarMap[loc];
|
|
884
|
+
}
|
|
885
|
+
//@}
|
|
886
|
+
};
|
|
887
|
+
|
|
888
|
+
/// VersionedPTData implemented with mutable points-to set (DataSet).
|
|
889
|
+
/// Implemented as a wrapper around two MutablePTDatas: one for Keys, one
|
|
890
|
+
/// for VersionedKeys.
|
|
891
|
+
template <typename Key, typename KeySet, typename Data, typename DataSet, typename VersionedKey, typename VersionedKeySet>
|
|
892
|
+
class MutableVersionedPTData : public VersionedPTData<Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet>
|
|
893
|
+
{
|
|
894
|
+
public:
|
|
895
|
+
typedef PTData<Key, KeySet, Data, DataSet> BasePTData;
|
|
896
|
+
typedef VersionedPTData<Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet> BaseVersionedPTData;
|
|
897
|
+
typedef typename BasePTData::PTDataTy PTDataTy;
|
|
898
|
+
|
|
899
|
+
MutableVersionedPTData(bool reversePT = true, PTDataTy ty = PTDataTy::MutVersioned)
|
|
900
|
+
: BaseVersionedPTData(reversePT, ty), tlPTData(reversePT), atPTData(reversePT) { }
|
|
901
|
+
|
|
902
|
+
virtual ~MutableVersionedPTData() { }
|
|
903
|
+
|
|
904
|
+
virtual inline void clear() override
|
|
905
|
+
{
|
|
906
|
+
tlPTData.clear();
|
|
907
|
+
atPTData.clear();
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
virtual const DataSet& getPts(const Key& vk) override
|
|
911
|
+
{
|
|
912
|
+
return tlPTData.getPts(vk);
|
|
913
|
+
}
|
|
914
|
+
virtual const DataSet& getPts(const VersionedKey& vk) override
|
|
915
|
+
{
|
|
916
|
+
return atPTData.getPts(vk);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
virtual const KeySet& getRevPts(const Data& datum) override
|
|
920
|
+
{
|
|
921
|
+
assert(this->rev && "MutableVersionedPTData::getRevPts: constructed without reverse PT support!");
|
|
922
|
+
return tlPTData.getRevPts(datum);
|
|
923
|
+
}
|
|
924
|
+
virtual const VersionedKeySet& getVersionedKeyRevPts(const Data& datum) override
|
|
925
|
+
{
|
|
926
|
+
assert(this->rev && "MutableVersionedPTData::getVersionedKeyRevPts: constructed without reverse PT support!");
|
|
927
|
+
return atPTData.getRevPts(datum);
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
virtual bool addPts(const Key& k, const Data& element) override
|
|
931
|
+
{
|
|
932
|
+
return tlPTData.addPts(k, element);
|
|
933
|
+
}
|
|
934
|
+
virtual bool addPts(const VersionedKey& vk, const Data& element) override
|
|
935
|
+
{
|
|
936
|
+
return atPTData.addPts(vk, element);
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
virtual bool unionPts(const Key& dstVar, const Key& srcVar) override
|
|
940
|
+
{
|
|
941
|
+
return tlPTData.unionPts(dstVar, srcVar);
|
|
942
|
+
}
|
|
943
|
+
virtual bool unionPts(const VersionedKey& dstVar, const VersionedKey& srcVar) override
|
|
944
|
+
{
|
|
945
|
+
return atPTData.unionPts(dstVar, srcVar);
|
|
946
|
+
}
|
|
947
|
+
virtual bool unionPts(const VersionedKey& dstVar, const Key& srcVar) override
|
|
948
|
+
{
|
|
949
|
+
return atPTData.unionPts(dstVar, tlPTData.getPts(srcVar));
|
|
950
|
+
}
|
|
951
|
+
virtual bool unionPts(const Key& dstVar, const VersionedKey& srcVar) override
|
|
952
|
+
{
|
|
953
|
+
return tlPTData.unionPts(dstVar, atPTData.getPts(srcVar));
|
|
954
|
+
}
|
|
955
|
+
virtual bool unionPts(const Key& dstVar, const DataSet& srcDataSet) override
|
|
956
|
+
{
|
|
957
|
+
return tlPTData.unionPts(dstVar, srcDataSet);
|
|
958
|
+
}
|
|
959
|
+
virtual bool unionPts(const VersionedKey& dstVar, const DataSet& srcDataSet) override
|
|
960
|
+
{
|
|
961
|
+
return atPTData.unionPts(dstVar, srcDataSet);
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
virtual void clearPts(const Key& k, const Data& element) override
|
|
965
|
+
{
|
|
966
|
+
tlPTData.clearPts(k, element);
|
|
967
|
+
}
|
|
968
|
+
virtual void clearPts(const VersionedKey& vk, const Data& element) override
|
|
969
|
+
{
|
|
970
|
+
atPTData.clearPts(vk, element);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
virtual void clearFullPts(const Key& k) override
|
|
974
|
+
{
|
|
975
|
+
tlPTData.clearFullPts(k);
|
|
976
|
+
}
|
|
977
|
+
virtual void clearFullPts(const VersionedKey& vk) override
|
|
978
|
+
{
|
|
979
|
+
atPTData.clearFullPts(vk);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
virtual void remapAllPts(void) override
|
|
983
|
+
{
|
|
984
|
+
tlPTData.remapAllPts();
|
|
985
|
+
atPTData.remapAllPts();
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
virtual inline Map<DataSet, unsigned> getAllPts(bool liveOnly) const override
|
|
989
|
+
{
|
|
990
|
+
Map<DataSet, unsigned> allPts = tlPTData.getAllPts(liveOnly);
|
|
991
|
+
SVFUtil::mergePtsOccMaps<DataSet>(allPts, atPTData.getAllPts(liveOnly));
|
|
992
|
+
return allPts;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
virtual inline void dumpPTData() override
|
|
996
|
+
{
|
|
997
|
+
SVFUtil::outs() << "== Top-level points-to information\n";
|
|
998
|
+
tlPTData.dumpPTData();
|
|
999
|
+
SVFUtil::outs() << "== Address-taken points-to information\n";
|
|
1000
|
+
atPTData.dumpPTData();
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/// Methods to support type inquiry through isa, cast, and dyn_cast:
|
|
1004
|
+
///@{
|
|
1005
|
+
static inline bool classof(const MutableVersionedPTData<Key, KeySet, Data, DataSet, VersionedKey, VersionedKeySet> *)
|
|
1006
|
+
{
|
|
1007
|
+
return true;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
static inline bool classof(const PTData<Key, KeySet, Data, DataSet>* ptd)
|
|
1011
|
+
{
|
|
1012
|
+
return ptd->getPTDTY() == PTDataTy::MutVersioned;
|
|
1013
|
+
}
|
|
1014
|
+
///@}
|
|
1015
|
+
|
|
1016
|
+
private:
|
|
1017
|
+
/// PTData for Keys (top-level pointers, generally).
|
|
1018
|
+
MutablePTData<Key, KeySet, Data, DataSet> tlPTData;
|
|
1019
|
+
/// PTData for VersionedKeys (address-taken objects, generally).
|
|
1020
|
+
MutablePTData<VersionedKey, VersionedKeySet, Data, DataSet> atPTData;
|
|
1021
|
+
};
|
|
1022
|
+
|
|
1023
|
+
} // End namespace SVF
|
|
1024
|
+
|
|
1025
|
+
#endif // MUTABLE_POINTSTO_H_
|