svf-tools 1.0.372 → 1.0.376

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 (254) hide show
  1. package/SVF-doxygen/html/html/AndersenSFR_8cpp_source.html +3 -3
  2. package/SVF-doxygen/html/html/AndersenStat_8cpp_source.html +5 -6
  3. package/SVF-doxygen/html/html/Andersen_8cpp_source.html +10 -10
  4. package/SVF-doxygen/html/html/CHGBuilder_8cpp_source.html +1 -1
  5. package/SVF-doxygen/html/html/Conditions_8cpp_source.html +1 -1
  6. package/SVF-doxygen/html/html/ConsGEdge_8h_source.html +1 -1
  7. package/SVF-doxygen/html/html/ConsG_8cpp_source.html +3 -3
  8. package/SVF-doxygen/html/html/ConsG_8h_source.html +7 -7
  9. package/SVF-doxygen/html/html/ContextDDA_8cpp_source.html +6 -6
  10. package/SVF-doxygen/html/html/DDAClient_8cpp_source.html +3 -3
  11. package/SVF-doxygen/html/html/DDAClient_8h_source.html +1 -1
  12. package/SVF-doxygen/html/html/DDAPass_8cpp_source.html +1 -1
  13. package/SVF-doxygen/html/html/DDAVFSolver_8h_source.html +15 -15
  14. package/SVF-doxygen/html/html/FlowDDA_8cpp_source.html +2 -2
  15. package/SVF-doxygen/html/html/FlowSensitiveStat_8cpp_source.html +7 -7
  16. package/SVF-doxygen/html/html/FlowSensitiveTBHC_8cpp_source.html +7 -7
  17. package/SVF-doxygen/html/html/FlowSensitive_8cpp_source.html +1 -1
  18. package/SVF-doxygen/html/html/Graph2Json_8cpp_source.html +1 -1
  19. package/SVF-doxygen/html/html/ICFG_8cpp_source.html +4 -10
  20. package/SVF-doxygen/html/html/IRAnnotator_8h_source.html +3 -3
  21. package/SVF-doxygen/html/html/IRGraph_8cpp_source.html +6 -6
  22. package/SVF-doxygen/html/html/IRGraph_8h_source.html +2 -2
  23. package/SVF-doxygen/html/html/LLVMUtil_8cpp_source.html +2 -2
  24. package/SVF-doxygen/html/html/LLVMUtil_8h.html +3 -3
  25. package/SVF-doxygen/html/html/LLVMUtil_8h_source.html +2 -2
  26. package/SVF-doxygen/html/html/LeakChecker_8cpp_source.html +1 -1
  27. package/SVF-doxygen/html/html/LocationSet_8cpp_source.html +11 -11
  28. package/SVF-doxygen/html/html/LocationSet_8h_source.html +10 -11
  29. package/SVF-doxygen/html/html/MemRegion_8cpp_source.html +10 -10
  30. package/SVF-doxygen/html/html/OfflineConsG_8cpp_source.html +1 -1
  31. package/SVF-doxygen/html/html/Options_8cpp_source.html +22 -21
  32. package/SVF-doxygen/html/html/Options_8h_source.html +22 -21
  33. package/SVF-doxygen/html/html/PAGBuilderFromFile_8cpp_source.html +1 -1
  34. package/SVF-doxygen/html/html/PTAStat_8cpp_source.html +17 -17
  35. package/SVF-doxygen/html/html/PathCondAllocator_8cpp_source.html +1 -1
  36. package/SVF-doxygen/html/html/PointerAnalysisImpl_8cpp_source.html +8 -8
  37. package/SVF-doxygen/html/html/PointerAnalysisImpl_8h_source.html +2 -2
  38. package/SVF-doxygen/html/html/PointerAnalysis_8cpp_source.html +11 -11
  39. package/SVF-doxygen/html/html/PointerAnalysis_8h_source.html +14 -14
  40. package/SVF-doxygen/html/html/SVFG_8cpp_source.html +2 -2
  41. package/SVF-doxygen/html/html/SVFIRBuilder_8cpp_source.html +8 -10
  42. package/SVF-doxygen/html/html/SVFIRBuilder_8h_source.html +72 -73
  43. package/SVF-doxygen/html/html/SVFIR_8cpp_source.html +37 -35
  44. package/SVF-doxygen/html/html/SVFIR_8h_source.html +66 -68
  45. package/SVF-doxygen/html/html/SVFModule_8cpp_source.html +1 -1
  46. package/SVF-doxygen/html/html/SVFStatements_8cpp_source.html +1 -1
  47. package/SVF-doxygen/html/html/SVFStatements_8h_source.html +5 -5
  48. package/SVF-doxygen/html/html/SVFUtil_8cpp_source.html +1 -1
  49. package/SVF-doxygen/html/html/SVFVariables_8cpp_source.html +18 -19
  50. package/SVF-doxygen/html/html/SVFVariables_8h_source.html +121 -127
  51. package/SVF-doxygen/html/html/SaberSVFGBuilder_8cpp_source.html +6 -6
  52. package/SVF-doxygen/html/html/SrcSnkDDA_8cpp_source.html +1 -1
  53. package/SVF-doxygen/html/html/SymbolTableBuilder_8cpp_source.html +39 -30
  54. package/SVF-doxygen/html/html/SymbolTableBuilder_8h_source.html +10 -7
  55. package/SVF-doxygen/html/html/SymbolTableInfo_8cpp_source.html +93 -53
  56. package/SVF-doxygen/html/html/SymbolTableInfo_8h_source.html +82 -85
  57. package/SVF-doxygen/html/html/ThreadCallGraph_8cpp_source.html +5 -5
  58. package/SVF-doxygen/html/html/TypeAnalysis_8cpp_source.html +1 -1
  59. package/SVF-doxygen/html/html/TypeBasedHeapCloning_8cpp_source.html +17 -16
  60. package/SVF-doxygen/html/html/TypeBasedHeapCloning_8h_source.html +1 -1
  61. package/SVF-doxygen/html/html/VFGNode_8h_source.html +2 -2
  62. package/SVF-doxygen/html/html/VFG_8cpp_source.html +7 -7
  63. package/SVF-doxygen/html/html/VFG_8h_source.html +2 -2
  64. package/SVF-doxygen/html/html/VersionedFlowSensitiveStat_8cpp_source.html +4 -4
  65. package/SVF-doxygen/html/html/VersionedFlowSensitive_8cpp_source.html +4 -4
  66. package/SVF-doxygen/html/html/WPAPass_8cpp_source.html +5 -5
  67. package/SVF-doxygen/html/html/classSVF_1_1ActualParmVFGNode.html +1 -1
  68. package/SVF-doxygen/html/html/classSVF_1_1ActualRetVFGNode.html +1 -1
  69. package/SVF-doxygen/html/html/classSVF_1_1AliasDDAClient.html +2 -2
  70. package/SVF-doxygen/html/html/classSVF_1_1Andersen.html +8 -8
  71. package/SVF-doxygen/html/html/classSVF_1_1AndersenBase.html +8 -8
  72. package/SVF-doxygen/html/html/classSVF_1_1AndersenSFR.html +4 -4
  73. package/SVF-doxygen/html/html/classSVF_1_1AndersenStat.html +5 -6
  74. package/SVF-doxygen/html/html/classSVF_1_1ArgumentVFGNode.html +3 -3
  75. package/SVF-doxygen/html/html/classSVF_1_1BVDataPTAImpl.html +12 -13
  76. package/SVF-doxygen/html/html/classSVF_1_1BinaryOPVFGNode.html +3 -3
  77. package/SVF-doxygen/html/html/classSVF_1_1BranchCondManager.html +2 -2
  78. package/SVF-doxygen/html/html/classSVF_1_1BranchStmt.html +2 -2
  79. package/SVF-doxygen/html/html/classSVF_1_1CHGBuilder.html +1 -1
  80. package/SVF-doxygen/html/html/classSVF_1_1CloneDummyObjVar-members.html +22 -25
  81. package/SVF-doxygen/html/html/classSVF_1_1CloneDummyObjVar.html +16 -25
  82. package/SVF-doxygen/html/html/classSVF_1_1CloneFIObjVar-members.html +22 -25
  83. package/SVF-doxygen/html/html/classSVF_1_1CloneFIObjVar.html +17 -26
  84. package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar-members.html +23 -26
  85. package/SVF-doxygen/html/html/classSVF_1_1CloneGepObjVar.html +17 -26
  86. package/SVF-doxygen/html/html/classSVF_1_1CmpVFGNode.html +3 -3
  87. package/SVF-doxygen/html/html/classSVF_1_1CondPTAImpl.html +1 -1
  88. package/SVF-doxygen/html/html/classSVF_1_1ConstraintGraph.html +5 -5
  89. package/SVF-doxygen/html/html/classSVF_1_1ContextDDA.html +6 -6
  90. package/SVF-doxygen/html/html/classSVF_1_1DDAClient.html +2 -2
  91. package/SVF-doxygen/html/html/classSVF_1_1DDAPass.html +2 -2
  92. package/SVF-doxygen/html/html/classSVF_1_1DDAVFSolver.html +12 -12
  93. package/SVF-doxygen/html/html/classSVF_1_1DummyObjVar-members.html +22 -25
  94. package/SVF-doxygen/html/html/classSVF_1_1DummyObjVar.html +18 -27
  95. package/SVF-doxygen/html/html/classSVF_1_1DummyValVar-members.html +21 -24
  96. package/SVF-doxygen/html/html/classSVF_1_1DummyValVar.html +18 -27
  97. package/SVF-doxygen/html/html/classSVF_1_1FIObjVar-members.html +22 -25
  98. package/SVF-doxygen/html/html/classSVF_1_1FIObjVar.html +19 -28
  99. package/SVF-doxygen/html/html/classSVF_1_1FlowDDA.html +3 -3
  100. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitive.html +10 -10
  101. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveStat.html +8 -8
  102. package/SVF-doxygen/html/html/classSVF_1_1FlowSensitiveTBHC.html +17 -17
  103. package/SVF-doxygen/html/html/classSVF_1_1FormalParmVFGNode.html +1 -1
  104. package/SVF-doxygen/html/html/classSVF_1_1FormalRetVFGNode.html +1 -1
  105. package/SVF-doxygen/html/html/classSVF_1_1FunptrDDAClient.html +1 -1
  106. package/SVF-doxygen/html/html/classSVF_1_1GepObjVar-members.html +24 -27
  107. package/SVF-doxygen/html/html/classSVF_1_1GepObjVar.html +42 -51
  108. package/SVF-doxygen/html/html/classSVF_1_1GepStmt.html +12 -12
  109. package/SVF-doxygen/html/html/classSVF_1_1GepValVar-members.html +30 -35
  110. package/SVF-doxygen/html/html/classSVF_1_1GepValVar.html +34 -106
  111. package/SVF-doxygen/html/html/classSVF_1_1ICFGPrinter.html +1 -1
  112. package/SVF-doxygen/html/html/classSVF_1_1IRGraph.html +3 -3
  113. package/SVF-doxygen/html/html/classSVF_1_1InterPHIVFGNode.html +1 -1
  114. package/SVF-doxygen/html/html/classSVF_1_1IntraPHIVFGNode.html +2 -2
  115. package/SVF-doxygen/html/html/classSVF_1_1LeakChecker.html +1 -1
  116. package/SVF-doxygen/html/html/classSVF_1_1LocationSet-members.html +15 -16
  117. package/SVF-doxygen/html/html/classSVF_1_1LocationSet.html +47 -81
  118. package/SVF-doxygen/html/html/classSVF_1_1MRGenerator.html +12 -12
  119. package/SVF-doxygen/html/html/classSVF_1_1MemObj.html +87 -87
  120. package/SVF-doxygen/html/html/classSVF_1_1NormalGepCGEdge.html +1 -1
  121. package/SVF-doxygen/html/html/classSVF_1_1NullPtrVFGNode.html +1 -1
  122. package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo-members.html +7 -8
  123. package/SVF-doxygen/html/html/classSVF_1_1ObjTypeInfo.html +162 -211
  124. package/SVF-doxygen/html/html/classSVF_1_1ObjVar-members.html +22 -25
  125. package/SVF-doxygen/html/html/classSVF_1_1ObjVar.html +23 -32
  126. package/SVF-doxygen/html/html/classSVF_1_1OfflineConsG.html +1 -1
  127. package/SVF-doxygen/html/html/classSVF_1_1Options-members.html +55 -54
  128. package/SVF-doxygen/html/html/classSVF_1_1Options.html +47 -21
  129. package/SVF-doxygen/html/html/classSVF_1_1PAGBuilderFromFile.html +3 -3
  130. package/SVF-doxygen/html/html/classSVF_1_1PHIVFGNode.html +4 -4
  131. package/SVF-doxygen/html/html/classSVF_1_1PTAStat.html +18 -18
  132. package/SVF-doxygen/html/html/classSVF_1_1PathCondAllocator.html +1 -1
  133. package/SVF-doxygen/html/html/classSVF_1_1PointerAnalysis.html +30 -30
  134. package/SVF-doxygen/html/html/classSVF_1_1RetPN-members.html +22 -25
  135. package/SVF-doxygen/html/html/classSVF_1_1RetPN.html +18 -27
  136. package/SVF-doxygen/html/html/classSVF_1_1SVFG.html +1 -1
  137. package/SVF-doxygen/html/html/classSVF_1_1SVFIR-members.html +4 -4
  138. package/SVF-doxygen/html/html/classSVF_1_1SVFIR.html +214 -227
  139. package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder-members.html +82 -83
  140. package/SVF-doxygen/html/html/classSVF_1_1SVFIRBuilder.html +582 -529
  141. package/SVF-doxygen/html/html/classSVF_1_1SVFModule.html +1 -1
  142. package/SVF-doxygen/html/html/classSVF_1_1SVFVar-members.html +23 -26
  143. package/SVF-doxygen/html/html/classSVF_1_1SVFVar.html +54 -151
  144. package/SVF-doxygen/html/html/classSVF_1_1SaberSVFGBuilder.html +6 -6
  145. package/SVF-doxygen/html/html/classSVF_1_1SrcSnkDDA.html +1 -1
  146. package/SVF-doxygen/html/html/classSVF_1_1StInfo.html +43 -43
  147. package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder-members.html +10 -7
  148. package/SVF-doxygen/html/html/classSVF_1_1SymbolTableBuilder.html +182 -72
  149. package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo-members.html +9 -11
  150. package/SVF-doxygen/html/html/classSVF_1_1SymbolTableInfo.html +131 -162
  151. package/SVF-doxygen/html/html/classSVF_1_1ThreadCallGraph.html +5 -5
  152. package/SVF-doxygen/html/html/classSVF_1_1TypeAnalysis.html +1 -1
  153. package/SVF-doxygen/html/html/classSVF_1_1TypeBasedHeapCloning.html +26 -25
  154. package/SVF-doxygen/html/html/classSVF_1_1UnaryOPVFGNode.html +2 -2
  155. package/SVF-doxygen/html/html/classSVF_1_1VFG.html +8 -8
  156. package/SVF-doxygen/html/html/classSVF_1_1ValVar-members.html +21 -24
  157. package/SVF-doxygen/html/html/classSVF_1_1ValVar.html +16 -25
  158. package/SVF-doxygen/html/html/classSVF_1_1VarArgPN-members.html +22 -25
  159. package/SVF-doxygen/html/html/classSVF_1_1VarArgPN.html +18 -27
  160. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitive.html +7 -7
  161. package/SVF-doxygen/html/html/classSVF_1_1VersionedFlowSensitiveStat.html +5 -5
  162. package/SVF-doxygen/html/html/classSVF_1_1WPAPass.html +12 -12
  163. package/SVF-doxygen/html/html/functions_a.html +24 -24
  164. package/SVF-doxygen/html/html/functions_c.html +1 -1
  165. package/SVF-doxygen/html/html/functions_f.html +19 -22
  166. package/SVF-doxygen/html/html/functions_func.html +24 -24
  167. package/SVF-doxygen/html/html/functions_func_c.html +1 -1
  168. package/SVF-doxygen/html/html/functions_func_g.html +20 -23
  169. package/SVF-doxygen/html/html/functions_func_h.html +1 -1
  170. package/SVF-doxygen/html/html/functions_func_i.html +11 -17
  171. package/SVF-doxygen/html/html/functions_func_l.html +2 -2
  172. package/SVF-doxygen/html/html/functions_func_o.html +4 -4
  173. package/SVF-doxygen/html/html/functions_func_r.html +5 -2
  174. package/SVF-doxygen/html/html/functions_g.html +18 -21
  175. package/SVF-doxygen/html/html/functions_h.html +1 -1
  176. package/SVF-doxygen/html/html/functions_i.html +12 -21
  177. package/SVF-doxygen/html/html/functions_l.html +8 -8
  178. package/SVF-doxygen/html/html/functions_m.html +4 -1
  179. package/SVF-doxygen/html/html/functions_o.html +22 -18
  180. package/SVF-doxygen/html/html/functions_p.html +3 -3
  181. package/SVF-doxygen/html/html/functions_r.html +5 -2
  182. package/SVF-doxygen/html/html/functions_rela.html +2 -1
  183. package/SVF-doxygen/html/html/functions_s.html +6 -5
  184. package/SVF-doxygen/html/html/functions_t.html +4 -4
  185. package/SVF-doxygen/html/html/functions_v.html +3 -3
  186. package/SVF-doxygen/html/html/functions_vars_f.html +0 -3
  187. package/SVF-doxygen/html/html/functions_vars_i.html +3 -6
  188. package/SVF-doxygen/html/html/functions_vars_m.html +3 -0
  189. package/SVF-doxygen/html/html/namespaceSVF.html +1 -1
  190. package/SVF-doxygen/html/html/namespaceSVF_1_1SVFUtil.html +8 -8
  191. package/SVF-doxygen/html/html/namespacemembers_func.html +1 -1
  192. package/SVF-doxygen/html/html/namespacemembers_s.html +1 -1
  193. package/SVF-doxygen/html/html/search/all_1.js +22 -22
  194. package/SVF-doxygen/html/html/search/all_10.js +4 -4
  195. package/SVF-doxygen/html/html/search/all_12.js +5 -4
  196. package/SVF-doxygen/html/html/search/all_13.js +6 -6
  197. package/SVF-doxygen/html/html/search/all_14.js +4 -4
  198. package/SVF-doxygen/html/html/search/all_15.js +1 -1
  199. package/SVF-doxygen/html/html/search/all_16.js +1 -1
  200. package/SVF-doxygen/html/html/search/all_3.js +1 -1
  201. package/SVF-doxygen/html/html/search/all_6.js +0 -1
  202. package/SVF-doxygen/html/html/search/all_7.js +9 -9
  203. package/SVF-doxygen/html/html/search/all_8.js +1 -1
  204. package/SVF-doxygen/html/html/search/all_9.js +2 -5
  205. package/SVF-doxygen/html/html/search/all_c.js +4 -4
  206. package/SVF-doxygen/html/html/search/all_d.js +1 -0
  207. package/SVF-doxygen/html/html/search/all_e.js +3 -3
  208. package/SVF-doxygen/html/html/search/all_f.js +3 -3
  209. package/SVF-doxygen/html/html/search/functions_0.js +22 -22
  210. package/SVF-doxygen/html/html/search/functions_10.js +2 -2
  211. package/SVF-doxygen/html/html/search/functions_2.js +1 -1
  212. package/SVF-doxygen/html/html/search/functions_6.js +9 -9
  213. package/SVF-doxygen/html/html/search/functions_7.js +1 -1
  214. package/SVF-doxygen/html/html/search/functions_8.js +1 -3
  215. package/SVF-doxygen/html/html/search/functions_a.js +1 -1
  216. package/SVF-doxygen/html/html/search/functions_d.js +1 -1
  217. package/SVF-doxygen/html/html/search/functions_e.js +1 -1
  218. package/SVF-doxygen/html/html/search/functions_f.js +1 -0
  219. package/SVF-doxygen/html/html/search/related_9.js +1 -1
  220. package/SVF-doxygen/html/html/search/variables_14.js +2 -2
  221. package/SVF-doxygen/html/html/search/variables_15.js +1 -1
  222. package/SVF-doxygen/html/html/search/variables_6.js +0 -1
  223. package/SVF-doxygen/html/html/search/variables_9.js +1 -2
  224. package/SVF-doxygen/html/html/search/variables_d.js +1 -0
  225. package/SVF-doxygen/html/html/search/variables_e.js +2 -2
  226. package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01ConstraintGraph_01_5_01_4.html +1 -1
  227. package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01ICFG_01_5_01_4.html +7 -21
  228. package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01IRGraph_01_5_01_4.html +3 -3
  229. package/SVF-doxygen/html/html/structllvm_1_1DOTGraphTraits_3_01OfflineConsG_01_5_01_4.html +1 -1
  230. package/SVF-doxygen/html/html/structstd_1_1hash_3_01SVF_1_1LocationSet_01_4.html +4 -4
  231. package/SVF-doxygen/html/html/svf-ex_8cpp.html +2 -2
  232. package/SVF-doxygen/html/html/svf-ex_8cpp_source.html +2 -2
  233. package/include/MemoryModel/LocationSet.h +0 -6
  234. package/include/MemoryModel/SVFIR.h +5 -37
  235. package/include/MemoryModel/SVFStatements.h +1 -1
  236. package/include/MemoryModel/SVFVariables.h +4 -21
  237. package/include/MemoryModel/SymbolTableInfo.h +8 -24
  238. package/include/SVF-FE/LLVMUtil.h +1 -1
  239. package/include/SVF-FE/SVFIRBuilder.h +91 -108
  240. package/include/SVF-FE/SymbolTableBuilder.h +9 -2
  241. package/include/Util/Options.h +1 -0
  242. package/lib/Graphs/ICFG.cpp +1 -47
  243. package/lib/MemoryModel/LocationSet.cpp +7 -3
  244. package/lib/MemoryModel/PointerAnalysisImpl.cpp +1 -1
  245. package/lib/MemoryModel/SVFIR.cpp +61 -19
  246. package/lib/MemoryModel/SVFVariables.cpp +6 -13
  247. package/lib/MemoryModel/SymbolTableInfo.cpp +57 -68
  248. package/lib/SVF-FE/LLVMUtil.cpp +3 -3
  249. package/lib/SVF-FE/SVFIRBuilder.cpp +83 -136
  250. package/lib/SVF-FE/SymbolTableBuilder.cpp +81 -23
  251. package/lib/Util/Options.cpp +6 -0
  252. package/lib/Util/TypeBasedHeapCloning.cpp +1 -1
  253. package/lib/WPA/AndersenStat.cpp +1 -1
  254. package/package.json +1 -1
@@ -292,20 +292,7 @@ public:
292
292
  //@}
293
293
 
294
294
  /// Due to constaint expression, curInst is used to distinguish different instructions (e.g., memorycpy) when creating GepValVar.
295
- inline NodeID getGepValVar(const Value* curInst, NodeID base, const LocationSet& ls) const
296
- {
297
- GepValueVarMap::const_iterator iter = GepValObjMap.find(curInst);
298
- if(iter==GepValObjMap.end()){
299
- return UINT_MAX;
300
- }
301
- else{
302
- NodeLocationSetMap::const_iterator lit = iter->second.find(std::make_pair(base, ls));
303
- if(lit==iter->second.end())
304
- return UINT_MAX;
305
- else
306
- return lit->second;
307
- }
308
- }
295
+ NodeID getGepValVar(const Value* curInst, NodeID base, const LocationSet& ls) const;
309
296
 
310
297
  /// Add/get indirect callsites
311
298
  //@{
@@ -411,27 +398,8 @@ public:
411
398
  assert(obj && "not an object node?");
412
399
  return SymbolTableInfo::isConstantObj(id) || obj->isConstDataOrConstGlobal();
413
400
  }
414
- inline bool isNonPointerObj(NodeID id) const
415
- {
416
- SVFVar* node = getGNode(id);
417
- if (FIObjVar* fiNode = SVFUtil::dyn_cast<FIObjVar>(node))
418
- {
419
- return (fiNode->getMemObj()->hasPtrObj() == false);
420
- }
421
- else if (GepObjVar* gepNode = SVFUtil::dyn_cast<GepObjVar>(node))
422
- {
423
- return (gepNode->getMemObj()->isNonPtrFieldObj(gepNode->getLocationSet()));
424
- }
425
- else if (SVFUtil::isa<DummyObjVar>(node))
426
- {
427
- return false;
428
- }
429
- else
430
- {
431
- assert(false && "expecting a object node");
432
- return false;
433
- }
434
- }
401
+ /// Whether an object can point to any other object or any of its fields is a pointer type.
402
+ bool isNonPointerObj(NodeID id) const;
435
403
  //@}
436
404
 
437
405
  /// Base and Offset methods for Value and Object node
@@ -462,7 +430,7 @@ public:
462
430
  {
463
431
  return addDummyValNode(NodeIDAllocator::get()->allocateValueId());
464
432
  }
465
- inline NodeID addDummyObjNode(const Type* type = nullptr)
433
+ inline NodeID addDummyObjNode(const Type* type)
466
434
  {
467
435
  return addDummyObjNode(NodeIDAllocator::get()->allocateObjectId(), type);
468
436
  }
@@ -553,7 +521,7 @@ private:
553
521
  }
554
522
 
555
523
  /// Add a temp field value node, this method can only invoked by getGepValVar
556
- NodeID addGepValNode(const Value* curInst,const Value* val, const LocationSet& ls, NodeID i, const Type *type, u32_t fieldidx);
524
+ NodeID addGepValNode(const Value* curInst,const Value* val, const LocationSet& ls, NodeID i, const Type *type);
557
525
  /// Add a field obj node, this method can only invoked by getGepObjVar
558
526
  NodeID addGepObjNode(const MemObj* obj, const LocationSet& ls);
559
527
  /// Add a field-insensitive node, this method can only invoked by getFIGepObjNode
@@ -434,7 +434,6 @@ public:
434
434
 
435
435
  inline const LocationSet& getLocationSet() const
436
436
  {
437
- assert(isVariantFieldGep()==false && "Can't retrieve the LocationSet if using a variable field index (pointer arithmetic) for struct field access ");
438
437
  return ls;
439
438
  }
440
439
  inline const LocationSet::OffsetValueVec& getOffsetValueVec() const
@@ -453,6 +452,7 @@ public:
453
452
  /// Field index of the gep statement if it access the field of a struct
454
453
  inline s64_t getConstantFieldIdx() const
455
454
  {
455
+ assert(isVariantFieldGep()==false && "Can't retrieve the LocationSet if using a variable field index (pointer arithmetic) for struct field access ");
456
456
  return getLocationSet().accumulateConstantFieldIdx();
457
457
  }
458
458
  /// Gep statement with a variant field index (pointer arithmetic) for struct field access
@@ -81,8 +81,7 @@ protected:
81
81
  const Value* value; ///< value of this SVFIR node
82
82
  SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap;
83
83
  SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap;
84
- bool isTLPointer; /// top-level pointer
85
- bool isATPointer; /// address-taken pointer
84
+ bool isPtr; /// whether it is a pointer (top-level or address-taken)
86
85
 
87
86
  public:
88
87
  /// Constructor
@@ -117,17 +116,7 @@ public:
117
116
  /// Whether it is a pointer
118
117
  virtual inline bool isPointer() const
119
118
  {
120
- return isTopLevelPtr() || isAddressTakenPtr();
121
- }
122
- /// Whether it is a top-level pointer
123
- inline bool isTopLevelPtr() const
124
- {
125
- return isTLPointer;
126
- }
127
- /// Whether it is an address-taken pointer
128
- inline bool isAddressTakenPtr() const
129
- {
130
- return isATPointer;
119
+ return isPtr;
131
120
  }
132
121
  /// Whether it is constant data, i.e., "0", "1.001", "str"
133
122
  /// or llvm's metadata, i.e., metadata !4087
@@ -395,7 +384,6 @@ class GepValVar: public ValVar
395
384
  private:
396
385
  LocationSet ls; // LocationSet
397
386
  const Type *gepValType;
398
- u32_t fieldIdx;
399
387
 
400
388
  public:
401
389
  /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -419,8 +407,8 @@ public:
419
407
  //@}
420
408
 
421
409
  /// Constructor
422
- GepValVar(const Value* val, NodeID i, const LocationSet& l, const Type *ty, u32_t idx) :
423
- ValVar(val, i, GepValNode), ls(l), gepValType(ty), fieldIdx(idx)
410
+ GepValVar(const Value* val, NodeID i, const LocationSet& l, const Type *ty) :
411
+ ValVar(val, i, GepValNode), ls(l), gepValType(ty)
424
412
  {
425
413
  }
426
414
 
@@ -443,11 +431,6 @@ public:
443
431
  return gepValType;
444
432
  }
445
433
 
446
- u32_t getFieldIdx() const
447
- {
448
- return fieldIdx;
449
- }
450
-
451
434
  virtual const std::string toString() const;
452
435
  };
453
436
 
@@ -354,13 +354,9 @@ public:
354
354
 
355
355
  ///Get a reference to the components of struct_info.
356
356
  /// Number of flattenned elements of an array or struct
357
- const u32_t getNumOfFlattenElements(const Type *T);
358
- /// Number of flattenned fields of a struct
359
- const u32_t getNumOfFlattenFields(const StructType *T);
357
+ u32_t getNumOfFlattenElements(const Type *T);
360
358
  /// Flatterned element idx of an array or struct by considering stride
361
- const std::vector<u32_t>& getFlattenedElemIdxVec(const Type *T);
362
- /// Flatterned field index information of a struct ignoring any array field
363
- const std::vector<u32_t>& getFlattenedFieldIdxVec(const StructType *T);
359
+ u32_t getFlattenedElemIdx(const Type *T, s64_t origId);
364
360
 
365
361
  const std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec(const Type *T);
366
362
 
@@ -393,7 +389,7 @@ protected:
393
389
  virtual void collectSimpleTypeInfo(const Type* T);
394
390
 
395
391
  /// Create an objectInfo based on LLVM type (value is null, and type could be null, representing a dummy object)
396
- ObjTypeInfo* createObjTypeInfo(const Type *type = nullptr);
392
+ ObjTypeInfo* createObjTypeInfo(const Type *type);
397
393
 
398
394
  /// Every type T is mapped to StInfo
399
395
  /// which contains size (fsize) , offset(foffset)
@@ -596,7 +592,7 @@ public:
596
592
  */
597
593
  class ObjTypeInfo
598
594
  {
599
-
595
+ friend class SymbolTableBuilder;
600
596
  public:
601
597
  typedef enum
602
598
  {
@@ -623,30 +619,18 @@ private:
623
619
  /// maximum number of field object can be created
624
620
  /// minimum number is 0 (field insensitive analysis)
625
621
  u32_t maxOffsetLimit;
622
+
623
+ void resetTypeForHeapStaticObj(const Type* type);
626
624
  public:
627
625
 
628
626
  /// Constructors
629
- ObjTypeInfo(const Value*, const Type* t, u32_t max) :
630
- type(t), flags(0), maxOffsetLimit(max)
631
- {
632
- }
633
- /// Constructor
634
- ObjTypeInfo(u32_t max, const Type* t) : type(t), flags(0), maxOffsetLimit(max)
635
- {
627
+ ObjTypeInfo(const Type* t, u32_t max);
636
628
 
637
- }
638
629
  /// Destructor
639
630
  virtual ~ObjTypeInfo()
640
631
  {
641
-
642
632
  }
643
-
644
- /// Analyse types of heap and static objects
645
- void analyzeHeapObjType(const Type* type);
646
-
647
- /// Analyse types of heap and static objects
648
- void analyzeStaticObjType(const Type* type);
649
-
633
+
650
634
  /// Get LLVM type
651
635
  inline const Type* getType() const
652
636
  {
@@ -510,7 +510,7 @@ inline const BasicBlock* getFunExitBB(const Function* fun)
510
510
  const Value * stripConstantCasts(const Value *val);
511
511
 
512
512
  /// Strip off the all casts
513
- Value *stripAllCasts(Value *val) ;
513
+ const Value *stripAllCasts(const Value *val) ;
514
514
 
515
515
  /// Get the type of the heap allocation
516
516
  const Type *getTypeOfHeapAlloc(const llvm::Instruction *inst) ;
@@ -109,44 +109,9 @@ public:
109
109
  return pag->getVarargNode(func);
110
110
  }
111
111
  //@}
112
-
113
- /// Handle globals including (global variable and functions)
114
- //@{
115
- void visitGlobal(SVFModule* svfModule);
116
- void InitialGlobal(const GlobalVariable *gvar, Constant *C,
117
- u32_t offset);
118
- NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset);
119
- //@}
120
-
121
- /// Process constant expression
122
- void processCE(const Value *val);
123
-
124
- /// Infer field index from byteoffset.
125
- u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s64_t idx);
126
-
127
- /// Compute offset of a gep instruction or gep constant expression
128
- bool computeGepOffset(const User *V, LocationSet& ls);
129
-
130
- /// Get the base type and max offset
131
- const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields);
132
-
133
- /// Replace fields with flatten fields of T if the number of its fields is larger than msz.
134
- u32_t getFields(std::vector<LocationSet>& fields, const Type* T, u32_t msz);
135
-
136
- /// Handle direct call
137
- void handleDirectCall(CallSite cs, const SVFFunction *F);
138
-
139
- /// Handle indirect call
140
- void handleIndCall(CallSite cs);
141
-
142
112
  /// Update SVFIR given a call graph (creating new CallPE and RetPE for resolved indirect calls)
143
113
  void updateCallGraph(PTACallGraph* callgraph);
144
114
 
145
- /// Handle external call
146
- //@{
147
- virtual void handleExtCall(CallSite cs, const SVFFunction *F);
148
- void addComplexConsForExt(Value *D, Value *S,u32_t sz = 0);
149
- //@}
150
115
 
151
116
  /// Our visit overrides.
152
117
  //@{
@@ -241,6 +206,39 @@ public:
241
206
  }
242
207
  //}@
243
208
 
209
+ protected:
210
+ /// Handle globals including (global variable and functions)
211
+ //@{
212
+ void visitGlobal(SVFModule* svfModule);
213
+ void InitialGlobal(const GlobalVariable *gvar, Constant *C,
214
+ u32_t offset);
215
+ NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset);
216
+ //@}
217
+
218
+ /// Process constant expression
219
+ void processCE(const Value *val);
220
+
221
+ /// Infer field index from byteoffset.
222
+ u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s64_t idx);
223
+
224
+ /// Compute offset of a gep instruction or gep constant expression
225
+ bool computeGepOffset(const User *V, LocationSet& ls);
226
+
227
+ /// Get the base type and max offset
228
+ const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields, const Value* sz);
229
+
230
+ /// Handle direct call
231
+ void handleDirectCall(CallSite cs, const SVFFunction *F);
232
+
233
+ /// Handle indirect call
234
+ void handleIndCall(CallSite cs);
235
+
236
+ /// Handle external call
237
+ //@{
238
+ virtual void handleExtCall(CallSite cs, const SVFFunction *F);
239
+ void addComplexConsForExt(Value *D, Value *S, const Value* sz);
240
+ //@}
241
+
244
242
  /// Set current basic block in order to keep track of control flow information
245
243
  inline void setCurrentLocation(const Value* val, const BasicBlock* bb)
246
244
  {
@@ -278,143 +276,128 @@ public:
278
276
  return nullPtr;
279
277
  }
280
278
 
281
- public:
282
-
283
- NodeID getGepValVar(const Value* val, const LocationSet& ls, const Type *baseType, u32_t fieldidx);
279
+ NodeID getGepValVar(const Value* val, const LocationSet& ls, const Type *baseType);
284
280
 
285
281
  void setCurrentBBAndValueForPAGEdge(PAGEdge* edge);
286
282
 
287
- inline PAGEdge* addBlackHoleAddrEdge(NodeID node)
283
+ inline void addBlackHoleAddrEdge(NodeID node)
288
284
  {
289
- PAGEdge *edge = pag->addBlackHoleAddrStmt(node);
290
- setCurrentBBAndValueForPAGEdge(edge);
291
- return edge;
285
+ if(PAGEdge *edge = pag->addBlackHoleAddrStmt(node))
286
+ setCurrentBBAndValueForPAGEdge(edge);
292
287
  }
293
288
 
294
289
  /// Add Address edge
295
290
  inline AddrStmt* addAddrEdge(NodeID src, NodeID dst)
296
291
  {
297
- AddrStmt *edge = pag->addAddrStmt(src, dst);
298
- setCurrentBBAndValueForPAGEdge(edge);
299
- return edge;
292
+ if(AddrStmt *edge = pag->addAddrStmt(src, dst)){
293
+ setCurrentBBAndValueForPAGEdge(edge);
294
+ return edge;
295
+ }
296
+ return nullptr;
300
297
  }
301
298
  /// Add Copy edge
302
299
  inline CopyStmt* addCopyEdge(NodeID src, NodeID dst)
303
300
  {
304
- CopyStmt *edge = pag->addCopyStmt(src, dst);
305
- setCurrentBBAndValueForPAGEdge(edge);
306
- return edge;
301
+ if(CopyStmt *edge = pag->addCopyStmt(src, dst)){
302
+ setCurrentBBAndValueForPAGEdge(edge);
303
+ return edge;
304
+ }
305
+ return nullptr;
307
306
  }
308
307
  /// Add Copy edge
309
- inline PhiStmt* addPhiStmt(NodeID res, NodeID opnd, const ICFGNode* pred)
308
+ inline void addPhiStmt(NodeID res, NodeID opnd, const ICFGNode* pred)
310
309
  {
311
- PhiStmt *edge = pag->addPhiStmt(res,opnd,pred);
312
310
  /// If we already added this phi node, then skip this adding
313
- if(edge)
311
+ if(PhiStmt *edge = pag->addPhiStmt(res,opnd,pred))
314
312
  setCurrentBBAndValueForPAGEdge(edge);
315
- return edge;
316
313
  }
317
314
  /// Add SelectStmt
318
- inline SelectStmt* addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond)
315
+ inline void addSelectStmt(NodeID res, NodeID op1, NodeID op2, NodeID cond)
319
316
  {
320
- SelectStmt *edge = pag->addSelectStmt(res,op1,op2,cond);
321
- setCurrentBBAndValueForPAGEdge(edge);
322
- return edge;
317
+ if(SelectStmt *edge = pag->addSelectStmt(res,op1,op2,cond))
318
+ setCurrentBBAndValueForPAGEdge(edge);
323
319
  }
324
320
  /// Add Copy edge
325
- inline CmpStmt* addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t predict)
321
+ inline void addCmpEdge(NodeID op1, NodeID op2, NodeID dst, u32_t predict)
326
322
  {
327
- CmpStmt *edge = pag->addCmpStmt(op1, op2, dst, predict);
328
- setCurrentBBAndValueForPAGEdge(edge);
329
- return edge;
323
+ if(CmpStmt *edge = pag->addCmpStmt(op1, op2, dst, predict))
324
+ setCurrentBBAndValueForPAGEdge(edge);
330
325
  }
331
326
  /// Add Copy edge
332
- inline BinaryOPStmt* addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
327
+ inline void addBinaryOPEdge(NodeID op1, NodeID op2, NodeID dst, u32_t opcode)
333
328
  {
334
- BinaryOPStmt *edge = pag->addBinaryOPStmt(op1, op2, dst, opcode);
335
- setCurrentBBAndValueForPAGEdge(edge);
336
- return edge;
329
+ if(BinaryOPStmt *edge = pag->addBinaryOPStmt(op1, op2, dst, opcode))
330
+ setCurrentBBAndValueForPAGEdge(edge);
337
331
  }
338
332
  /// Add Unary edge
339
- inline UnaryOPStmt* addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
333
+ inline void addUnaryOPEdge(NodeID src, NodeID dst, u32_t opcode)
340
334
  {
341
- UnaryOPStmt *edge = pag->addUnaryOPStmt(src, dst, opcode);
342
- setCurrentBBAndValueForPAGEdge(edge);
343
- return edge;
335
+ if(UnaryOPStmt *edge = pag->addUnaryOPStmt(src, dst, opcode))
336
+ setCurrentBBAndValueForPAGEdge(edge);
344
337
  }
345
338
  /// Add Branch statement
346
- inline BranchStmt* addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccAndCondPairVec& succs){
347
- BranchStmt *edge = pag->addBranchStmt(br, cond, succs);
348
- setCurrentBBAndValueForPAGEdge(edge);
349
- return edge;
339
+ inline void addBranchStmt(NodeID br, NodeID cond, const BranchStmt::SuccAndCondPairVec& succs){
340
+ if(BranchStmt *edge = pag->addBranchStmt(br, cond, succs))
341
+ setCurrentBBAndValueForPAGEdge(edge);
350
342
  }
351
343
  /// Add Load edge
352
- inline LoadStmt* addLoadEdge(NodeID src, NodeID dst)
344
+ inline void addLoadEdge(NodeID src, NodeID dst)
353
345
  {
354
- LoadStmt *edge = pag->addLoadStmt(src, dst);
355
- setCurrentBBAndValueForPAGEdge(edge);
356
- return edge;
346
+ if(LoadStmt *edge = pag->addLoadStmt(src, dst))
347
+ setCurrentBBAndValueForPAGEdge(edge);
357
348
  }
358
349
  /// Add Store edge
359
- inline StoreStmt* addStoreEdge(NodeID src, NodeID dst)
350
+ inline void addStoreEdge(NodeID src, NodeID dst)
360
351
  {
361
352
  IntraICFGNode* node;
362
353
  if(const Instruction* inst = SVFUtil::dyn_cast<Instruction>(curVal))
363
354
  node = pag->getICFG()->getIntraICFGNode(inst);
364
355
  else
365
356
  node = nullptr;
366
- StoreStmt *edge = pag->addStoreStmt(src, dst, node);
367
- setCurrentBBAndValueForPAGEdge(edge);
368
- return edge;
357
+ if(StoreStmt *edge = pag->addStoreStmt(src, dst, node))
358
+ setCurrentBBAndValueForPAGEdge(edge);
369
359
  }
370
360
  /// Add Call edge
371
- inline CallPE* addCallEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunEntryICFGNode* entry)
361
+ inline void addCallEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunEntryICFGNode* entry)
372
362
  {
373
- CallPE *edge = pag->addCallPE(src, dst, cs, entry);
374
- setCurrentBBAndValueForPAGEdge(edge);
375
- return edge;
363
+ if(CallPE *edge = pag->addCallPE(src, dst, cs, entry))
364
+ setCurrentBBAndValueForPAGEdge(edge);
376
365
  }
377
366
  /// Add Return edge
378
- inline RetPE* addRetEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunExitICFGNode* exit)
367
+ inline void addRetEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunExitICFGNode* exit)
379
368
  {
380
- RetPE *edge = pag->addRetPE(src, dst, cs, exit);
381
- setCurrentBBAndValueForPAGEdge(edge);
382
- return edge;
369
+ if(RetPE *edge = pag->addRetPE(src, dst, cs, exit))
370
+ setCurrentBBAndValueForPAGEdge(edge);
383
371
  }
384
372
  /// Add Gep edge
385
- inline GepStmt* addGepEdge(NodeID src, NodeID dst, const LocationSet& ls, bool constGep)
373
+ inline void addGepEdge(NodeID src, NodeID dst, const LocationSet& ls, bool constGep)
386
374
  {
387
- GepStmt *edge = pag->addGepStmt(src, dst, ls, constGep);
388
- setCurrentBBAndValueForPAGEdge(edge);
389
- return edge;
375
+ if(GepStmt *edge = pag->addGepStmt(src, dst, ls, constGep))
376
+ setCurrentBBAndValueForPAGEdge(edge);
390
377
  }
391
378
  /// Add Offset(Gep) edge
392
- inline GepStmt* addNormalGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
379
+ inline void addNormalGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
393
380
  {
394
- GepStmt *edge = pag->addNormalGepStmt(src, dst, ls);
395
- setCurrentBBAndValueForPAGEdge(edge);
396
- return edge;
381
+ if(GepStmt *edge = pag->addNormalGepStmt(src, dst, ls))
382
+ setCurrentBBAndValueForPAGEdge(edge);
397
383
  }
398
384
  /// Add Variant(Gep) edge
399
- inline GepStmt* addVariantGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
385
+ inline void addVariantGepEdge(NodeID src, NodeID dst, const LocationSet& ls)
400
386
  {
401
- GepStmt *edge = pag->addVariantGepStmt(src, dst, ls);
402
- setCurrentBBAndValueForPAGEdge(edge);
403
- return edge;
387
+ if(GepStmt *edge = pag->addVariantGepStmt(src, dst, ls))
388
+ setCurrentBBAndValueForPAGEdge(edge);
404
389
  }
405
390
  /// Add Thread fork edge for parameter passing
406
- inline TDForkPE* addThreadForkEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunEntryICFGNode* entry)
391
+ inline void addThreadForkEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunEntryICFGNode* entry)
407
392
  {
408
- TDForkPE *edge = pag->addThreadForkPE(src, dst, cs, entry);
409
- setCurrentBBAndValueForPAGEdge(edge);
410
- return edge;
393
+ if(TDForkPE *edge = pag->addThreadForkPE(src, dst, cs, entry))
394
+ setCurrentBBAndValueForPAGEdge(edge);
411
395
  }
412
396
  /// Add Thread join edge for parameter passing
413
- inline TDJoinPE* addThreadJoinEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunExitICFGNode* exit)
397
+ inline void addThreadJoinEdge(NodeID src, NodeID dst, const CallICFGNode* cs, const FunExitICFGNode* exit)
414
398
  {
415
- TDJoinPE *edge = pag->addThreadJoinPE(src, dst, cs, exit);
416
- setCurrentBBAndValueForPAGEdge(edge);
417
- return edge;
399
+ if(TDJoinPE *edge = pag->addThreadJoinPE(src, dst, cs, exit))
400
+ setCurrentBBAndValueForPAGEdge(edge);
418
401
  }
419
402
  //@}
420
403
 
@@ -69,7 +69,7 @@ public:
69
69
  /// Handle constant expression
70
70
  // @{
71
71
  void handleGlobalCE(const GlobalVariable *G);
72
- void handleGlobalInitializerCE(const Constant *C, u32_t offset);
72
+ void handleGlobalInitializerCE(const Constant *C);
73
73
  void handleCE(const Value *val);
74
74
  // @}
75
75
 
@@ -79,7 +79,14 @@ public:
79
79
  /// Initialize TypeInfo based on LLVM Value
80
80
  void initTypeInfo(ObjTypeInfo* typeinfo, const Value* value);
81
81
  /// Analyse types of all flattened fields of this object
82
- void analyzeGlobalStackObjType(ObjTypeInfo* typeinfo, const Value* val);
82
+ void analyzeObjType(ObjTypeInfo* typeinfo, const Value* val);
83
+ /// Analyse types of heap and static objects
84
+ void analyzeHeapObjType(ObjTypeInfo* typeinfo, const Value* val);
85
+ /// Analyse types of heap and static objects
86
+ void analyzeStaticObjType(ObjTypeInfo* typeinfo, const Value* val);
87
+ /// Return the bitcast instruction which is val's only use site, otherwise return nullptr
88
+ const Value* getUniqueUseViaCastInst(const Value* val);
89
+
83
90
  /// Return size of this object based on LLVM value
84
91
  u32_t getObjSize(const Value* val);
85
92
  };
@@ -211,6 +211,7 @@ public:
211
211
  // SymbolTableInfo.cpp
212
212
  static const llvm::cl::opt<bool> LocMemModel;
213
213
  static const llvm::cl::opt<bool> ModelConsts;
214
+ static const llvm::cl::opt<bool> ModelArrays;
214
215
  static const llvm::cl::opt<bool> SymTabPrint;
215
216
 
216
217
  // Conditions.cpp
@@ -502,53 +502,7 @@ struct DOTGraphTraits<ICFG*> : public DOTGraphTraits<SVFIR*>
502
502
  /// Return the label of an ICFG node
503
503
  static std::string getSimpleNodeLabel(NodeType *node, ICFG*)
504
504
  {
505
- std::string str;
506
- raw_string_ostream rawstr(str);
507
- rawstr << "NodeID: " << node->getId() << "\n";
508
- if (IntraICFGNode* bNode = SVFUtil::dyn_cast<IntraICFGNode>(node))
509
- {
510
- rawstr << "IntraICFGNode ID: " << bNode->getId() << " \t";
511
- SVFIR::SVFStmtList& edges = SVFIR::getPAG()->getSVFStmtList(bNode);
512
- if (edges.empty()) {
513
- rawstr << value2String(bNode->getInst()) << " \t";
514
- } else {
515
- for (SVFIR::SVFStmtList::iterator it = edges.begin(), eit = edges.end(); it != eit; ++it)
516
- {
517
- const PAGEdge* edge = *it;
518
- rawstr << edge->toString();
519
- }
520
- }
521
- rawstr << " {fun: " << bNode->getFun()->getName() << "}";
522
- }
523
- else if (FunEntryICFGNode* entry = SVFUtil::dyn_cast<FunEntryICFGNode>(node))
524
- {
525
- rawstr << entry->toString();
526
- }
527
- else if (FunExitICFGNode* exit = SVFUtil::dyn_cast<FunExitICFGNode>(node))
528
- {
529
- rawstr << exit->toString();
530
- }
531
- else if (CallICFGNode* call = SVFUtil::dyn_cast<CallICFGNode>(node))
532
- {
533
- rawstr << call->toString();
534
- }
535
- else if (RetICFGNode* ret = SVFUtil::dyn_cast<RetICFGNode>(node))
536
- {
537
- rawstr << ret->toString();
538
- }
539
- else if (GlobalICFGNode* glob = SVFUtil::dyn_cast<GlobalICFGNode>(node) )
540
- {
541
- SVFIR::SVFStmtList& edges = SVFIR::getPAG()->getSVFStmtList(glob);
542
- for (SVFIR::SVFStmtList::iterator it = edges.begin(), eit = edges.end(); it != eit; ++it)
543
- {
544
- const PAGEdge* edge = *it;
545
- rawstr << edge->toString();
546
- }
547
- }
548
- else
549
- assert(false && "what else kinds of nodes do we have??");
550
-
551
- return rawstr.str();
505
+ return node->toString();
552
506
  }
553
507
 
554
508
  static std::string getNodeAttributes(NodeType *node, ICFG*)
@@ -118,13 +118,17 @@ s64_t LocationSet::accumulateConstantOffset() const{
118
118
  const Type* type = offsetValues[i].second;
119
119
  const ConstantInt *op = SVFUtil::dyn_cast<ConstantInt>(value);
120
120
  assert(op && "not a constant offset?");
121
+ if(type==nullptr){
122
+ totalConstOffset += op->getSExtValue();
123
+ continue;
124
+ }
125
+
121
126
  if(const PointerType* pty = SVFUtil::dyn_cast<PointerType>(type))
122
127
  totalConstOffset += op->getSExtValue() * getElementNum(pty->getElementType());
123
128
  else{
124
129
  s64_t offset = op->getSExtValue();
125
- const std::vector<u32_t>& so = SymbolTableInfo::SymbolInfo()->getFlattenedElemIdxVec(type);
126
- assert((u32_t)offset <= so.size() && "out of bounds or offset is a negative value?");
127
- totalConstOffset += so[op->getSExtValue()];
130
+ u32_t flattenOffset = SymbolTableInfo::SymbolInfo()->getFlattenedElemIdx(type, offset);
131
+ totalConstOffset += flattenOffset;
128
132
  }
129
133
  }
130
134
  return totalConstOffset;
@@ -265,7 +265,7 @@ bool BVDataPTAImpl::readFromFile(const string& filename)
265
265
  size_t offset;
266
266
  ss >> id >> base >> offset;
267
267
 
268
- NodeID n = pag->getGepObjVar(pag->getObject(base), LocationSet(offset));
268
+ NodeID n = pag->getGepObjVar(base, LocationSet(offset));
269
269
  assert(id == n && "Error adding GepObjNode into SVFIR!");
270
270
 
271
271
  getline(F, line);