svf-tools 1.0.855 → 1.0.857

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 (502) hide show
  1. package/SVF-doxygen/html/AndersenPWC_8h_source.html +4 -4
  2. package/SVF-doxygen/html/AndersenSCD_8cpp_source.html +2 -2
  3. package/SVF-doxygen/html/AndersenStat_8cpp_source.html +154 -163
  4. package/SVF-doxygen/html/Andersen_8cpp_source.html +2 -2
  5. package/SVF-doxygen/html/Andersen_8h_source.html +13 -13
  6. package/SVF-doxygen/html/CFBasicBlockGWTO_8h.html +109 -0
  7. package/SVF-doxygen/html/CFBasicBlockGWTO_8h_source.html +185 -0
  8. package/SVF-doxygen/html/CFLAlias_8cpp_source.html +2 -2
  9. package/SVF-doxygen/html/CFLAlias_8h_source.html +4 -4
  10. package/SVF-doxygen/html/CFLBase_8cpp_source.html +1 -1
  11. package/SVF-doxygen/html/CFLBase_8h_source.html +1 -1
  12. package/SVF-doxygen/html/CFLSVFGBuilder_8cpp_source.html +2 -2
  13. package/SVF-doxygen/html/CFLStat_8cpp_source.html +2 -2
  14. package/SVF-doxygen/html/CFLVF_8h_source.html +2 -2
  15. package/SVF-doxygen/html/CSC_8h.html +3 -3
  16. package/SVF-doxygen/html/CSC_8h_source.html +5 -5
  17. package/SVF-doxygen/html/ConsGNode_8h_source.html +4 -4
  18. package/SVF-doxygen/html/ContextDDA_8cpp_source.html +14 -14
  19. package/SVF-doxygen/html/ContextDDA_8h_source.html +6 -6
  20. package/SVF-doxygen/html/DDAClient_8cpp_source.html +5 -5
  21. package/SVF-doxygen/html/DDAClient_8h_source.html +1 -1
  22. package/SVF-doxygen/html/DDAPass_8cpp_source.html +7 -7
  23. package/SVF-doxygen/html/DDAPass_8h.html +3 -3
  24. package/SVF-doxygen/html/DDAPass_8h_source.html +4 -4
  25. package/SVF-doxygen/html/DDAStat_8cpp_source.html +10 -10
  26. package/SVF-doxygen/html/DDAStat_8h_source.html +1 -1
  27. package/SVF-doxygen/html/DDAVFSolver_8h.html +2 -2
  28. package/SVF-doxygen/html/DDAVFSolver_8h_source.html +5 -5
  29. package/SVF-doxygen/html/FSMPTA_8cpp_source.html +2 -2
  30. package/SVF-doxygen/html/FSMPTA_8h_source.html +5 -5
  31. package/SVF-doxygen/html/FlowDDA_8h_source.html +11 -11
  32. package/SVF-doxygen/html/FlowSensitiveStat_8cpp_source.html +236 -238
  33. package/SVF-doxygen/html/FlowSensitive_8cpp_source.html +3 -3
  34. package/SVF-doxygen/html/FlowSensitive_8h_source.html +7 -7
  35. package/SVF-doxygen/html/ICFGStat_8h_source.html +1 -1
  36. package/SVF-doxygen/html/ICFGWTO_8h.html +109 -0
  37. package/SVF-doxygen/html/ICFGWTO_8h_source.html +177 -0
  38. package/SVF-doxygen/html/LLVMModule_8cpp_source.html +2 -2
  39. package/SVF-doxygen/html/MTAAnnotator_8cpp_source.html +2 -2
  40. package/SVF-doxygen/html/MTAAnnotator_8h_source.html +1 -1
  41. package/SVF-doxygen/html/MTAStat_8cpp_source.html +3 -3
  42. package/SVF-doxygen/html/MTA_8cpp_source.html +3 -3
  43. package/SVF-doxygen/html/MemRegion_8cpp_source.html +3 -3
  44. package/SVF-doxygen/html/MemRegion_8h.html +3 -3
  45. package/SVF-doxygen/html/MemRegion_8h_source.html +4 -4
  46. package/SVF-doxygen/html/MemSSA_8cpp_source.html +1 -1
  47. package/SVF-doxygen/html/Options_8cpp_source.html +10 -10
  48. package/SVF-doxygen/html/PCG_8h_source.html +4 -4
  49. package/SVF-doxygen/html/PTAStat_8cpp_source.html +99 -87
  50. package/SVF-doxygen/html/PTAStat_8h_source.html +2 -2
  51. package/SVF-doxygen/html/PointerAnalysisImpl_8cpp_source.html +30 -30
  52. package/SVF-doxygen/html/PointerAnalysisImpl_8h_source.html +15 -15
  53. package/SVF-doxygen/html/PointerAnalysis_8cpp_source.html +42 -42
  54. package/SVF-doxygen/html/PointerAnalysis_8h.html +5 -5
  55. package/SVF-doxygen/html/PointerAnalysis_8h_source.html +409 -418
  56. package/SVF-doxygen/html/SCC_8h.html +2 -2
  57. package/SVF-doxygen/html/SCC_8h_source.html +2 -2
  58. package/SVF-doxygen/html/SVFGBuilder_8h_source.html +3 -3
  59. package/SVF-doxygen/html/SVFGStat_8cpp_source.html +16 -19
  60. package/SVF-doxygen/html/SVFGStat_8h.html +1 -1
  61. package/SVF-doxygen/html/SVFGStat_8h_source.html +3 -3
  62. package/SVF-doxygen/html/SVFG_8h_source.html +1 -1
  63. package/SVF-doxygen/html/SVFStat_8cpp_source.html +196 -186
  64. package/SVF-doxygen/html/SVFStat_8h_source.html +44 -41
  65. package/SVF-doxygen/html/SaberSVFGBuilder_8cpp_source.html +5 -5
  66. package/SVF-doxygen/html/SrcSnkDDA_8cpp_source.html +1 -1
  67. package/SVF-doxygen/html/Steensgaard_8cpp_source.html +2 -2
  68. package/SVF-doxygen/html/Steensgaard_8h_source.html +4 -4
  69. package/SVF-doxygen/html/TCT_8h.html +2 -2
  70. package/SVF-doxygen/html/TCT_8h_source.html +9 -9
  71. package/SVF-doxygen/html/ThreadCallGraph_8cpp_source.html +3 -3
  72. package/SVF-doxygen/html/ThreadCallGraph_8h_source.html +1 -1
  73. package/SVF-doxygen/html/TypeAnalysis_8cpp_source.html +3 -3
  74. package/SVF-doxygen/html/TypeAnalysis_8h_source.html +6 -6
  75. package/SVF-doxygen/html/VFG_8cpp_source.html +3 -3
  76. package/SVF-doxygen/html/VFG_8h_source.html +1 -1
  77. package/SVF-doxygen/html/VersionedFlowSensitiveStat_8cpp_source.html +77 -79
  78. package/SVF-doxygen/html/VersionedFlowSensitive_8cpp_source.html +6 -6
  79. package/SVF-doxygen/html/VersionedFlowSensitive_8h_source.html +4 -4
  80. package/SVF-doxygen/html/WPAPass_8cpp_source.html +12 -12
  81. package/SVF-doxygen/html/WPAPass_8h_source.html +1 -1
  82. package/SVF-doxygen/html/WPAStat_8h_source.html +9 -9
  83. package/SVF-doxygen/html/WTO_8h.html +25 -13
  84. package/SVF-doxygen/html/WTO_8h_source.html +794 -853
  85. package/SVF-doxygen/html/annotated.html +402 -397
  86. package/SVF-doxygen/html/classSVF_1_1Andersen-members.html +121 -123
  87. package/SVF-doxygen/html/classSVF_1_1Andersen.html +11 -17
  88. package/SVF-doxygen/html/classSVF_1_1AndersenBase-members.html +100 -102
  89. package/SVF-doxygen/html/classSVF_1_1AndersenBase.html +11 -17
  90. package/SVF-doxygen/html/classSVF_1_1AndersenSCD-members.html +124 -126
  91. package/SVF-doxygen/html/classSVF_1_1AndersenSCD.html +2 -8
  92. package/SVF-doxygen/html/classSVF_1_1AndersenSFR-members.html +129 -131
  93. package/SVF-doxygen/html/classSVF_1_1AndersenSFR.html +1 -7
  94. package/SVF-doxygen/html/classSVF_1_1AndersenStat-members.html +21 -20
  95. package/SVF-doxygen/html/classSVF_1_1AndersenStat.html +155 -161
  96. package/SVF-doxygen/html/classSVF_1_1AndersenWaveDiff-members.html +122 -124
  97. package/SVF-doxygen/html/classSVF_1_1AndersenWaveDiff.html +2 -8
  98. package/SVF-doxygen/html/classSVF_1_1BVDataPTAImpl-members.html +58 -60
  99. package/SVF-doxygen/html/classSVF_1_1BVDataPTAImpl.html +26 -32
  100. package/SVF-doxygen/html/classSVF_1_1CFBasicBlockGWTO-members.html +57 -50
  101. package/SVF-doxygen/html/classSVF_1_1CFBasicBlockGWTO.html +203 -1663
  102. package/SVF-doxygen/html/classSVF_1_1CFBasicBlockGWTO.png +0 -0
  103. package/SVF-doxygen/html/classSVF_1_1CFLAlias-members.html +78 -80
  104. package/SVF-doxygen/html/classSVF_1_1CFLAlias.html +4 -10
  105. package/SVF-doxygen/html/classSVF_1_1CFLBase-members.html +75 -77
  106. package/SVF-doxygen/html/classSVF_1_1CFLBase.html +1 -7
  107. package/SVF-doxygen/html/classSVF_1_1CFLSVFGBuilder.html +2 -2
  108. package/SVF-doxygen/html/classSVF_1_1CFLStat-members.html +19 -18
  109. package/SVF-doxygen/html/classSVF_1_1CFLStat.html +5 -2
  110. package/SVF-doxygen/html/classSVF_1_1CFLVF-members.html +77 -79
  111. package/SVF-doxygen/html/classSVF_1_1CFLVF.html +2 -8
  112. package/SVF-doxygen/html/classSVF_1_1CondPTAImpl-members.html +50 -52
  113. package/SVF-doxygen/html/classSVF_1_1CondPTAImpl.html +9 -15
  114. package/SVF-doxygen/html/classSVF_1_1ConstraintNode-members.html +34 -34
  115. package/SVF-doxygen/html/classSVF_1_1ConstraintNode.html +25 -65
  116. package/SVF-doxygen/html/classSVF_1_1ContextDDA-members.html +97 -99
  117. package/SVF-doxygen/html/classSVF_1_1ContextDDA.html +18 -24
  118. package/SVF-doxygen/html/classSVF_1_1DDAClient.html +3 -3
  119. package/SVF-doxygen/html/classSVF_1_1DDAPass.html +6 -6
  120. package/SVF-doxygen/html/classSVF_1_1DDAStat-members.html +18 -17
  121. package/SVF-doxygen/html/classSVF_1_1DDAStat.html +12 -9
  122. package/SVF-doxygen/html/classSVF_1_1DDAVFSolver.html +1 -1
  123. package/SVF-doxygen/html/classSVF_1_1FSMPTA-members.html +140 -142
  124. package/SVF-doxygen/html/classSVF_1_1FSMPTA.html +2 -8
  125. package/SVF-doxygen/html/classSVF_1_1FlowDDA-members.html +102 -104
  126. package/SVF-doxygen/html/classSVF_1_1FlowDDA.html +15 -21
  127. package/SVF-doxygen/html/classSVF_1_1FlowSensitive-members.html +133 -135
  128. package/SVF-doxygen/html/classSVF_1_1FlowSensitive.html +18 -24
  129. package/SVF-doxygen/html/classSVF_1_1FlowSensitiveStat-members.html +24 -23
  130. package/SVF-doxygen/html/classSVF_1_1FlowSensitiveStat.html +241 -240
  131. package/SVF-doxygen/html/classSVF_1_1FunptrDDAClient.html +2 -2
  132. package/SVF-doxygen/html/classSVF_1_1GenericNode.html +9 -10
  133. package/SVF-doxygen/html/classSVF_1_1GenericNode.png +0 -0
  134. package/SVF-doxygen/html/classSVF_1_1ICFGStat-members.html +19 -18
  135. package/SVF-doxygen/html/classSVF_1_1ICFGStat.html +4 -1
  136. package/SVF-doxygen/html/classSVF_1_1ICFGWTO-members.html +140 -0
  137. package/SVF-doxygen/html/classSVF_1_1ICFGWTO.html +379 -0
  138. package/SVF-doxygen/html/classSVF_1_1ICFGWTO.png +0 -0
  139. package/SVF-doxygen/html/classSVF_1_1LLVMModuleSet.html +2 -2
  140. package/SVF-doxygen/html/classSVF_1_1MRGenerator.html +3 -3
  141. package/SVF-doxygen/html/classSVF_1_1MTA.html +3 -3
  142. package/SVF-doxygen/html/classSVF_1_1MTAAnnotator.html +2 -2
  143. package/SVF-doxygen/html/classSVF_1_1MTASVFGBuilder.html +1 -1
  144. package/SVF-doxygen/html/classSVF_1_1MTAStat-members.html +20 -19
  145. package/SVF-doxygen/html/classSVF_1_1MTAStat.html +6 -3
  146. package/SVF-doxygen/html/classSVF_1_1MemSSA.html +5 -5
  147. package/SVF-doxygen/html/classSVF_1_1MemSSAStat-members.html +24 -23
  148. package/SVF-doxygen/html/classSVF_1_1MemSSAStat.html +7 -4
  149. package/SVF-doxygen/html/classSVF_1_1PCG.html +3 -3
  150. package/SVF-doxygen/html/classSVF_1_1POCRAlias-members.html +78 -80
  151. package/SVF-doxygen/html/classSVF_1_1POCRAlias.html +0 -6
  152. package/SVF-doxygen/html/classSVF_1_1POCRHybrid-members.html +78 -80
  153. package/SVF-doxygen/html/classSVF_1_1POCRHybrid.html +0 -6
  154. package/SVF-doxygen/html/classSVF_1_1PTAStat-members.html +19 -18
  155. package/SVF-doxygen/html/classSVF_1_1PTAStat.html +100 -85
  156. package/SVF-doxygen/html/classSVF_1_1PointerAnalysis-members.html +34 -36
  157. package/SVF-doxygen/html/classSVF_1_1PointerAnalysis.html +291 -356
  158. package/SVF-doxygen/html/classSVF_1_1SCCDetection.html +1 -1
  159. package/SVF-doxygen/html/classSVF_1_1SCCDetection_1_1GNodeSCCInfo.html +1 -1
  160. package/SVF-doxygen/html/classSVF_1_1SVFGStat-members.html +41 -40
  161. package/SVF-doxygen/html/classSVF_1_1SVFGStat.html +18 -18
  162. package/SVF-doxygen/html/classSVF_1_1SVFIRBuilder.html +1 -1
  163. package/SVF-doxygen/html/classSVF_1_1SVFStat-members.html +13 -12
  164. package/SVF-doxygen/html/classSVF_1_1SVFStat.html +208 -168
  165. package/SVF-doxygen/html/classSVF_1_1SaberSVFGBuilder.html +5 -5
  166. package/SVF-doxygen/html/classSVF_1_1SrcSnkDDA.html +1 -1
  167. package/SVF-doxygen/html/classSVF_1_1Steensgaard-members.html +109 -111
  168. package/SVF-doxygen/html/classSVF_1_1Steensgaard.html +4 -10
  169. package/SVF-doxygen/html/classSVF_1_1TCT.html +4 -4
  170. package/SVF-doxygen/html/classSVF_1_1ThreadCallGraph.html +2 -2
  171. package/SVF-doxygen/html/classSVF_1_1TypeAnalysis-members.html +103 -105
  172. package/SVF-doxygen/html/classSVF_1_1TypeAnalysis.html +9 -15
  173. package/SVF-doxygen/html/classSVF_1_1VFG.html +2 -2
  174. package/SVF-doxygen/html/classSVF_1_1VersionedFlowSensitive-members.html +158 -160
  175. package/SVF-doxygen/html/classSVF_1_1VersionedFlowSensitive.html +6 -12
  176. package/SVF-doxygen/html/classSVF_1_1VersionedFlowSensitiveStat-members.html +24 -23
  177. package/SVF-doxygen/html/classSVF_1_1VersionedFlowSensitiveStat.html +84 -83
  178. package/SVF-doxygen/html/classSVF_1_1WPAPass.html +12 -12
  179. package/SVF-doxygen/html/classSVF_1_1WTO-members.html +137 -0
  180. package/SVF-doxygen/html/classSVF_1_1WTO.html +1998 -0
  181. package/SVF-doxygen/html/classSVF_1_1WTOComponent-members.html +97 -0
  182. package/SVF-doxygen/html/classSVF_1_1WTOComponent.html +515 -0
  183. package/SVF-doxygen/html/classSVF_1_1WTOComponentVisitor-members.html +93 -0
  184. package/SVF-doxygen/html/classSVF_1_1WTOComponentVisitor.html +421 -0
  185. package/SVF-doxygen/html/classSVF_1_1WTOComponentVisitor.png +0 -0
  186. package/SVF-doxygen/html/classSVF_1_1WTOCycle-members.html +98 -0
  187. package/SVF-doxygen/html/classSVF_1_1WTOCycle.html +630 -0
  188. package/SVF-doxygen/html/classSVF_1_1WTOCycleDepth-members.html +24 -23
  189. package/SVF-doxygen/html/classSVF_1_1WTOCycleDepth.html +338 -317
  190. package/SVF-doxygen/html/classSVF_1_1WTONode-members.html +91 -0
  191. package/SVF-doxygen/html/classSVF_1_1WTONode.html +390 -0
  192. package/SVF-doxygen/html/classSVF_1_1WTO_1_1WTOCycleDepthBuilder-members.html +96 -0
  193. package/SVF-doxygen/html/classSVF_1_1WTO_1_1WTOCycleDepthBuilder.html +332 -0
  194. package/SVF-doxygen/html/classSVF_1_1WTO_1_1WTOCycleDepthBuilder.png +0 -0
  195. package/SVF-doxygen/html/classes.html +383 -377
  196. package/SVF-doxygen/html/dir_445b24f35a8ddd2effd3d23ee1278e0a.html +0 -2
  197. package/SVF-doxygen/html/dir_f63327fc9cf9e35b7653a5e341daceab.html +4 -2
  198. package/SVF-doxygen/html/dir_fc0329f850c815763e0c5b05933e8d55.html +4 -0
  199. package/SVF-doxygen/html/files.html +31 -29
  200. package/SVF-doxygen/html/functions.html +18 -30
  201. package/SVF-doxygen/html/functions_a.html +17 -14
  202. package/SVF-doxygen/html/functions_b.html +25 -25
  203. package/SVF-doxygen/html/functions_c.html +37 -51
  204. package/SVF-doxygen/html/functions_e.html +7 -4
  205. package/SVF-doxygen/html/functions_enum.html +2 -2
  206. package/SVF-doxygen/html/functions_eval_c.html +1 -1
  207. package/SVF-doxygen/html/functions_eval_n.html +1 -1
  208. package/SVF-doxygen/html/functions_f.html +26 -21
  209. package/SVF-doxygen/html/functions_func.html +14 -11
  210. package/SVF-doxygen/html/functions_func_b.html +6 -10
  211. package/SVF-doxygen/html/functions_func_c.html +30 -36
  212. package/SVF-doxygen/html/functions_func_e.html +5 -5
  213. package/SVF-doxygen/html/functions_func_f.html +8 -3
  214. package/SVF-doxygen/html/functions_func_g.html +15 -25
  215. package/SVF-doxygen/html/functions_func_h.html +3 -3
  216. package/SVF-doxygen/html/functions_func_i.html +18 -14
  217. package/SVF-doxygen/html/functions_func_n.html +6 -6
  218. package/SVF-doxygen/html/functions_func_o.html +16 -16
  219. package/SVF-doxygen/html/functions_func_p.html +4 -7
  220. package/SVF-doxygen/html/functions_func_s.html +1 -1
  221. package/SVF-doxygen/html/functions_func_t.html +7 -10
  222. package/SVF-doxygen/html/functions_func_v.html +4 -5
  223. package/SVF-doxygen/html/functions_func_w.html +16 -4
  224. package/SVF-doxygen/html/functions_func_~.html +10 -10
  225. package/SVF-doxygen/html/functions_g.html +14 -21
  226. package/SVF-doxygen/html/functions_h.html +9 -6
  227. package/SVF-doxygen/html/functions_i.html +32 -29
  228. package/SVF-doxygen/html/functions_l.html +3 -3
  229. package/SVF-doxygen/html/functions_n.html +25 -23
  230. package/SVF-doxygen/html/functions_o.html +31 -29
  231. package/SVF-doxygen/html/functions_p.html +21 -15
  232. package/SVF-doxygen/html/functions_r.html +1 -1
  233. package/SVF-doxygen/html/functions_rela_o.html +3 -3
  234. package/SVF-doxygen/html/functions_s.html +26 -23
  235. package/SVF-doxygen/html/functions_t.html +14 -20
  236. package/SVF-doxygen/html/functions_type_b.html +4 -0
  237. package/SVF-doxygen/html/functions_type_c.html +3 -9
  238. package/SVF-doxygen/html/functions_type_e.html +3 -0
  239. package/SVF-doxygen/html/functions_type_g.html +3 -0
  240. package/SVF-doxygen/html/functions_type_i.html +7 -8
  241. package/SVF-doxygen/html/functions_type_n.html +13 -9
  242. package/SVF-doxygen/html/functions_type_s.html +3 -0
  243. package/SVF-doxygen/html/functions_type_w.html +19 -6
  244. package/SVF-doxygen/html/functions_v.html +8 -9
  245. package/SVF-doxygen/html/functions_vars.html +18 -30
  246. package/SVF-doxygen/html/functions_vars_h.html +3 -0
  247. package/SVF-doxygen/html/functions_vars_p.html +3 -0
  248. package/SVF-doxygen/html/functions_vars_t.html +0 -3
  249. package/SVF-doxygen/html/functions_vars_w.html +4 -0
  250. package/SVF-doxygen/html/functions_w.html +47 -20
  251. package/SVF-doxygen/html/functions_~.html +10 -10
  252. package/SVF-doxygen/html/hierarchy.html +621 -614
  253. package/SVF-doxygen/html/namespaceSVF.html +127 -7
  254. package/SVF-doxygen/html/namespacemembers_c.html +9 -0
  255. package/SVF-doxygen/html/namespacemembers_i.html +14 -5
  256. package/SVF-doxygen/html/namespacemembers_type_c.html +9 -0
  257. package/SVF-doxygen/html/namespacemembers_type_i.html +9 -0
  258. package/SVF-doxygen/html/search/all_0.js +124 -127
  259. package/SVF-doxygen/html/search/all_1.js +495 -495
  260. package/SVF-doxygen/html/search/all_10.js +325 -325
  261. package/SVF-doxygen/html/search/all_11.js +225 -225
  262. package/SVF-doxygen/html/search/all_12.js +555 -554
  263. package/SVF-doxygen/html/search/all_13.js +201 -203
  264. package/SVF-doxygen/html/search/all_14.js +67 -67
  265. package/SVF-doxygen/html/search/all_15.js +168 -168
  266. package/SVF-doxygen/html/search/all_16.js +73 -63
  267. package/SVF-doxygen/html/search/all_17.js +1 -1
  268. package/SVF-doxygen/html/search/all_18.js +1 -1
  269. package/SVF-doxygen/html/search/all_19.js +11 -11
  270. package/SVF-doxygen/html/search/all_1a.js +175 -175
  271. package/SVF-doxygen/html/search/all_2.js +172 -173
  272. package/SVF-doxygen/html/search/all_3.js +648 -649
  273. package/SVF-doxygen/html/search/all_4.js +230 -230
  274. package/SVF-doxygen/html/search/all_5.js +120 -119
  275. package/SVF-doxygen/html/search/all_6.js +227 -226
  276. package/SVF-doxygen/html/search/all_7.js +1046 -1048
  277. package/SVF-doxygen/html/search/all_8.js +196 -191
  278. package/SVF-doxygen/html/search/all_9.js +579 -574
  279. package/SVF-doxygen/html/search/all_a.js +46 -46
  280. package/SVF-doxygen/html/search/all_b.js +26 -26
  281. package/SVF-doxygen/html/search/all_c.js +115 -115
  282. package/SVF-doxygen/html/search/all_d.js +197 -197
  283. package/SVF-doxygen/html/search/all_e.js +207 -207
  284. package/SVF-doxygen/html/search/all_f.js +116 -116
  285. package/SVF-doxygen/html/search/classes_0.js +26 -26
  286. package/SVF-doxygen/html/search/classes_1.js +9 -9
  287. package/SVF-doxygen/html/search/classes_10.js +74 -74
  288. package/SVF-doxygen/html/search/classes_11.js +14 -15
  289. package/SVF-doxygen/html/search/classes_12.js +2 -2
  290. package/SVF-doxygen/html/search/classes_13.js +10 -10
  291. package/SVF-doxygen/html/search/classes_14.js +20 -14
  292. package/SVF-doxygen/html/search/classes_15.js +1 -1
  293. package/SVF-doxygen/html/search/classes_2.js +78 -81
  294. package/SVF-doxygen/html/search/classes_3.js +37 -37
  295. package/SVF-doxygen/html/search/classes_4.js +9 -9
  296. package/SVF-doxygen/html/search/classes_5.js +28 -28
  297. package/SVF-doxygen/html/search/classes_6.js +104 -104
  298. package/SVF-doxygen/html/search/classes_7.js +38 -34
  299. package/SVF-doxygen/html/search/classes_8.js +58 -57
  300. package/SVF-doxygen/html/search/classes_9.js +1 -1
  301. package/SVF-doxygen/html/search/classes_a.js +12 -12
  302. package/SVF-doxygen/html/search/classes_b.js +29 -29
  303. package/SVF-doxygen/html/search/classes_c.js +6 -6
  304. package/SVF-doxygen/html/search/classes_d.js +18 -18
  305. package/SVF-doxygen/html/search/classes_e.js +36 -36
  306. package/SVF-doxygen/html/search/classes_f.js +25 -25
  307. package/SVF-doxygen/html/search/defines_0.js +3 -3
  308. package/SVF-doxygen/html/search/defines_1.js +2 -2
  309. package/SVF-doxygen/html/search/defines_2.js +30 -30
  310. package/SVF-doxygen/html/search/defines_3.js +20 -20
  311. package/SVF-doxygen/html/search/defines_4.js +2 -2
  312. package/SVF-doxygen/html/search/defines_5.js +4 -4
  313. package/SVF-doxygen/html/search/defines_6.js +2 -2
  314. package/SVF-doxygen/html/search/defines_7.js +5 -5
  315. package/SVF-doxygen/html/search/defines_8.js +11 -11
  316. package/SVF-doxygen/html/search/defines_9.js +9 -9
  317. package/SVF-doxygen/html/search/defines_a.js +2 -2
  318. package/SVF-doxygen/html/search/defines_b.js +1 -1
  319. package/SVF-doxygen/html/search/defines_c.js +3 -3
  320. package/SVF-doxygen/html/search/defines_d.js +2 -2
  321. package/SVF-doxygen/html/search/defines_e.js +7 -7
  322. package/SVF-doxygen/html/search/defines_f.js +3 -3
  323. package/SVF-doxygen/html/search/enums_0.js +3 -3
  324. package/SVF-doxygen/html/search/enums_1.js +2 -2
  325. package/SVF-doxygen/html/search/enums_10.js +1 -1
  326. package/SVF-doxygen/html/search/enums_11.js +1 -1
  327. package/SVF-doxygen/html/search/enums_2.js +8 -8
  328. package/SVF-doxygen/html/search/enums_3.js +1 -1
  329. package/SVF-doxygen/html/search/enums_4.js +3 -3
  330. package/SVF-doxygen/html/search/enums_5.js +1 -1
  331. package/SVF-doxygen/html/search/enums_6.js +2 -2
  332. package/SVF-doxygen/html/search/enums_7.js +2 -2
  333. package/SVF-doxygen/html/search/enums_8.js +4 -4
  334. package/SVF-doxygen/html/search/enums_9.js +1 -1
  335. package/SVF-doxygen/html/search/enums_a.js +1 -1
  336. package/SVF-doxygen/html/search/enums_b.js +7 -7
  337. package/SVF-doxygen/html/search/enums_c.js +1 -1
  338. package/SVF-doxygen/html/search/enums_d.js +4 -4
  339. package/SVF-doxygen/html/search/enums_e.js +2 -2
  340. package/SVF-doxygen/html/search/enums_f.js +4 -4
  341. package/SVF-doxygen/html/search/enumvalues_0.js +14 -14
  342. package/SVF-doxygen/html/search/enumvalues_1.js +14 -14
  343. package/SVF-doxygen/html/search/enumvalues_10.js +35 -35
  344. package/SVF-doxygen/html/search/enumvalues_11.js +3 -3
  345. package/SVF-doxygen/html/search/enumvalues_12.js +10 -10
  346. package/SVF-doxygen/html/search/enumvalues_13.js +1 -1
  347. package/SVF-doxygen/html/search/enumvalues_14.js +1 -1
  348. package/SVF-doxygen/html/search/enumvalues_15.js +3 -3
  349. package/SVF-doxygen/html/search/enumvalues_2.js +36 -36
  350. package/SVF-doxygen/html/search/enumvalues_3.js +13 -13
  351. package/SVF-doxygen/html/search/enumvalues_4.js +2 -2
  352. package/SVF-doxygen/html/search/enumvalues_5.js +47 -47
  353. package/SVF-doxygen/html/search/enumvalues_6.js +6 -6
  354. package/SVF-doxygen/html/search/enumvalues_7.js +8 -8
  355. package/SVF-doxygen/html/search/enumvalues_8.js +23 -23
  356. package/SVF-doxygen/html/search/enumvalues_9.js +6 -6
  357. package/SVF-doxygen/html/search/enumvalues_a.js +15 -15
  358. package/SVF-doxygen/html/search/enumvalues_b.js +11 -11
  359. package/SVF-doxygen/html/search/enumvalues_c.js +5 -5
  360. package/SVF-doxygen/html/search/enumvalues_d.js +18 -18
  361. package/SVF-doxygen/html/search/enumvalues_e.js +9 -9
  362. package/SVF-doxygen/html/search/enumvalues_f.js +45 -45
  363. package/SVF-doxygen/html/search/files_0.js +14 -14
  364. package/SVF-doxygen/html/search/files_1.js +7 -7
  365. package/SVF-doxygen/html/search/files_10.js +8 -8
  366. package/SVF-doxygen/html/search/files_11.js +8 -8
  367. package/SVF-doxygen/html/search/files_12.js +2 -2
  368. package/SVF-doxygen/html/search/files_2.js +58 -57
  369. package/SVF-doxygen/html/search/files_3.js +14 -14
  370. package/SVF-doxygen/html/search/files_4.js +5 -5
  371. package/SVF-doxygen/html/search/files_5.js +13 -13
  372. package/SVF-doxygen/html/search/files_6.js +9 -9
  373. package/SVF-doxygen/html/search/files_7.js +15 -14
  374. package/SVF-doxygen/html/search/files_8.js +13 -13
  375. package/SVF-doxygen/html/search/files_9.js +18 -18
  376. package/SVF-doxygen/html/search/files_a.js +3 -3
  377. package/SVF-doxygen/html/search/files_b.js +2 -2
  378. package/SVF-doxygen/html/search/files_c.js +20 -20
  379. package/SVF-doxygen/html/search/files_d.js +4 -4
  380. package/SVF-doxygen/html/search/files_e.js +62 -62
  381. package/SVF-doxygen/html/search/files_f.js +8 -8
  382. package/SVF-doxygen/html/search/functions_0.js +13 -13
  383. package/SVF-doxygen/html/search/functions_1.js +365 -364
  384. package/SVF-doxygen/html/search/functions_10.js +139 -140
  385. package/SVF-doxygen/html/search/functions_11.js +140 -140
  386. package/SVF-doxygen/html/search/functions_12.js +289 -289
  387. package/SVF-doxygen/html/search/functions_13.js +71 -72
  388. package/SVF-doxygen/html/search/functions_14.js +39 -39
  389. package/SVF-doxygen/html/search/functions_15.js +71 -71
  390. package/SVF-doxygen/html/search/functions_16.js +36 -32
  391. package/SVF-doxygen/html/search/functions_17.js +3 -3
  392. package/SVF-doxygen/html/search/functions_18.js +175 -175
  393. package/SVF-doxygen/html/search/functions_2.js +90 -91
  394. package/SVF-doxygen/html/search/functions_3.js +260 -262
  395. package/SVF-doxygen/html/search/functions_4.js +78 -78
  396. package/SVF-doxygen/html/search/functions_5.js +53 -53
  397. package/SVF-doxygen/html/search/functions_6.js +61 -60
  398. package/SVF-doxygen/html/search/functions_7.js +854 -857
  399. package/SVF-doxygen/html/search/functions_8.js +148 -148
  400. package/SVF-doxygen/html/search/functions_9.js +422 -421
  401. package/SVF-doxygen/html/search/functions_a.js +30 -30
  402. package/SVF-doxygen/html/search/functions_b.js +2 -2
  403. package/SVF-doxygen/html/search/functions_c.js +25 -25
  404. package/SVF-doxygen/html/search/functions_d.js +79 -79
  405. package/SVF-doxygen/html/search/functions_e.js +35 -35
  406. package/SVF-doxygen/html/search/functions_f.js +56 -56
  407. package/SVF-doxygen/html/search/namespaces_0.js +1 -1
  408. package/SVF-doxygen/html/search/namespaces_1.js +7 -7
  409. package/SVF-doxygen/html/search/related_0.js +2 -2
  410. package/SVF-doxygen/html/search/related_1.js +2 -2
  411. package/SVF-doxygen/html/search/related_2.js +3 -3
  412. package/SVF-doxygen/html/search/related_3.js +2 -2
  413. package/SVF-doxygen/html/search/related_4.js +2 -2
  414. package/SVF-doxygen/html/search/related_5.js +1 -1
  415. package/SVF-doxygen/html/search/related_6.js +2 -2
  416. package/SVF-doxygen/html/search/related_7.js +4 -4
  417. package/SVF-doxygen/html/search/related_8.js +2 -2
  418. package/SVF-doxygen/html/search/related_9.js +4 -4
  419. package/SVF-doxygen/html/search/related_a.js +19 -19
  420. package/SVF-doxygen/html/search/related_b.js +4 -4
  421. package/SVF-doxygen/html/search/related_c.js +2 -2
  422. package/SVF-doxygen/html/search/related_d.js +12 -12
  423. package/SVF-doxygen/html/search/related_e.js +2 -2
  424. package/SVF-doxygen/html/search/related_f.js +2 -2
  425. package/SVF-doxygen/html/search/typedefs_0.js +19 -19
  426. package/SVF-doxygen/html/search/typedefs_1.js +27 -26
  427. package/SVF-doxygen/html/search/typedefs_10.js +63 -62
  428. package/SVF-doxygen/html/search/typedefs_11.js +13 -13
  429. package/SVF-doxygen/html/search/typedefs_12.js +11 -11
  430. package/SVF-doxygen/html/search/typedefs_13.js +33 -33
  431. package/SVF-doxygen/html/search/typedefs_14.js +11 -8
  432. package/SVF-doxygen/html/search/typedefs_2.js +129 -129
  433. package/SVF-doxygen/html/search/typedefs_3.js +39 -39
  434. package/SVF-doxygen/html/search/typedefs_4.js +18 -17
  435. package/SVF-doxygen/html/search/typedefs_5.js +41 -41
  436. package/SVF-doxygen/html/search/typedefs_6.js +57 -56
  437. package/SVF-doxygen/html/search/typedefs_7.js +47 -44
  438. package/SVF-doxygen/html/search/typedefs_8.js +1 -1
  439. package/SVF-doxygen/html/search/typedefs_9.js +6 -6
  440. package/SVF-doxygen/html/search/typedefs_a.js +29 -29
  441. package/SVF-doxygen/html/search/typedefs_b.js +29 -29
  442. package/SVF-doxygen/html/search/typedefs_c.js +41 -41
  443. package/SVF-doxygen/html/search/typedefs_d.js +14 -14
  444. package/SVF-doxygen/html/search/typedefs_e.js +52 -52
  445. package/SVF-doxygen/html/search/typedefs_f.js +14 -14
  446. package/SVF-doxygen/html/search/variables_0.js +148 -151
  447. package/SVF-doxygen/html/search/variables_1.js +76 -76
  448. package/SVF-doxygen/html/search/variables_10.js +99 -98
  449. package/SVF-doxygen/html/search/variables_11.js +45 -45
  450. package/SVF-doxygen/html/search/variables_12.js +91 -91
  451. package/SVF-doxygen/html/search/variables_13.js +73 -74
  452. package/SVF-doxygen/html/search/variables_14.js +14 -14
  453. package/SVF-doxygen/html/search/variables_15.js +49 -49
  454. package/SVF-doxygen/html/search/variables_16.js +10 -9
  455. package/SVF-doxygen/html/search/variables_17.js +1 -1
  456. package/SVF-doxygen/html/search/variables_18.js +2 -2
  457. package/SVF-doxygen/html/search/variables_2.js +38 -38
  458. package/SVF-doxygen/html/search/variables_3.js +142 -142
  459. package/SVF-doxygen/html/search/variables_4.js +50 -50
  460. package/SVF-doxygen/html/search/variables_5.js +37 -37
  461. package/SVF-doxygen/html/search/variables_6.js +66 -66
  462. package/SVF-doxygen/html/search/variables_7.js +34 -34
  463. package/SVF-doxygen/html/search/variables_8.js +8 -7
  464. package/SVF-doxygen/html/search/variables_9.js +78 -78
  465. package/SVF-doxygen/html/search/variables_a.js +4 -4
  466. package/SVF-doxygen/html/search/variables_b.js +10 -10
  467. package/SVF-doxygen/html/search/variables_c.js +45 -45
  468. package/SVF-doxygen/html/search/variables_d.js +55 -55
  469. package/SVF-doxygen/html/search/variables_e.js +123 -123
  470. package/SVF-doxygen/html/search/variables_f.js +30 -30
  471. package/SVF-doxygen/html/structSVF_1_1has__edgetype.html +97 -0
  472. package/SVF-doxygen/html/structSVF_1_1has__edgetype.png +0 -0
  473. package/SVF-doxygen/html/structSVF_1_1has__edgetype_3_01T_00_01std_1_1void__t_3_01typename_01T_1_1EdgeType_01_4_01_4.html +97 -0
  474. package/SVF-doxygen/html/structSVF_1_1has__edgetype_3_01T_00_01std_1_1void__t_3_01typename_01T_1_1EdgeType_01_4_01_4.png +0 -0
  475. package/SVF-doxygen/html/structSVF_1_1has__nodetype.html +97 -0
  476. package/SVF-doxygen/html/structSVF_1_1has__nodetype.png +0 -0
  477. package/SVF-doxygen/html/structSVF_1_1has__nodetype_3_01T_00_01std_1_1void__t_3_01typename_01T_1_1NodeType_01_4_01_4.html +97 -0
  478. package/SVF-doxygen/html/structSVF_1_1has__nodetype_3_01T_00_01std_1_1void__t_3_01typename_01T_1_1NodeType_01_4_01_4.png +0 -0
  479. package/SVF-doxygen/html/svf-ex_8cpp.html +2 -2
  480. package/SVF-doxygen/html/svf-ex_8cpp_source.html +3 -3
  481. package/package.json +1 -1
  482. package/svf/include/AbstractExecution/CFBasicBlockGWTO.h +83 -0
  483. package/svf/include/AbstractExecution/ICFGWTO.h +78 -0
  484. package/svf/include/DDA/DDAPass.h +2 -2
  485. package/svf/include/DDA/DDAVFSolver.h +2 -2
  486. package/svf/include/Graphs/SVFGStat.h +1 -1
  487. package/svf/include/Graphs/WTO.h +859 -0
  488. package/svf/include/MSSA/MemRegion.h +3 -3
  489. package/svf/include/MTA/TCT.h +2 -2
  490. package/svf/include/MemoryModel/PointerAnalysis.h +5 -14
  491. package/svf/include/Util/SVFStat.h +3 -0
  492. package/svf/include/WPA/CSC.h +3 -3
  493. package/svf/lib/DDA/DDAStat.cpp +2 -2
  494. package/svf/lib/Graphs/SVFGStat.cpp +2 -4
  495. package/svf/lib/MemoryModel/PointerAnalysis.cpp +1 -1
  496. package/svf/lib/Util/PTAStat.cpp +14 -4
  497. package/svf/lib/Util/SVFStat.cpp +13 -3
  498. package/svf/lib/WPA/AndersenStat.cpp +3 -8
  499. package/svf/lib/WPA/FlowSensitiveStat.cpp +1 -2
  500. package/svf/lib/WPA/VersionedFlowSensitiveStat.cpp +1 -2
  501. package/svf/include/AbstractExecution/WTO.h +0 -897
  502. /package/svf/include/{Util → Graphs}/SCC.h +0 -0
@@ -0,0 +1,859 @@
1
+ //===- WTO.h -- Weakest Topological Order Analysis-------------------------//
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
+ * WTO.h
25
+ *
26
+ * The implementation is based on F. Bourdoncle's paper:
27
+ * "Efficient chaotic iteration strategies with widenings", Formal
28
+ * Methods in Programming and Their Applications, 1993, pages 128-141.
29
+ *
30
+ * Created on: Jan 22, 2024
31
+ * Author: Xiao Cheng, Jiawei Wang
32
+ *
33
+ */
34
+ #ifndef WTO_H_
35
+ #define WTO_H_
36
+
37
+ #include "SVFIR/SVFType.h"
38
+ #include "SVFIR/SVFValue.h"
39
+
40
+ namespace SVF
41
+ {
42
+
43
+ template <typename GraphT> class WTO;
44
+
45
+ template <typename GraphT> class WTONode;
46
+
47
+ template <typename GraphT> class WTOCycle;
48
+
49
+ template <typename GraphT> class WTOComponentVisitor;
50
+
51
+ // Helper to test for the existence of a sub type
52
+ template <typename T, typename = void> struct has_nodetype : std::false_type
53
+ {
54
+ };
55
+
56
+ template <typename T>
57
+ struct has_nodetype<T, std::void_t<typename T::NodeType>> : std::true_type
58
+ {
59
+ };
60
+
61
+ template <typename T, typename = void> struct has_edgetype : std::false_type
62
+ {
63
+ };
64
+
65
+ template <typename T>
66
+ struct has_edgetype<T, std::void_t<typename T::EdgeType>> : std::true_type
67
+ {
68
+ };
69
+
70
+ /*!
71
+ * Cycle depth of a WTO Component
72
+ *
73
+ * The cycle depth is represented as **a list of cycle's heads**,
74
+ * **from the outermost to the innermost**.
75
+ *
76
+ * e.g., consider the following nested cycle:
77
+ *
78
+ * -->1 --> 2 --> 3 --> 4
79
+ * \ /
80
+ * <-- 6 <-- 5 <--
81
+ * \ /
82
+ * >7>
83
+ *
84
+ * where C1: (1 2 3 4 5 6 7) is the outer cycle, where 1 is the head,
85
+ * and C2: (5 6 7) is the inner cycle, where 5 is the head.
86
+ *
87
+ * The cycle depth is as following:
88
+ * ---------------------------------
89
+ * | Node NO. | Cycle Depth |
90
+ * --------------------------------
91
+ * | 1 (head of C1) | [ ] |
92
+ * --------------------------------
93
+ * | 2, 3, 4 | [1] |
94
+ * --------------------------------
95
+ * | 5 (head of C2) | [1] |
96
+ * --------------------------------
97
+ * | 6, 7 | [1, 5] |
98
+ * --------------------------------
99
+ */
100
+ template <typename GraphT> class WTOCycleDepth
101
+ {
102
+ public:
103
+ static_assert(has_nodetype<GraphT>::value,
104
+ "GraphT must have a nested type named 'NodeType'");
105
+ typedef typename GraphT::NodeType NodeT;
106
+
107
+ private:
108
+ typedef std::vector<const NodeT*> NodeRefList;
109
+
110
+ public:
111
+ typedef typename NodeRefList::const_iterator Iterator;
112
+
113
+ private:
114
+ NodeRefList _heads;
115
+
116
+ public:
117
+ /// Constructor
118
+ WTOCycleDepth() = default;
119
+
120
+ /// Copy constructor
121
+ WTOCycleDepth(const WTOCycleDepth&) = default;
122
+
123
+ /// Move constructor
124
+ WTOCycleDepth(WTOCycleDepth&&) = default;
125
+
126
+ /// Copy assignment operator
127
+ WTOCycleDepth& operator=(const WTOCycleDepth&) = default;
128
+
129
+ /// Move assignment operator
130
+ WTOCycleDepth& operator=(WTOCycleDepth&&) = default;
131
+
132
+ /// Destructor
133
+ ~WTOCycleDepth() = default;
134
+
135
+ /// Add a cycle head in the cycleDepth
136
+ void add(const NodeT* head)
137
+ {
138
+ _heads.push_back(head);
139
+ }
140
+
141
+ /// Begin iterator over the head of cycles
142
+ Iterator begin() const
143
+ {
144
+ return _heads.cbegin();
145
+ }
146
+
147
+ /// End iterator over the head of cycles
148
+ Iterator end() const
149
+ {
150
+ return _heads.cend();
151
+ }
152
+
153
+ /// Return the common prefix of the given cycle depths
154
+ WTOCycleDepth operator^(const WTOCycleDepth& other) const
155
+ {
156
+ WTOCycleDepth res;
157
+ for (auto this_it = begin(), other_it = other.begin();
158
+ this_it != end() && other_it != other.end(); ++this_it, ++other_it)
159
+ {
160
+ if (*this_it == *other_it)
161
+ {
162
+ res.add(*this_it);
163
+ }
164
+ else
165
+ {
166
+ break;
167
+ }
168
+ }
169
+ return res;
170
+ }
171
+
172
+ private:
173
+ /// Compare the given cycle depths
174
+ int compare(const WTOCycleDepth& other) const
175
+ {
176
+ if (this == &other)
177
+ {
178
+ return 0; // equals
179
+ }
180
+
181
+ auto this_it = begin();
182
+ auto other_it = other.begin();
183
+ while (this_it != end())
184
+ {
185
+ if (other_it == other.end())
186
+ {
187
+ return 1; // `this` is nested within `other`
188
+ }
189
+ else if (*this_it == *other_it)
190
+ {
191
+ ++this_it;
192
+ ++other_it;
193
+ }
194
+ else
195
+ {
196
+ return 2; // not comparable
197
+ }
198
+ }
199
+ if (other_it == other.end())
200
+ {
201
+ return 0; // equals
202
+ }
203
+ else
204
+ {
205
+ return -1; // `other` is nested within `this`
206
+ }
207
+ }
208
+
209
+ public:
210
+ bool operator<(const WTOCycleDepth& other) const
211
+ {
212
+ return compare(other) == -1;
213
+ }
214
+
215
+ bool operator<=(const WTOCycleDepth& other) const
216
+ {
217
+ return compare(other) <= 0;
218
+ }
219
+
220
+ bool operator==(const WTOCycleDepth& other) const
221
+ {
222
+ return compare(other) == 0;
223
+ }
224
+
225
+ bool operator>=(const WTOCycleDepth& other) const
226
+ {
227
+ return operator<=(other, *this);
228
+ }
229
+
230
+ bool operator>(const WTOCycleDepth& other) const
231
+ {
232
+ return compare(other) == 1;
233
+ }
234
+
235
+ /// Dump the cycleDepth, for debugging purpose
236
+ [[nodiscard]] std::string toString() const
237
+ {
238
+ std::string str;
239
+ std::stringstream rawstr(str);
240
+ rawstr << "[";
241
+ for (auto it = begin(), et = end(); it != et;)
242
+ {
243
+ rawstr << (*it)->toString();
244
+ ++it;
245
+ if (it != et)
246
+ {
247
+ rawstr << ", ";
248
+ }
249
+ }
250
+ rawstr << "]";
251
+ return rawstr.str();
252
+ }
253
+
254
+ /// Overloading operator << for dumping ICFG node ID
255
+ //@{
256
+ friend std::ostream& operator<<(std::ostream& o,
257
+ const WTOCycleDepth<GraphT>& wto)
258
+ {
259
+ o << wto.toString();
260
+ return o;
261
+ }
262
+ //@}
263
+
264
+ }; // end class WTOCycleDepth
265
+
266
+ /*!
267
+ * Base class for a WTO component
268
+ *
269
+ * A WTO component can be either a node or cycle
270
+ */
271
+ template <typename GraphT> class WTOComponent
272
+ {
273
+ public:
274
+ enum WTOCT
275
+ {
276
+ Node,
277
+ Cycle
278
+ };
279
+
280
+ /// Default constructor
281
+ explicit WTOComponent(WTOCT k) : _type(k) {};
282
+
283
+ /// Copy constructor
284
+ WTOComponent(const WTOComponent&) noexcept = default;
285
+
286
+ /// Move constructor
287
+ WTOComponent(WTOComponent&&) noexcept = default;
288
+
289
+ /// Copy assignment operator
290
+ WTOComponent& operator=(const WTOComponent&) noexcept = default;
291
+
292
+ /// Move assignment operator
293
+ WTOComponent& operator=(WTOComponent&&) noexcept = default;
294
+
295
+ /// Accept the given visitor
296
+ virtual void accept(WTOComponentVisitor<GraphT>&) const = 0;
297
+
298
+ /// Destructor
299
+ virtual ~WTOComponent() = default;
300
+
301
+ inline WTOCT getKind() const
302
+ {
303
+ return _type;
304
+ }
305
+
306
+ [[nodiscard]] virtual std::string toString() const = 0;
307
+
308
+ /// Overloading operator << for dumping ICFG node ID
309
+ //@{
310
+ friend std::ostream& operator<<(std::ostream& o,
311
+ const WTOComponent<GraphT>& wto)
312
+ {
313
+ o << wto.toString();
314
+ return o;
315
+ }
316
+ //@}
317
+
318
+ WTOCT _type;
319
+
320
+ }; // end class WTOComponent
321
+
322
+ /*!
323
+ * WTO node for GraphT
324
+ */
325
+ template <typename GraphT> class WTONode final : public WTOComponent<GraphT>
326
+ {
327
+ public:
328
+ static_assert(has_nodetype<GraphT>::value,
329
+ "GraphT must have a nested type named 'NodeType'");
330
+ typedef typename GraphT::NodeType NodeT;
331
+
332
+ private:
333
+ const NodeT* _node;
334
+
335
+ public:
336
+ /// Constructor
337
+ explicit WTONode(const NodeT* node)
338
+ : WTOComponent<GraphT>(WTOComponent<GraphT>::Node), _node(node)
339
+ {
340
+ }
341
+
342
+ /// Return the graph node
343
+ const NodeT* node() const
344
+ {
345
+ return _node;
346
+ }
347
+
348
+ /// Accept the given visitor
349
+ void accept(WTOComponentVisitor<GraphT>& v) const override
350
+ {
351
+ v.visit(*this);
352
+ }
353
+
354
+ /// Dump the node, for debugging purpose
355
+ [[nodiscard]] std::string toString() const override
356
+ {
357
+ // return _node->toString();
358
+ return std::to_string(_node->getId());
359
+ }
360
+
361
+ /// ClassOf
362
+ //@{
363
+ static inline bool classof(const WTONode<GraphT>*)
364
+ {
365
+ return true;
366
+ }
367
+
368
+ static inline bool classof(const WTOComponent<GraphT>* c)
369
+ {
370
+ return c->getKind() == WTOComponent<GraphT>::Node;
371
+ }
372
+ ///@}
373
+
374
+ }; // end class WTONode
375
+
376
+ /*!
377
+ * WTO cycle for GraphT
378
+ */
379
+ template <typename GraphT> class WTOCycle final : public WTOComponent<GraphT>
380
+ {
381
+ public:
382
+ static_assert(has_nodetype<GraphT>::value,
383
+ "GraphT must have a nested type named 'NodeType'");
384
+ typedef typename GraphT::NodeType NodeT;
385
+ typedef WTOComponent<GraphT> WTOComponentT;
386
+
387
+ private:
388
+ typedef const WTOComponentT* WTOComponentPtr;
389
+ typedef std::list<WTOComponentPtr> WTOComponentRefList;
390
+
391
+ public:
392
+ /// Iterator over the components
393
+ typedef typename WTOComponentRefList::const_iterator Iterator;
394
+
395
+ private:
396
+ /// Head of the cycle
397
+ const NodeT* _head;
398
+
399
+ /// List of components
400
+ WTOComponentRefList _components;
401
+
402
+ public:
403
+ /// Constructor
404
+ WTOCycle(const NodeT* head, WTOComponentRefList components)
405
+ : WTOComponent<GraphT>(WTOComponent<GraphT>::Cycle), _head(head),
406
+ _components(std::move(components))
407
+ {
408
+ }
409
+
410
+ /// Return the head of the cycle
411
+ const NodeT* head() const
412
+ {
413
+ return _head;
414
+ }
415
+
416
+ /// Begin iterator over the components
417
+ Iterator begin() const
418
+ {
419
+ return _components.cbegin();
420
+ }
421
+
422
+ /// End iterator over the components
423
+ Iterator end() const
424
+ {
425
+ return _components.cend();
426
+ }
427
+
428
+ /// Accept the given visitor
429
+ void accept(WTOComponentVisitor<GraphT>& v) const override
430
+ {
431
+ v.visit(*this);
432
+ }
433
+
434
+ /// ClassOf
435
+ //@{
436
+ static inline bool classof(const WTOCycle<GraphT>*)
437
+ {
438
+ return true;
439
+ }
440
+
441
+ static inline bool classof(const WTOComponent<GraphT>* c)
442
+ {
443
+ return c->getKind() == WTOComponent<GraphT>::Cycle;
444
+ }
445
+ ///@}
446
+
447
+ /// Dump the cycle, for debugging purpose
448
+ [[nodiscard]] std::string toString() const override
449
+ {
450
+ std::string str;
451
+ std::stringstream rawstr(str);
452
+ rawstr << "(";
453
+ rawstr << _head->getId() << ", ";
454
+ for (auto it = begin(), et = end(); it != et;)
455
+ {
456
+ rawstr << (*it)->toString();
457
+ ++it;
458
+ if (it != et)
459
+ {
460
+ rawstr << ", ";
461
+ }
462
+ }
463
+ rawstr << ")";
464
+ return rawstr.str();
465
+ }
466
+
467
+ }; // end class WTOCycle
468
+
469
+ /*!
470
+ * Weak topological order (WTO) visitor
471
+ */
472
+ template <typename GraphT> class WTOComponentVisitor
473
+ {
474
+ public:
475
+ typedef WTONode<GraphT> WTONodeT;
476
+ typedef WTOCycle<GraphT> WTOCycleT;
477
+
478
+ public:
479
+ /// Default constructor
480
+ WTOComponentVisitor() = default;
481
+
482
+ /// Copy constructor
483
+ WTOComponentVisitor(const WTOComponentVisitor&) noexcept = default;
484
+
485
+ /// Move constructor
486
+ WTOComponentVisitor(WTOComponentVisitor&&) noexcept = default;
487
+
488
+ /// Copy assignment operator
489
+ WTOComponentVisitor& operator=(const WTOComponentVisitor&) noexcept =
490
+ default;
491
+
492
+ /// Move assignment operator
493
+ WTOComponentVisitor& operator=(WTOComponentVisitor&&) noexcept = default;
494
+
495
+ /// Visit the given node
496
+ virtual void visit(const WTONodeT&) = 0;
497
+
498
+ /// Visit the given cycle
499
+ virtual void visit(const WTOCycleT&) = 0;
500
+
501
+ /// Destructor
502
+ virtual ~WTOComponentVisitor() = default;
503
+
504
+ }; // end class WTOComponentVisitor
505
+
506
+ /*!
507
+ * Weak topological order for GraphT
508
+ */
509
+ template <typename GraphT> class WTO
510
+ {
511
+
512
+ public:
513
+ static_assert(has_nodetype<GraphT>::value,
514
+ "GraphT must have a nested type named 'NodeType'");
515
+ static_assert(has_edgetype<GraphT>::value,
516
+ "GraphT must have a nested type named 'EdgeType'");
517
+ typedef typename GraphT::NodeType NodeT;
518
+ typedef typename GraphT::EdgeType EdgeT;
519
+ typedef WTOCycleDepth<GraphT> GraphTWTOCycleDepth;
520
+ typedef WTOComponent<GraphT> WTOComponentT;
521
+ typedef WTONode<GraphT> WTONodeT;
522
+ typedef WTOCycle<GraphT> WTOCycleT;
523
+ typedef Set<const NodeT*> NodeRefList;
524
+
525
+ protected:
526
+ typedef const WTOComponentT* WTOComponentPtr;
527
+ typedef std::list<WTOComponentPtr> WTOComponentRefList;
528
+ typedef Set<WTOComponentPtr> WTOComponentRefSet;
529
+ typedef Map<const NodeT*, const WTOCycleT*> NodeRefToWTOCycleMap;
530
+ typedef Map<const NodeT*, NodeRefList> NodeRefTONodeRefListMap;
531
+
532
+ typedef u32_t CycleDepthNumber;
533
+ typedef Map<const NodeT*, CycleDepthNumber> NodeRefToCycleDepthNumber;
534
+ typedef std::vector<const NodeT*> Stack;
535
+ typedef std::shared_ptr<GraphTWTOCycleDepth> WTOCycleDepthPtr;
536
+ typedef Map<const NodeT*, WTOCycleDepthPtr> NodeRefToWTOCycleDepthPtr;
537
+
538
+ public:
539
+ /// Iterator over the components
540
+ typedef typename WTOComponentRefList::const_iterator Iterator;
541
+
542
+ protected:
543
+ WTOComponentRefList _components;
544
+ WTOComponentRefSet _allComponents;
545
+ NodeRefToWTOCycleMap headRefToCycle;
546
+ NodeRefToWTOCycleDepthPtr _nodeToDepth;
547
+ NodeRefToCycleDepthNumber _nodeToCDN;
548
+ CycleDepthNumber _num;
549
+ Stack _stack;
550
+ GraphT* _graph;
551
+ const NodeT* _entry;
552
+
553
+ public:
554
+
555
+ /// Compute the weak topological order of the given graph
556
+ explicit WTO(GraphT* graph, const NodeT* entry) : _num(0), _graph(graph), _entry(entry)
557
+ {
558
+ }
559
+
560
+ /// No copy constructor
561
+ WTO(const WTO& other) = default;
562
+
563
+ /// Move constructor
564
+ WTO(WTO&& other) = default;
565
+
566
+ /// No copy assignment operator
567
+ WTO& operator=(const WTO& other) = default;
568
+
569
+ /// Move assignment operator
570
+ WTO& operator=(WTO&& other) = default;
571
+
572
+ /// Destructor
573
+ ~WTO()
574
+ {
575
+ for (const auto& component : _allComponents)
576
+ {
577
+ delete component;
578
+ }
579
+ }
580
+
581
+ /// Begin iterator over the components
582
+ /// Begin iterator over the components
583
+ Iterator begin() const
584
+ {
585
+ return _components.cbegin();
586
+ }
587
+
588
+ /// End iterator over the components
589
+ Iterator end() const
590
+ {
591
+ return _components.cend();
592
+ }
593
+
594
+ bool isHead(const NodeT* node) const
595
+ {
596
+ return headRefToCycle.find(node) != headRefToCycle.end();
597
+ }
598
+
599
+ typename NodeRefToWTOCycleMap::const_iterator headBegin() const
600
+ {
601
+ return headRefToCycle.cbegin();
602
+ }
603
+
604
+ /// End iterator over the components
605
+ typename NodeRefToWTOCycleMap::const_iterator headEnd() const
606
+ {
607
+ return headRefToCycle.cend();
608
+ }
609
+
610
+ /// Return the cycleDepth of the given node
611
+ const GraphTWTOCycleDepth& cycleDepth(const NodeT* n) const
612
+ {
613
+ auto it = _nodeToDepth.find(n);
614
+ assert(it != _nodeToDepth.end() && "node not found");
615
+ return *(it->second);
616
+ }
617
+
618
+ /// Return the cycleDepth of the given node
619
+ inline bool in_cycleDepth_table(const NodeT* n) const
620
+ {
621
+ auto it = _nodeToDepth.find(n);
622
+ return it != _nodeToDepth.end();
623
+ }
624
+
625
+ /// Accept the given visitor
626
+ void accept(WTOComponentVisitor<GraphT>& v)
627
+ {
628
+ for (const auto& c : _components)
629
+ {
630
+ c->accept(v);
631
+ }
632
+ }
633
+
634
+ /// Dump the order, for debugging purpose
635
+ [[nodiscard]] std::string toString() const
636
+ {
637
+ std::string str;
638
+ std::stringstream rawstr(str);
639
+ rawstr << "[";
640
+ for (auto it = begin(), et = end(); it != et;)
641
+ {
642
+ rawstr << (*it)->toString();
643
+ ++it;
644
+ if (it != et)
645
+ {
646
+ rawstr << ", ";
647
+ }
648
+ }
649
+ rawstr << "]";
650
+ return rawstr.str();
651
+ }
652
+
653
+ /// Overloading operator << for dumping ICFG node ID
654
+ //@{
655
+ friend std::ostream& operator<<(std::ostream& o, const WTO<GraphT>& wto)
656
+ {
657
+ o << wto.toString();
658
+ return o;
659
+ }
660
+ //@}
661
+
662
+ void init()
663
+ {
664
+ visit(_entry, _components);
665
+ _nodeToCDN.clear();
666
+ _stack.clear();
667
+ buildNodeToDepth();
668
+ }
669
+
670
+ protected:
671
+
672
+ /// Visitor to build the cycle depths of each node
673
+ class WTOCycleDepthBuilder final : public WTOComponentVisitor<GraphT>
674
+ {
675
+ private:
676
+ WTOCycleDepthPtr _wtoCycleDepth;
677
+ NodeRefToWTOCycleDepthPtr& _nodeToWTOCycleDepth;
678
+
679
+ public:
680
+ explicit WTOCycleDepthBuilder(
681
+ NodeRefToWTOCycleDepthPtr& nodeToWTOCycleDepth)
682
+ : _wtoCycleDepth(std::make_shared<GraphTWTOCycleDepth>()),
683
+ _nodeToWTOCycleDepth(nodeToWTOCycleDepth)
684
+ {
685
+ }
686
+
687
+ void visit(const WTOCycleT& cycle) override
688
+ {
689
+ const NodeT* head = cycle.head();
690
+ WTOCycleDepthPtr previous_cycleDepth = _wtoCycleDepth;
691
+ _nodeToWTOCycleDepth.insert(std::make_pair(head, _wtoCycleDepth));
692
+ _wtoCycleDepth =
693
+ std::make_shared<GraphTWTOCycleDepth>(*_wtoCycleDepth);
694
+ _wtoCycleDepth->add(head);
695
+ for (auto it = cycle.begin(), et = cycle.end(); it != et; ++it)
696
+ {
697
+ (*it)->accept(*this);
698
+ }
699
+ _wtoCycleDepth = previous_cycleDepth;
700
+ }
701
+
702
+ void visit(const WTONodeT& node) override
703
+ {
704
+ _nodeToWTOCycleDepth.insert(
705
+ std::make_pair(node.node(), _wtoCycleDepth));
706
+ }
707
+
708
+ }; // end class WTOCycleDepthBuilder
709
+
710
+ protected:
711
+
712
+ inline virtual void forEachSuccessor(const NodeT* node, std::function<void(const NodeT*)> func) const
713
+ {
714
+ for (const auto& e : node->getOutEdges())
715
+ {
716
+ func(e->getDstNode());
717
+ }
718
+ }
719
+
720
+ protected:
721
+ /// Return the depth-first number of the given node
722
+ CycleDepthNumber getCDN(const NodeT* n) const
723
+ {
724
+ auto it = _nodeToCDN.find(n);
725
+ if (it != _nodeToCDN.end())
726
+ {
727
+ return it->second;
728
+ }
729
+ else
730
+ {
731
+ return 0;
732
+ }
733
+ }
734
+
735
+ /// Set the depth-first number of the given node
736
+ void setCDN(const NodeT* n, const CycleDepthNumber& dfn)
737
+ {
738
+ auto res = _nodeToCDN.insert(std::make_pair(n, dfn));
739
+ if (!res.second)
740
+ {
741
+ (res.first)->second = dfn;
742
+ }
743
+ }
744
+
745
+ /// Pop a node from the stack
746
+ const NodeT* pop()
747
+ {
748
+ assert(!_stack.empty() && "empty stack");
749
+ const NodeT* top = _stack.back();
750
+ _stack.pop_back();
751
+ return top;
752
+ }
753
+
754
+ /// Push a node on the stack
755
+ void push(const NodeT* n)
756
+ {
757
+ _stack.push_back(n);
758
+ }
759
+
760
+ const WTONodeT* newNode(const NodeT* node)
761
+ {
762
+ const WTONodeT* ptr = new WTONodeT(node);
763
+ _allComponents.insert(ptr);
764
+ return ptr;
765
+ }
766
+
767
+ const WTOCycleT* newCycle(const NodeT* node,
768
+ const WTOComponentRefList& partition)
769
+ {
770
+ const WTOCycleT* ptr = new WTOCycleT(node, std::move(partition));
771
+ _allComponents.insert(ptr);
772
+ return ptr;
773
+ }
774
+
775
+ /// Create the cycle component for the given node
776
+ virtual const WTOCycleT* component(const NodeT* node)
777
+ {
778
+ WTOComponentRefList partition;
779
+ forEachSuccessor(node, [&](const NodeT* succ)
780
+ {
781
+ if (getCDN(succ) == 0)
782
+ {
783
+ visit(succ, partition);
784
+ }
785
+ });
786
+ const WTOCycleT* ptr = newCycle(node, partition);
787
+ headRefToCycle.emplace(node, ptr);
788
+ return ptr;
789
+ }
790
+
791
+ /// Visit the given node
792
+ ///
793
+ /// Algorithm to build a weak topological order of a graph
794
+ virtual CycleDepthNumber visit(const NodeT* node,
795
+ WTOComponentRefList& partition)
796
+ {
797
+ CycleDepthNumber head(0);
798
+ CycleDepthNumber min(0);
799
+ bool loop;
800
+
801
+ push(node);
802
+ _num += CycleDepthNumber(1);
803
+ head = _num;
804
+ setCDN(node, head);
805
+ loop = false;
806
+ forEachSuccessor(node, [&](const NodeT* succ)
807
+ {
808
+ CycleDepthNumber succ_dfn = getCDN(succ);
809
+ if (succ_dfn == CycleDepthNumber(0))
810
+ {
811
+ min = visit(succ, partition);
812
+ }
813
+ else
814
+ {
815
+ min = succ_dfn;
816
+ }
817
+ if (min <= head)
818
+ {
819
+ head = min;
820
+ loop = true;
821
+ }
822
+ });
823
+
824
+ if (head == getCDN(node))
825
+ {
826
+ setCDN(node, UINT_MAX);
827
+ const NodeT* element = pop();
828
+ if (loop)
829
+ {
830
+ while (element != node)
831
+ {
832
+ setCDN(element, 0);
833
+ element = pop();
834
+ }
835
+ partition.push_front(component(node));
836
+ }
837
+ else
838
+ {
839
+ partition.push_front(newNode(node));
840
+ }
841
+ }
842
+ return head;
843
+ }
844
+
845
+ /// Build the node to WTO cycle depth table
846
+ void buildNodeToDepth()
847
+ {
848
+ WTOCycleDepthBuilder builder(_nodeToDepth);
849
+ for (auto it = begin(), et = end(); it != et; ++it)
850
+ {
851
+ (*it)->accept(builder);
852
+ }
853
+ }
854
+
855
+ }; // end class WTO
856
+
857
+ } // namespace SVF
858
+
859
+ #endif /* WTO_H_ */