svf-lib 1.0.1376 → 1.0.1377

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