svf-lib 1.0.2319 → 1.0.2321

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (320) hide show
  1. package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/WorkList.h +0 -0
  2. package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/Modules/FindZ3.cmake +93 -0
  3. package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/SVFConfig.cmake +106 -0
  4. package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/SVFConfigVersion.cmake +43 -0
  5. package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/SVFTargets-release.cmake +101 -0
  6. package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/SVFTargets.cmake +180 -0
  7. package/SVF-linux-aarch64/Release-build/lib/libSvfCore.so.3.1 +0 -0
  8. package/SVF-linux-aarch64/Release-build/lib/libSvfLLVM.so.3.1 +0 -0
  9. package/SVF-linux-aarch64/Release-build/lib/pkgconfig/SVF.pc +12 -0
  10. package/SVF-osx/Release-build/bin/ae +0 -0
  11. package/SVF-osx/Release-build/bin/cfl +0 -0
  12. package/SVF-osx/Release-build/bin/dvf +0 -0
  13. package/SVF-osx/Release-build/bin/llvm2svf +0 -0
  14. package/SVF-osx/Release-build/bin/mta +0 -0
  15. package/SVF-osx/Release-build/bin/saber +0 -0
  16. package/SVF-osx/Release-build/bin/svf-ex +0 -0
  17. package/SVF-osx/Release-build/bin/wpa +0 -0
  18. package/SVF-osx/Release-build/include/SVF/AE/Core/AbstractState.h +425 -0
  19. package/SVF-osx/Release-build/include/SVF/AE/Core/AbstractValue.h +157 -0
  20. package/SVF-osx/Release-build/include/SVF/AE/Core/AddressValue.h +225 -0
  21. package/SVF-osx/Release-build/include/SVF/AE/Core/ICFGWTO.h +135 -0
  22. package/SVF-osx/Release-build/include/SVF/AE/Core/IntervalValue.h +1055 -0
  23. package/SVF-osx/Release-build/include/SVF/AE/Core/NumericValue.h +1292 -0
  24. package/SVF-osx/Release-build/include/SVF/AE/Core/RelExeState.h +226 -0
  25. package/SVF-osx/Release-build/include/SVF/AE/Core/RelationSolver.h +91 -0
  26. package/SVF-osx/Release-build/include/SVF/AE/Svfexe/AEDetector.h +439 -0
  27. package/SVF-osx/Release-build/include/SVF/AE/Svfexe/AbsExtAPI.h +138 -0
  28. package/SVF-osx/Release-build/include/SVF/AE/Svfexe/AbstractInterpretation.h +384 -0
  29. package/SVF-osx/Release-build/include/SVF/CFL/CFGNormalizer.h +84 -0
  30. package/SVF-osx/Release-build/include/SVF/CFL/CFGrammar.h +468 -0
  31. package/SVF-osx/Release-build/include/SVF/CFL/CFLAlias.h +168 -0
  32. package/SVF-osx/Release-build/include/SVF/CFL/CFLBase.h +118 -0
  33. package/SVF-osx/Release-build/include/SVF/CFL/CFLGramGraphChecker.h +74 -0
  34. package/SVF-osx/Release-build/include/SVF/CFL/CFLGraphBuilder.h +168 -0
  35. package/SVF-osx/Release-build/include/SVF/CFL/CFLSVFGBuilder.h +58 -0
  36. package/SVF-osx/Release-build/include/SVF/CFL/CFLSolver.h +374 -0
  37. package/SVF-osx/Release-build/include/SVF/CFL/CFLStat.h +67 -0
  38. package/SVF-osx/Release-build/include/SVF/CFL/CFLVF.h +68 -0
  39. package/SVF-osx/Release-build/include/SVF/CFL/GrammarBuilder.h +100 -0
  40. package/SVF-osx/Release-build/include/SVF/DDA/ContextDDA.h +230 -0
  41. package/SVF-osx/Release-build/include/SVF/DDA/DDAClient.h +163 -0
  42. package/SVF-osx/Release-build/include/SVF/DDA/DDAPass.h +102 -0
  43. package/SVF-osx/Release-build/include/SVF/DDA/DDAStat.h +121 -0
  44. package/SVF-osx/Release-build/include/SVF/DDA/DDAVFSolver.h +794 -0
  45. package/SVF-osx/Release-build/include/SVF/DDA/FlowDDA.h +178 -0
  46. package/SVF-osx/Release-build/include/SVF/FastCluster/fastcluster.h +80 -0
  47. package/SVF-osx/Release-build/include/SVF/Graphs/BasicBlockG.h +318 -0
  48. package/SVF-osx/Release-build/include/SVF/Graphs/CDG.h +482 -0
  49. package/SVF-osx/Release-build/include/SVF/Graphs/CFLGraph.h +232 -0
  50. package/SVF-osx/Release-build/include/SVF/Graphs/CHG.h +368 -0
  51. package/SVF-osx/Release-build/include/SVF/Graphs/CallGraph.h +497 -0
  52. package/SVF-osx/Release-build/include/SVF/Graphs/ConsG.h +402 -0
  53. package/SVF-osx/Release-build/include/SVF/Graphs/ConsGEdge.h +355 -0
  54. package/SVF-osx/Release-build/include/SVF/Graphs/ConsGNode.h +418 -0
  55. package/SVF-osx/Release-build/include/SVF/Graphs/DOTGraphTraits.h +188 -0
  56. package/SVF-osx/Release-build/include/SVF/Graphs/GenericGraph.h +628 -0
  57. package/SVF-osx/Release-build/include/SVF/Graphs/GraphPrinter.h +111 -0
  58. package/SVF-osx/Release-build/include/SVF/Graphs/GraphTraits.h +150 -0
  59. package/SVF-osx/Release-build/include/SVF/Graphs/GraphWriter.h +380 -0
  60. package/SVF-osx/Release-build/include/SVF/Graphs/ICFG.h +331 -0
  61. package/SVF-osx/Release-build/include/SVF/Graphs/ICFGEdge.h +281 -0
  62. package/SVF-osx/Release-build/include/SVF/Graphs/ICFGNode.h +669 -0
  63. package/SVF-osx/Release-build/include/SVF/Graphs/ICFGStat.h +164 -0
  64. package/SVF-osx/Release-build/include/SVF/Graphs/IRGraph.h +398 -0
  65. package/SVF-osx/Release-build/include/SVF/Graphs/SCC.h +375 -0
  66. package/SVF-osx/Release-build/include/SVF/Graphs/SVFG.h +491 -0
  67. package/SVF-osx/Release-build/include/SVF/Graphs/SVFGEdge.h +237 -0
  68. package/SVF-osx/Release-build/include/SVF/Graphs/SVFGNode.h +501 -0
  69. package/SVF-osx/Release-build/include/SVF/Graphs/SVFGOPT.h +372 -0
  70. package/SVF-osx/Release-build/include/SVF/Graphs/SVFGStat.h +273 -0
  71. package/SVF-osx/Release-build/include/SVF/Graphs/ThreadCallGraph.h +399 -0
  72. package/SVF-osx/Release-build/include/SVF/Graphs/VFG.h +726 -0
  73. package/SVF-osx/Release-build/include/SVF/Graphs/VFGEdge.h +295 -0
  74. package/SVF-osx/Release-build/include/SVF/Graphs/VFGNode.h +1266 -0
  75. package/SVF-osx/Release-build/include/SVF/Graphs/WTO.h +872 -0
  76. package/SVF-osx/Release-build/include/SVF/MSSA/MSSAMuChi.h +722 -0
  77. package/SVF-osx/Release-build/include/SVF/MSSA/MemPartition.h +169 -0
  78. package/SVF-osx/Release-build/include/SVF/MSSA/MemRegion.h +489 -0
  79. package/SVF-osx/Release-build/include/SVF/MSSA/MemSSA.h +452 -0
  80. package/SVF-osx/Release-build/include/SVF/MSSA/SVFGBuilder.h +104 -0
  81. package/SVF-osx/Release-build/include/SVF/MTA/LockAnalysis.h +533 -0
  82. package/SVF-osx/Release-build/include/SVF/MTA/MHP.h +546 -0
  83. package/SVF-osx/Release-build/include/SVF/MTA/MTA.h +97 -0
  84. package/SVF-osx/Release-build/include/SVF/MTA/MTAStat.h +73 -0
  85. package/SVF-osx/Release-build/include/SVF/MTA/TCT.h +620 -0
  86. package/SVF-osx/Release-build/include/SVF/MemoryModel/AbstractPointsToDS.h +316 -0
  87. package/SVF-osx/Release-build/include/SVF/MemoryModel/AccessPath.h +194 -0
  88. package/SVF-osx/Release-build/include/SVF/MemoryModel/ConditionalPT.h +878 -0
  89. package/SVF-osx/Release-build/include/SVF/MemoryModel/MutablePointsToDS.h +1025 -0
  90. package/SVF-osx/Release-build/include/SVF/MemoryModel/PersistentPointsToCache.h +463 -0
  91. package/SVF-osx/Release-build/include/SVF/MemoryModel/PersistentPointsToDS.h +955 -0
  92. package/SVF-osx/Release-build/include/SVF/MemoryModel/PointerAnalysis.h +428 -0
  93. package/SVF-osx/Release-build/include/SVF/MemoryModel/PointerAnalysisImpl.h +602 -0
  94. package/SVF-osx/Release-build/include/SVF/MemoryModel/PointsTo.h +255 -0
  95. package/SVF-osx/Release-build/include/SVF/MemoryModel/SVFLoop.h +167 -0
  96. package/SVF-osx/Release-build/include/SVF/SABER/DoubleFreeChecker.h +76 -0
  97. package/SVF-osx/Release-build/include/SVF/SABER/FileChecker.h +80 -0
  98. package/SVF-osx/Release-build/include/SVF/SABER/LeakChecker.h +122 -0
  99. package/SVF-osx/Release-build/include/SVF/SABER/ProgSlice.h +327 -0
  100. package/SVF-osx/Release-build/include/SVF/SABER/SaberCheckerAPI.h +151 -0
  101. package/SVF-osx/Release-build/include/SVF/SABER/SaberCondAllocator.h +317 -0
  102. package/SVF-osx/Release-build/include/SVF/SABER/SaberSVFGBuilder.h +114 -0
  103. package/SVF-osx/Release-build/include/SVF/SABER/SrcSnkDDA.h +327 -0
  104. package/SVF-osx/Release-build/include/SVF/SABER/SrcSnkSolver.h +186 -0
  105. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/BasicTypes.h +280 -0
  106. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/BreakConstantExpr.h +93 -0
  107. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/CHGBuilder.h +78 -0
  108. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/CppUtil.h +184 -0
  109. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/DCHG.h +474 -0
  110. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/GEPTypeBridgeIterator.h +183 -0
  111. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/ICFGBuilder.h +160 -0
  112. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/LLVMLoopAnalysis.h +60 -0
  113. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/LLVMModule.h +527 -0
  114. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/LLVMUtil.h +433 -0
  115. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/ObjTypeInference.h +129 -0
  116. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/SVFIRBuilder.h +523 -0
  117. package/SVF-osx/Release-build/include/SVF/SVF-LLVM/SymbolTableBuilder.h +132 -0
  118. package/SVF-osx/Release-build/include/SVF/SVFIR/ObjTypeInfo.h +224 -0
  119. package/SVF-osx/Release-build/include/SVF/SVFIR/PAGBuilderFromFile.h +80 -0
  120. package/SVF-osx/Release-build/include/SVF/SVFIR/SVFIR.h +856 -0
  121. package/SVF-osx/Release-build/include/SVF/SVFIR/SVFStatements.h +1330 -0
  122. package/SVF-osx/Release-build/include/SVF/SVFIR/SVFType.h +606 -0
  123. package/SVF-osx/Release-build/include/SVF/SVFIR/SVFValue.h +338 -0
  124. package/SVF-osx/Release-build/include/SVF/SVFIR/SVFVariables.h +2212 -0
  125. package/SVF-osx/Release-build/include/SVF/Util/Annotator.h +180 -0
  126. package/SVF-osx/Release-build/include/SVF/Util/BitVector.h +55 -0
  127. package/SVF-osx/Release-build/include/SVF/Util/CDGBuilder.h +107 -0
  128. package/SVF-osx/Release-build/include/SVF/Util/CallGraphBuilder.h +61 -0
  129. package/SVF-osx/Release-build/include/SVF/Util/Casting.h +426 -0
  130. package/SVF-osx/Release-build/include/SVF/Util/CommandLine.h +530 -0
  131. package/SVF-osx/Release-build/include/SVF/Util/CoreBitVector.h +214 -0
  132. package/SVF-osx/Release-build/include/SVF/Util/CxtStmt.h +502 -0
  133. package/SVF-osx/Release-build/include/SVF/Util/DPItem.h +618 -0
  134. package/SVF-osx/Release-build/include/SVF/Util/ExtAPI.h +117 -0
  135. package/SVF-osx/Release-build/include/SVF/Util/GeneralType.h +127 -0
  136. package/SVF-osx/Release-build/include/SVF/Util/GraphReachSolver.h +186 -0
  137. package/SVF-osx/Release-build/include/SVF/Util/NodeIDAllocator.h +203 -0
  138. package/SVF-osx/Release-build/include/SVF/Util/Options.h +273 -0
  139. package/SVF-osx/Release-build/include/SVF/Util/PTAStat.h +83 -0
  140. package/SVF-osx/Release-build/include/SVF/Util/SVFBugReport.h +427 -0
  141. package/SVF-osx/Release-build/include/SVF/Util/SVFLoopAndDomInfo.h +169 -0
  142. package/SVF-osx/Release-build/include/SVF/Util/SVFStat.h +103 -0
  143. package/SVF-osx/Release-build/include/SVF/Util/SVFUtil.h +478 -0
  144. package/SVF-osx/Release-build/include/SVF/Util/SparseBitVector.h +1252 -0
  145. package/SVF-osx/Release-build/include/SVF/Util/ThreadAPI.h +188 -0
  146. package/SVF-osx/Release-build/include/SVF/Util/WorkList.h +317 -0
  147. package/SVF-osx/Release-build/include/SVF/Util/Z3Expr.h +325 -0
  148. package/SVF-osx/Release-build/include/SVF/Util/cJSON.h +300 -0
  149. package/SVF-osx/Release-build/include/SVF/Util/config.h +46 -0
  150. package/SVF-osx/Release-build/include/SVF/Util/iterator.h +407 -0
  151. package/SVF-osx/Release-build/include/SVF/Util/iterator_range.h +76 -0
  152. package/SVF-osx/Release-build/include/SVF/WPA/Andersen.h +434 -0
  153. package/SVF-osx/Release-build/include/SVF/WPA/AndersenPWC.h +160 -0
  154. package/SVF-osx/Release-build/include/SVF/WPA/CSC.h +95 -0
  155. package/SVF-osx/Release-build/include/SVF/WPA/FlowSensitive.h +322 -0
  156. package/SVF-osx/Release-build/include/SVF/WPA/Steensgaard.h +131 -0
  157. package/SVF-osx/Release-build/include/SVF/WPA/TypeAnalysis.h +90 -0
  158. package/SVF-osx/Release-build/include/SVF/WPA/VersionedFlowSensitive.h +295 -0
  159. package/SVF-osx/Release-build/include/SVF/WPA/WPAFSSolver.h +246 -0
  160. package/SVF-osx/Release-build/include/SVF/WPA/WPAPass.h +115 -0
  161. package/SVF-osx/Release-build/include/SVF/WPA/WPASolver.h +205 -0
  162. package/SVF-osx/Release-build/include/SVF/WPA/WPAStat.h +222 -0
  163. package/SVF-osx/Release-build/include/SVF/extapi.bc +2384 -0
  164. package/SVF-osx/Release-build/lib/cmake/SVF/Modules/FindZ3.cmake +93 -0
  165. package/SVF-osx/Release-build/lib/cmake/SVF/SVFConfig.cmake +106 -0
  166. package/SVF-osx/Release-build/lib/cmake/SVF/SVFConfigVersion.cmake +43 -0
  167. package/SVF-osx/Release-build/lib/cmake/SVF/SVFTargets-release.cmake +101 -0
  168. package/SVF-osx/Release-build/lib/cmake/SVF/SVFTargets.cmake +180 -0
  169. package/SVF-osx/Release-build/lib/libSvfCore.3.1.dylib +0 -0
  170. package/SVF-osx/Release-build/lib/libSvfLLVM.3.1.dylib +0 -0
  171. package/SVF-osx/Release-build/lib/pkgconfig/SVF.pc +12 -0
  172. package/package.json +1 -1
  173. package/SVF-linux-aarch64/Release-build/include/CFL/grammar/PAGGrammar.txt +0 -15
  174. package/SVF-linux-aarch64/Release-build/include/CFL/grammar/PEGGrammar.txt +0 -11
  175. package/SVF-linux-aarch64/Release-build/include/CFL/grammar/VFGGrammar.txt +0 -7
  176. package/SVF-linux-aarch64/Release-build/include/FastCluster/LICENSE.TXT +0 -13
  177. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/AbstractState.h +0 -0
  178. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/AbstractValue.h +0 -0
  179. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/AddressValue.h +0 -0
  180. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/ICFGWTO.h +0 -0
  181. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/IntervalValue.h +0 -0
  182. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/NumericValue.h +0 -0
  183. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/RelExeState.h +0 -0
  184. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Core/RelationSolver.h +0 -0
  185. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Svfexe/AEDetector.h +0 -0
  186. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Svfexe/AbsExtAPI.h +0 -0
  187. /package/SVF-linux-aarch64/Release-build/include/{AE → SVF/AE}/Svfexe/AbstractInterpretation.h +0 -0
  188. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFGNormalizer.h +0 -0
  189. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFGrammar.h +0 -0
  190. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLAlias.h +0 -0
  191. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLBase.h +0 -0
  192. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLGramGraphChecker.h +0 -0
  193. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLGraphBuilder.h +0 -0
  194. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLSVFGBuilder.h +0 -0
  195. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLSolver.h +0 -0
  196. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLStat.h +0 -0
  197. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/CFLVF.h +0 -0
  198. /package/SVF-linux-aarch64/Release-build/include/{CFL → SVF/CFL}/GrammarBuilder.h +0 -0
  199. /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/ContextDDA.h +0 -0
  200. /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/DDAClient.h +0 -0
  201. /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/DDAPass.h +0 -0
  202. /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/DDAStat.h +0 -0
  203. /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/DDAVFSolver.h +0 -0
  204. /package/SVF-linux-aarch64/Release-build/include/{DDA → SVF/DDA}/FlowDDA.h +0 -0
  205. /package/SVF-linux-aarch64/Release-build/include/{FastCluster → SVF/FastCluster}/fastcluster.h +0 -0
  206. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/BasicBlockG.h +0 -0
  207. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/CDG.h +0 -0
  208. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/CFLGraph.h +0 -0
  209. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/CHG.h +0 -0
  210. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/CallGraph.h +0 -0
  211. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ConsG.h +0 -0
  212. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ConsGEdge.h +0 -0
  213. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ConsGNode.h +0 -0
  214. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/DOTGraphTraits.h +0 -0
  215. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/GenericGraph.h +0 -0
  216. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/GraphPrinter.h +0 -0
  217. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/GraphTraits.h +0 -0
  218. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/GraphWriter.h +0 -0
  219. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ICFG.h +0 -0
  220. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ICFGEdge.h +0 -0
  221. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ICFGNode.h +0 -0
  222. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ICFGStat.h +0 -0
  223. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/IRGraph.h +0 -0
  224. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SCC.h +0 -0
  225. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SVFG.h +0 -0
  226. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SVFGEdge.h +0 -0
  227. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SVFGNode.h +0 -0
  228. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SVFGOPT.h +0 -0
  229. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/SVFGStat.h +0 -0
  230. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/ThreadCallGraph.h +0 -0
  231. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/VFG.h +0 -0
  232. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/VFGEdge.h +0 -0
  233. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/VFGNode.h +0 -0
  234. /package/SVF-linux-aarch64/Release-build/include/{Graphs → SVF/Graphs}/WTO.h +0 -0
  235. /package/SVF-linux-aarch64/Release-build/include/{MSSA → SVF/MSSA}/MSSAMuChi.h +0 -0
  236. /package/SVF-linux-aarch64/Release-build/include/{MSSA → SVF/MSSA}/MemPartition.h +0 -0
  237. /package/SVF-linux-aarch64/Release-build/include/{MSSA → SVF/MSSA}/MemRegion.h +0 -0
  238. /package/SVF-linux-aarch64/Release-build/include/{MSSA → SVF/MSSA}/MemSSA.h +0 -0
  239. /package/SVF-linux-aarch64/Release-build/include/{MSSA → SVF/MSSA}/SVFGBuilder.h +0 -0
  240. /package/SVF-linux-aarch64/Release-build/include/{MTA → SVF/MTA}/LockAnalysis.h +0 -0
  241. /package/SVF-linux-aarch64/Release-build/include/{MTA → SVF/MTA}/MHP.h +0 -0
  242. /package/SVF-linux-aarch64/Release-build/include/{MTA → SVF/MTA}/MTA.h +0 -0
  243. /package/SVF-linux-aarch64/Release-build/include/{MTA → SVF/MTA}/MTAStat.h +0 -0
  244. /package/SVF-linux-aarch64/Release-build/include/{MTA → SVF/MTA}/TCT.h +0 -0
  245. /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/AbstractPointsToDS.h +0 -0
  246. /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/AccessPath.h +0 -0
  247. /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/ConditionalPT.h +0 -0
  248. /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/MutablePointsToDS.h +0 -0
  249. /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/PersistentPointsToCache.h +0 -0
  250. /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/PersistentPointsToDS.h +0 -0
  251. /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/PointerAnalysis.h +0 -0
  252. /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/PointerAnalysisImpl.h +0 -0
  253. /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/PointsTo.h +0 -0
  254. /package/SVF-linux-aarch64/Release-build/include/{MemoryModel → SVF/MemoryModel}/SVFLoop.h +0 -0
  255. /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/DoubleFreeChecker.h +0 -0
  256. /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/FileChecker.h +0 -0
  257. /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/LeakChecker.h +0 -0
  258. /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/ProgSlice.h +0 -0
  259. /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/SaberCheckerAPI.h +0 -0
  260. /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/SaberCondAllocator.h +0 -0
  261. /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/SaberSVFGBuilder.h +0 -0
  262. /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/SrcSnkDDA.h +0 -0
  263. /package/SVF-linux-aarch64/Release-build/include/{SABER → SVF/SABER}/SrcSnkSolver.h +0 -0
  264. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/BasicTypes.h +0 -0
  265. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/BreakConstantExpr.h +0 -0
  266. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/CHGBuilder.h +0 -0
  267. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/CppUtil.h +0 -0
  268. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/DCHG.h +0 -0
  269. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/GEPTypeBridgeIterator.h +0 -0
  270. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/ICFGBuilder.h +0 -0
  271. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/LLVMLoopAnalysis.h +0 -0
  272. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/LLVMModule.h +0 -0
  273. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/LLVMUtil.h +0 -0
  274. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/ObjTypeInference.h +0 -0
  275. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/SVFIRBuilder.h +0 -0
  276. /package/SVF-linux-aarch64/Release-build/include/{SVF-LLVM → SVF/SVF-LLVM}/SymbolTableBuilder.h +0 -0
  277. /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/ObjTypeInfo.h +0 -0
  278. /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/PAGBuilderFromFile.h +0 -0
  279. /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/SVFIR.h +0 -0
  280. /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/SVFStatements.h +0 -0
  281. /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/SVFType.h +0 -0
  282. /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/SVFValue.h +0 -0
  283. /package/SVF-linux-aarch64/Release-build/include/{SVFIR → SVF/SVFIR}/SVFVariables.h +0 -0
  284. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/Annotator.h +0 -0
  285. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/BitVector.h +0 -0
  286. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/CDGBuilder.h +0 -0
  287. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/CallGraphBuilder.h +0 -0
  288. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/Casting.h +0 -0
  289. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/CommandLine.h +0 -0
  290. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/CoreBitVector.h +0 -0
  291. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/CxtStmt.h +0 -0
  292. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/DPItem.h +0 -0
  293. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/ExtAPI.h +0 -0
  294. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/GeneralType.h +0 -0
  295. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/GraphReachSolver.h +0 -0
  296. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/NodeIDAllocator.h +0 -0
  297. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/Options.h +0 -0
  298. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/PTAStat.h +0 -0
  299. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/SVFBugReport.h +0 -0
  300. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/SVFLoopAndDomInfo.h +0 -0
  301. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/SVFStat.h +0 -0
  302. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/SVFUtil.h +0 -0
  303. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/SparseBitVector.h +0 -0
  304. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/ThreadAPI.h +0 -0
  305. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/Z3Expr.h +0 -0
  306. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/cJSON.h +0 -0
  307. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/iterator.h +0 -0
  308. /package/SVF-linux-aarch64/Release-build/include/{Util → SVF/Util}/iterator_range.h +0 -0
  309. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/Andersen.h +0 -0
  310. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/AndersenPWC.h +0 -0
  311. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/CSC.h +0 -0
  312. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/FlowSensitive.h +0 -0
  313. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/Steensgaard.h +0 -0
  314. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/TypeAnalysis.h +0 -0
  315. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/VersionedFlowSensitive.h +0 -0
  316. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/WPAFSSolver.h +0 -0
  317. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/WPAPass.h +0 -0
  318. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/WPASolver.h +0 -0
  319. /package/SVF-linux-aarch64/Release-build/include/{WPA → SVF/WPA}/WPAStat.h +0 -0
  320. /package/SVF-linux-aarch64/Release-build/{lib → include/SVF}/extapi.bc +0 -0
@@ -0,0 +1,2212 @@
1
+ //===- SVFSymbols.h -- SVF Variables------------------------//
2
+ //
3
+ // SVF: Static Value-Flow Analysis
4
+ //
5
+ // Copyright (C) <2013-> <Yulei Sui>
6
+ //
7
+
8
+ // This program is free software: you can redistribute it and/or modify
9
+ // it under the terms of the GNU Affero General Public License as published by
10
+ // the Free Software Foundation, either version 3 of the License, or
11
+ // (at your option) any later version.
12
+
13
+ // This program is distributed in the hope that it will be useful,
14
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ // GNU Affero General Public License for more details.
17
+
18
+ // You should have received a copy of the GNU Affero General Public License
19
+ // along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ //
21
+ //===----------------------------------------------------------------------===//
22
+
23
+ /*
24
+ * SVFVariables.h
25
+ *
26
+ * Created on: Nov 11, 2013
27
+ * Author: Yulei Sui
28
+ */
29
+
30
+ #ifndef INCLUDE_SVFIR_SVFVARIABLE_H_
31
+ #define INCLUDE_SVFIR_SVFVARIABLE_H_
32
+
33
+ #include "Graphs/GenericGraph.h"
34
+ #include "SVFIR/ObjTypeInfo.h"
35
+ #include "SVFIR/SVFStatements.h"
36
+
37
+ namespace SVF
38
+ {
39
+
40
+ class SVFVar;
41
+ /*
42
+ * Program variables in SVFIR (based on PAG nodes)
43
+ * These represent variables in the program analysis graph
44
+ */
45
+ typedef GenericNode<SVFVar, SVFStmt> GenericPAGNodeTy;
46
+ class SVFVar : public GenericPAGNodeTy
47
+ {
48
+ friend class SVFIRWriter;
49
+ friend class SVFIRReader;
50
+ friend class SVFIRBuilder;
51
+ friend class IRGraph;
52
+ friend class SVFIR;
53
+ friend class VFG;
54
+
55
+ public:
56
+ /// Node kinds for SVFIR variables:
57
+ /// ValNode - LLVM pointer value
58
+ /// ObjNode - Memory object
59
+ /// RetValNode - Function return value
60
+ /// VarargNode - Variable argument parameter
61
+ /// GepValNode - Temporary value for field-sensitive analysis
62
+ /// GepObjNode - Temporary object for field-sensitive analysis
63
+ /// BaseObjNode - Base object for field-insensitive analysis
64
+ /// DummyValNode/DummyObjNode - Nodes for non-LLVM values
65
+ typedef GNodeK PNODEK;
66
+ typedef s64_t GEdgeKind;
67
+
68
+ protected:
69
+ /// Maps tracking incoming and outgoing edges by kind
70
+ SVFStmt::KindToSVFStmtMapTy InEdgeKindToSetMap;
71
+ SVFStmt::KindToSVFStmtMapTy OutEdgeKindToSetMap;
72
+
73
+ /// Empty constructor for deserialization
74
+ SVFVar(NodeID i, PNODEK k) : GenericPAGNodeTy(i, k) {}
75
+
76
+
77
+ public:
78
+ /// Standard constructor with ID, type and kind
79
+ SVFVar(NodeID i, const SVFType* svfType, PNODEK k);
80
+
81
+ /// Virtual destructor
82
+ virtual ~SVFVar() {}
83
+
84
+ /// Check if this variable represents a pointer
85
+ virtual inline bool isPointer() const
86
+ {
87
+ assert(type && "type is null?");
88
+ return type->isPointerTy();
89
+ }
90
+
91
+ /// Check if this variable represents constant data/metadata but not null pointer
92
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
93
+ {
94
+ return false;
95
+ }
96
+
97
+ /// Check if this node is isolated (no edges) in the SVFIR graph
98
+ virtual bool isIsolatedNode() const;
99
+
100
+ /// Get string name of the represented LLVM value
101
+ virtual const std::string getValueName() const = 0;
102
+
103
+ /// Get containing function, or null for globals/constants
104
+ virtual inline const FunObjVar* getFunction() const
105
+ {
106
+ return nullptr;
107
+ }
108
+
109
+ /// Edge accessors and checkers
110
+ //@{
111
+ inline SVFStmt::SVFStmtSetTy& getIncomingEdges(SVFStmt::PEDGEK kind)
112
+ {
113
+ return InEdgeKindToSetMap[kind];
114
+ }
115
+
116
+ inline SVFStmt::SVFStmtSetTy& getOutgoingEdges(SVFStmt::PEDGEK kind)
117
+ {
118
+ return OutEdgeKindToSetMap[kind];
119
+ }
120
+
121
+ inline bool hasIncomingEdges(SVFStmt::PEDGEK kind) const
122
+ {
123
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
124
+ if (it != InEdgeKindToSetMap.end())
125
+ return (!it->second.empty());
126
+ else
127
+ return false;
128
+ }
129
+
130
+ inline bool hasOutgoingEdges(SVFStmt::PEDGEK kind) const
131
+ {
132
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
133
+ if (it != OutEdgeKindToSetMap.end())
134
+ return (!it->second.empty());
135
+ else
136
+ return false;
137
+ }
138
+
139
+ /// Edge iterators
140
+ inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesBegin(SVFStmt::PEDGEK kind) const
141
+ {
142
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
143
+ assert(it!=InEdgeKindToSetMap.end() && "Edge kind not found");
144
+ return it->second.begin();
145
+ }
146
+
147
+ inline SVFStmt::SVFStmtSetTy::iterator getIncomingEdgesEnd(SVFStmt::PEDGEK kind) const
148
+ {
149
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(kind);
150
+ assert(it!=InEdgeKindToSetMap.end() && "Edge kind not found");
151
+ return it->second.end();
152
+ }
153
+
154
+ inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesBegin(SVFStmt::PEDGEK kind) const
155
+ {
156
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
157
+ assert(it!=OutEdgeKindToSetMap.end() && "Edge kind not found");
158
+ return it->second.begin();
159
+ }
160
+
161
+ inline SVFStmt::SVFStmtSetTy::iterator getOutgoingEdgesEnd(SVFStmt::PEDGEK kind) const
162
+ {
163
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = OutEdgeKindToSetMap.find(kind);
164
+ assert(it!=OutEdgeKindToSetMap.end() && "Edge kind not found");
165
+ return it->second.end();
166
+ }
167
+ //@}
168
+
169
+ /// Type checking support for LLVM-style RTTI
170
+ static inline bool classof(const SVFVar *)
171
+ {
172
+ return true;
173
+ }
174
+
175
+ static inline bool classof(const GenericPAGNodeTy * node)
176
+ {
177
+ return isSVFVarKind(node->getNodeKind());
178
+ }
179
+
180
+ static inline bool classof(const SVFValue* node)
181
+ {
182
+ return isSVFVarKind(node->getNodeKind());
183
+ }
184
+
185
+ /// Check if this pointer is in an uncalled function
186
+ virtual bool ptrInUncalledFunction() const;
187
+
188
+ /// Check if this variable represents constant/aggregate data
189
+ virtual bool isConstDataOrAggData() const
190
+ {
191
+ return false;
192
+ }
193
+
194
+
195
+ private:
196
+ /// Edge management methods
197
+ //@{
198
+ inline void addInEdge(SVFStmt* inEdge)
199
+ {
200
+ GEdgeKind kind = inEdge->getEdgeKind();
201
+ InEdgeKindToSetMap[kind].insert(inEdge);
202
+ addIncomingEdge(inEdge);
203
+ }
204
+
205
+ inline void addOutEdge(SVFStmt* outEdge)
206
+ {
207
+ GEdgeKind kind = outEdge->getEdgeKind();
208
+ OutEdgeKindToSetMap[kind].insert(outEdge);
209
+ addOutgoingEdge(outEdge);
210
+ }
211
+
212
+ /// Check for incoming variable field GEP edges
213
+ inline bool hasIncomingVariantGepEdge() const
214
+ {
215
+ SVFStmt::KindToSVFStmtMapTy::const_iterator it = InEdgeKindToSetMap.find(SVFStmt::Gep);
216
+ if (it != InEdgeKindToSetMap.end())
217
+ {
218
+ for(auto gep : it->second)
219
+ {
220
+ if(SVFUtil::cast<GepStmt>(gep)->isVariantFieldGep())
221
+ return true;
222
+ }
223
+ }
224
+ return false;
225
+ }
226
+
227
+ public:
228
+ /// Get string representation
229
+ virtual const std::string toString() const;
230
+
231
+ /// Debug dump to console
232
+ void dump() const;
233
+
234
+ /// Stream operator overload for output
235
+ friend OutStream& operator<< (OutStream &o, const SVFVar &node)
236
+ {
237
+ o << node.toString();
238
+ return o;
239
+ }
240
+ };
241
+
242
+
243
+
244
+ /*
245
+ * Value (Pointer) variable
246
+ */
247
+ class ValVar: public SVFVar
248
+ {
249
+ friend class SVFIRWriter;
250
+ friend class SVFIRReader;
251
+
252
+ private:
253
+ const ICFGNode* icfgNode; // icfgnode related to valvar
254
+ protected:
255
+ /// Constructor to create an empty ValVar (for SVFIRReader/deserialization)
256
+ ValVar(NodeID i, PNODEK ty = ValNode) : SVFVar(i, ty), icfgNode(nullptr) {}
257
+
258
+ public:
259
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
260
+ //@{
261
+ static inline bool classof(const ValVar*)
262
+ {
263
+ return true;
264
+ }
265
+ static inline bool classof(const SVFVar* node)
266
+ {
267
+ return isValVarKinds(node->getNodeKind());
268
+ }
269
+ static inline bool classof(const GenericPAGNodeTy* node)
270
+ {
271
+ return isValVarKinds(node->getNodeKind());
272
+ }
273
+ static inline bool classof(const SVFValue* node)
274
+ {
275
+ return isValVarKinds(node->getNodeKind());
276
+ }
277
+ //@}
278
+
279
+ /// Constructor
280
+ ValVar(NodeID i, const SVFType* svfType, const ICFGNode* node, PNODEK ty = ValNode)
281
+ : SVFVar(i, svfType, ty), icfgNode(node)
282
+ {
283
+ }
284
+ /// Return name of a LLVM value
285
+ inline const std::string getValueName() const
286
+ {
287
+ return getName();
288
+ }
289
+
290
+ const ICFGNode* getICFGNode() const
291
+ {
292
+ return icfgNode;
293
+ }
294
+
295
+ virtual const FunObjVar* getFunction() const;
296
+
297
+ virtual const std::string toString() const;
298
+ };
299
+
300
+ /*
301
+ * Memory Object variable
302
+ */
303
+ class ObjVar: public SVFVar
304
+ {
305
+ friend class SVFIRWriter;
306
+ friend class SVFIRReader;
307
+
308
+ protected:
309
+ /// Constructor to create an empty ObjVar (for SVFIRReader/deserialization)
310
+ ObjVar(NodeID i, PNODEK ty = ObjNode) : SVFVar(i, ty) {}
311
+ /// Constructor
312
+ ObjVar(NodeID i, const SVFType* svfType, PNODEK ty = ObjNode) :
313
+ SVFVar(i, svfType, ty)
314
+ {
315
+ }
316
+ public:
317
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
318
+ //@{
319
+ static inline bool classof(const ObjVar*)
320
+ {
321
+ return true;
322
+ }
323
+ static inline bool classof(const SVFVar* node)
324
+ {
325
+ return isObjVarKinds(node->getNodeKind());
326
+ }
327
+ static inline bool classof(const GenericPAGNodeTy* node)
328
+ {
329
+ return isObjVarKinds(node->getNodeKind());
330
+ }
331
+ static inline bool classof(const SVFValue* node)
332
+ {
333
+ return isObjVarKinds(node->getNodeKind());
334
+ }
335
+ //@}
336
+
337
+ /// Return name of a LLVM value
338
+ virtual const std::string getValueName() const
339
+ {
340
+ return getName();
341
+ }
342
+
343
+ virtual const std::string toString() const;
344
+ };
345
+
346
+
347
+ /**
348
+ * @brief Class representing a function argument variable in the SVFIR
349
+ *
350
+ * This class models function argument in the program analysis. It extends ValVar
351
+ * to specifically handle function argument.
352
+ */
353
+ class ArgValVar: public ValVar
354
+ {
355
+ friend class SVFIRWriter;
356
+ friend class SVFIRReader;
357
+
358
+ private:
359
+ const FunObjVar* cgNode;
360
+ u32_t argNo;
361
+
362
+ protected:
363
+ /// Constructor to create function argument (for SVFIRReader/deserialization)
364
+ ArgValVar(NodeID i, PNODEK ty = ArgValNode) : ValVar(i, ty) {}
365
+
366
+ public:
367
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
368
+ //@{
369
+ static inline bool classof(const ArgValVar*)
370
+ {
371
+ return true;
372
+ }
373
+ static inline bool classof(const ValVar* node)
374
+ {
375
+ return node->getNodeKind() == ArgValNode;
376
+ }
377
+ static inline bool classof(const SVFVar* node)
378
+ {
379
+ return node->getNodeKind() == ArgValNode;
380
+ }
381
+ static inline bool classof(const GenericPAGNodeTy* node)
382
+ {
383
+ return node->getNodeKind() == ArgValNode;
384
+ }
385
+ static inline bool classof(const SVFValue* node)
386
+ {
387
+ return node->getNodeKind() == ArgValNode;
388
+ }
389
+ //@}
390
+
391
+ /// Constructor
392
+ ArgValVar(NodeID i, u32_t argNo, const ICFGNode* icn, const FunObjVar* callGraphNode,
393
+ const SVFType* svfType);
394
+
395
+ /// Return name of a LLVM value
396
+ inline const std::string getValueName() const
397
+ {
398
+ return getName() + " (argument valvar)";
399
+ }
400
+
401
+ virtual const FunObjVar* getFunction() const;
402
+
403
+ const FunObjVar* getParent() const;
404
+
405
+ /// Return the index of this formal argument in its containing function.
406
+ /// For example in "void foo(int a, float b)" a is 0 and b is 1.
407
+ inline u32_t getArgNo() const
408
+ {
409
+ return argNo;
410
+ }
411
+
412
+ bool isArgOfUncalledFunction() const;
413
+
414
+ virtual bool isPointer() const;
415
+
416
+ virtual const std::string toString() const;
417
+ };
418
+
419
+
420
+ /*
421
+ * Gep Value (Pointer) variable, this variable can be dynamic generated for field sensitive analysis
422
+ * e.g. memcpy, temp gep value variable needs to be created
423
+ * Each Gep Value variable is connected to base value variable via gep edge
424
+ */
425
+ class GepValVar: public ValVar
426
+ {
427
+ friend class SVFIRWriter;
428
+ friend class SVFIRReader;
429
+
430
+ private:
431
+ AccessPath ap; // AccessPath
432
+ const ValVar* base; // base node
433
+ const SVFType* gepValType;
434
+
435
+ /// Constructor to create empty GeValVar (for SVFIRReader/deserialization)
436
+ GepValVar(NodeID i) : ValVar(i, GepValNode), gepValType{} {}
437
+
438
+ public:
439
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
440
+ //@{
441
+ static inline bool classof(const GepValVar *)
442
+ {
443
+ return true;
444
+ }
445
+ static inline bool classof(const ValVar * node)
446
+ {
447
+ return node->getNodeKind() == SVFVar::GepValNode;
448
+ }
449
+ static inline bool classof(const SVFVar *node)
450
+ {
451
+ return node->getNodeKind() == SVFVar::GepValNode;
452
+ }
453
+ static inline bool classof(const GenericPAGNodeTy *node)
454
+ {
455
+ return node->getNodeKind() == SVFVar::GepValNode;
456
+ }
457
+ static inline bool classof(const SVFValue* node)
458
+ {
459
+ return node->getNodeKind() == SVFVar::GepValNode;
460
+ }
461
+ //@}
462
+
463
+ /// Constructor
464
+ GepValVar(const ValVar* baseNode, NodeID i, const AccessPath& ap,
465
+ const SVFType* ty, const ICFGNode* node);
466
+
467
+ /// offset of the base value variable
468
+ inline APOffset getConstantFieldIdx() const
469
+ {
470
+ return ap.getConstantStructFldIdx();
471
+ }
472
+
473
+ /// Return the base object from which this GEP node came from.
474
+ inline const ValVar* getBaseNode(void) const
475
+ {
476
+ return base;
477
+ }
478
+
479
+ /// Return name of a LLVM value
480
+ inline const std::string getValueName() const
481
+ {
482
+ return getName() + "_" +
483
+ std::to_string(getConstantFieldIdx());
484
+ }
485
+
486
+ virtual bool isPointer() const
487
+ {
488
+ return base->isPointer();
489
+ }
490
+
491
+ inline const SVFType* getType() const
492
+ {
493
+ return gepValType;
494
+ }
495
+
496
+ virtual const FunObjVar* getFunction() const
497
+ {
498
+ return base->getFunction();
499
+ }
500
+
501
+ virtual const std::string toString() const;
502
+
503
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
504
+ {
505
+ return base->isConstDataOrAggDataButNotNullPtr();
506
+ }
507
+ virtual inline bool ptrInUncalledFunction() const
508
+ {
509
+ return base->ptrInUncalledFunction();
510
+ }
511
+
512
+ virtual inline bool isConstDataOrAggData() const
513
+ {
514
+ return base->isConstDataOrAggData();
515
+ }
516
+ };
517
+
518
+ /*
519
+ * Base memory object variable (address-taken variables in LLVM-based languages)
520
+ */
521
+ class BaseObjVar : public ObjVar
522
+ {
523
+ friend class SVFIRWriter;
524
+ friend class SVFIRReader;
525
+ friend class SVFIRBuilder;
526
+ private:
527
+ ObjTypeInfo* typeInfo;
528
+
529
+ const ICFGNode* icfgNode; /// ICFGNode related to the creation of this object
530
+
531
+ protected:
532
+ /// Constructor to create empty ObjVar (for SVFIRReader/deserialization)
533
+ BaseObjVar(NodeID i, const ICFGNode* node, PNODEK ty = BaseObjNode) : ObjVar(i, ty), icfgNode(node) {}
534
+
535
+ public:
536
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
537
+ //@{
538
+ static inline bool classof(const BaseObjVar*)
539
+ {
540
+ return true;
541
+ }
542
+ static inline bool classof(const ObjVar* node)
543
+ {
544
+ return isBaseObjVarKinds(node->getNodeKind());
545
+ }
546
+ static inline bool classof(const SVFVar* node)
547
+ {
548
+ return isBaseObjVarKinds(node->getNodeKind());
549
+ }
550
+ static inline bool classof(const GenericPAGNodeTy* node)
551
+ {
552
+ return isBaseObjVarKinds(node->getNodeKind());
553
+ }
554
+ static inline bool classof(const SVFValue* node)
555
+ {
556
+ return isBaseObjVarKinds(node->getNodeKind());
557
+ }
558
+ //@}
559
+
560
+ /// Constructor
561
+ BaseObjVar(NodeID i, ObjTypeInfo* ti,
562
+ const SVFType* svfType, const ICFGNode* node, PNODEK ty = BaseObjNode)
563
+ : ObjVar(i, svfType, ty), typeInfo(ti), icfgNode(node)
564
+ {
565
+ }
566
+
567
+ virtual const BaseObjVar* getBaseMemObj() const
568
+ {
569
+ return this;
570
+ }
571
+
572
+ /// Get the ICFGNode related to the creation of this object
573
+ inline const ICFGNode* getICFGNode() const
574
+ {
575
+ return icfgNode;
576
+ }
577
+
578
+ /// Return name of a LLVM value
579
+ inline const std::string getValueName() const
580
+ {
581
+ return getName() + " (base object)";
582
+ }
583
+
584
+ virtual const std::string toString() const;
585
+
586
+ /// Get the memory object id
587
+ inline NodeID getId() const
588
+ {
589
+ return id;
590
+ }
591
+
592
+ /// Get obj type
593
+ const SVFType* getType() const
594
+ {
595
+ return typeInfo->getType();
596
+ }
597
+
598
+ /// Get the number of elements of this object
599
+ u32_t getNumOfElements() const
600
+ {
601
+ return typeInfo->getNumOfElements();
602
+ }
603
+
604
+ /// Set the number of elements of this object
605
+ void setNumOfElements(u32_t num)
606
+ {
607
+ return typeInfo->setNumOfElements(num);
608
+ }
609
+
610
+ /// Get max field offset limit
611
+ u32_t getMaxFieldOffsetLimit() const
612
+ {
613
+ return typeInfo->getMaxFieldOffsetLimit();
614
+ }
615
+
616
+
617
+ /// Return true if its field limit is 0
618
+ bool isFieldInsensitive() const
619
+ {
620
+ return getMaxFieldOffsetLimit() == 0;
621
+ }
622
+
623
+ /// Set the memory object to be field insensitive
624
+ void setFieldInsensitive()
625
+ {
626
+ typeInfo->setMaxFieldOffsetLimit(0);
627
+ }
628
+
629
+
630
+ /// Set the memory object to be field sensitive (up to max field limit)
631
+ void setFieldSensitive()
632
+ {
633
+ typeInfo->setMaxFieldOffsetLimit(typeInfo->getNumOfElements());
634
+ }
635
+
636
+ /// Whether it is a black hole object
637
+ bool isBlackHoleObj() const;
638
+
639
+ /// Get the byte size of this object
640
+ u32_t getByteSizeOfObj() const
641
+ {
642
+ return typeInfo->getByteSizeOfObj();
643
+ }
644
+
645
+ /// Check if byte size is a const value
646
+ bool isConstantByteSize() const
647
+ {
648
+ return typeInfo->isConstantByteSize();
649
+ }
650
+
651
+
652
+ /// object attributes methods
653
+ //@{
654
+ bool isFunction() const
655
+ {
656
+ return typeInfo->isFunction();
657
+ }
658
+ bool isGlobalObj() const
659
+ {
660
+ return typeInfo->isGlobalObj();
661
+ }
662
+ bool isStaticObj() const
663
+ {
664
+ return typeInfo->isStaticObj();
665
+ }
666
+ bool isStack() const
667
+ {
668
+ return typeInfo->isStack();
669
+ }
670
+ bool isHeap() const
671
+ {
672
+ return typeInfo->isHeap();
673
+ }
674
+ bool isStruct() const
675
+ {
676
+ return typeInfo->isStruct();
677
+ }
678
+ bool isArray() const
679
+ {
680
+ return typeInfo->isArray();
681
+ }
682
+ bool isVarStruct() const
683
+ {
684
+ return typeInfo->isVarStruct();
685
+ }
686
+ bool isVarArray() const
687
+ {
688
+ return typeInfo->isVarArray();
689
+ }
690
+ bool isConstantStruct() const
691
+ {
692
+ return typeInfo->isConstantStruct();
693
+ }
694
+ bool isConstantArray() const
695
+ {
696
+ return typeInfo->isConstantArray();
697
+ }
698
+ bool isConstDataOrConstGlobal() const
699
+ {
700
+ return typeInfo->isConstDataOrConstGlobal();
701
+ }
702
+ virtual inline bool isConstDataOrAggData() const
703
+ {
704
+ return typeInfo->isConstDataOrAggData();
705
+ }
706
+ //@}
707
+
708
+ /// Clean up memory
709
+ void destroy()
710
+ {
711
+ delete typeInfo;
712
+ typeInfo = nullptr;
713
+ }
714
+
715
+ virtual const FunObjVar* getFunction() const;
716
+
717
+ };
718
+
719
+
720
+ /*
721
+ * Gep Obj variable, this is dynamic generated for field sensitive analysis
722
+ * Each gep obj variable is one field of a BaseObjVar (base)
723
+ */
724
+ class GepObjVar: public ObjVar
725
+ {
726
+ friend class SVFIRWriter;
727
+ friend class SVFIRReader;
728
+
729
+ private:
730
+ APOffset apOffset = 0;
731
+
732
+ const BaseObjVar* base;
733
+
734
+ /// Constructor to create empty GepObjVar (for SVFIRReader/deserialization)
735
+ // only for reading from file when we don't have BaseObjVar*
736
+ GepObjVar(NodeID i, PNODEK ty = GepObjNode) : ObjVar(i, ty), base{} {}
737
+
738
+ public:
739
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
740
+ //@{
741
+ static inline bool classof(const GepObjVar*)
742
+ {
743
+ return true;
744
+ }
745
+ static inline bool classof(const ObjVar* node)
746
+ {
747
+ return node->getNodeKind() == SVFVar::GepObjNode;
748
+ }
749
+ static inline bool classof(const SVFVar* node)
750
+ {
751
+ return node->getNodeKind() == SVFVar::GepObjNode;
752
+ }
753
+ static inline bool classof(const GenericPAGNodeTy* node)
754
+ {
755
+ return node->getNodeKind() == SVFVar::GepObjNode;
756
+ }
757
+ static inline bool classof(const SVFValue* node)
758
+ {
759
+ return node->getNodeKind() == SVFVar::GepObjNode;
760
+ }
761
+ //@}
762
+
763
+ /// Constructor
764
+ GepObjVar(const BaseObjVar* baseObj, NodeID i,
765
+ const APOffset& apOffset, PNODEK ty = GepObjNode)
766
+ : ObjVar(i, baseObj->getType(), ty), apOffset(apOffset), base(baseObj)
767
+ {
768
+ }
769
+
770
+ /// offset of the mem object
771
+ inline APOffset getConstantFieldIdx() const
772
+ {
773
+ return apOffset;
774
+ }
775
+
776
+ /// Return the base object from which this GEP node came from.
777
+ inline NodeID getBaseNode(void) const
778
+ {
779
+ return base->getId();
780
+ }
781
+
782
+ inline const BaseObjVar* getBaseObj() const
783
+ {
784
+ return base;
785
+ }
786
+
787
+ /// Return the type of this gep object
788
+ inline virtual const SVFType* getType() const;
789
+
790
+
791
+ /// Return name of a LLVM value
792
+ inline const std::string getValueName() const
793
+ {
794
+ return getName() + "_" + std::to_string(apOffset);
795
+ }
796
+
797
+ virtual const FunObjVar* getFunction() const
798
+ {
799
+ return base->getFunction();
800
+ }
801
+
802
+ virtual const std::string toString() const;
803
+
804
+ virtual inline bool ptrInUncalledFunction() const
805
+ {
806
+ return base->ptrInUncalledFunction();
807
+ }
808
+
809
+ virtual inline bool isConstDataOrAggData() const
810
+ {
811
+ return base->isConstDataOrAggData();
812
+ }
813
+
814
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
815
+ {
816
+ return base->isConstDataOrAggDataButNotNullPtr();
817
+ }
818
+
819
+ virtual bool isPointer() const
820
+ {
821
+ return base->isPointer();
822
+ }
823
+ };
824
+
825
+
826
+
827
+ /**
828
+ * @brief Class representing a heap object variable in the SVFIR
829
+ *
830
+ * This class models heap-allocated objects in the program analysis. It extends BaseObjVar
831
+ * to specifically handle heap memory locations.
832
+ */
833
+ class HeapObjVar: public BaseObjVar
834
+ {
835
+
836
+ friend class SVFIRWriter;
837
+ friend class SVFIRReader;
838
+
839
+ protected:
840
+ /// Constructor to create heap object var
841
+ HeapObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, HeapObjNode) {}
842
+
843
+ public:
844
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
845
+ //@{
846
+ static inline bool classof(const HeapObjVar*)
847
+ {
848
+ return true;
849
+ }
850
+ static inline bool classof(const BaseObjVar* node)
851
+ {
852
+ return node->getNodeKind() == HeapObjNode;
853
+ }
854
+ static inline bool classof(const ObjVar* node)
855
+ {
856
+ return node->getNodeKind() == HeapObjNode;
857
+ }
858
+ static inline bool classof(const SVFVar* node)
859
+ {
860
+ return node->getNodeKind() == HeapObjNode;
861
+ }
862
+ static inline bool classof(const GenericPAGNodeTy* node)
863
+ {
864
+ return node->getNodeKind() == HeapObjNode;
865
+ }
866
+ static inline bool classof(const SVFValue* node)
867
+ {
868
+ return node->getNodeKind() == HeapObjNode;
869
+ }
870
+ //@}
871
+
872
+ /// Constructor
873
+ HeapObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node):
874
+ BaseObjVar(i, ti, svfType, node, HeapObjNode)
875
+ {
876
+ }
877
+
878
+ /// Return name of a LLVM value
879
+ inline const std::string getValueName() const
880
+ {
881
+ return " (heap base object)";
882
+ }
883
+
884
+ virtual const std::string toString() const;
885
+ };
886
+
887
+
888
+ /**
889
+ * @brief Represents a stack-allocated object variable in the SVFIR (SVF Intermediate Representation)
890
+ * @inherits BaseObjVar
891
+ *
892
+ * This class models variables that are allocated on the stack in the program.
893
+ * It provides type checking functionality through LLVM-style RTTI (Runtime Type Information)
894
+ * methods like classof.
895
+ */
896
+ class StackObjVar: public BaseObjVar
897
+ {
898
+
899
+ friend class SVFIRWriter;
900
+ friend class SVFIRReader;
901
+
902
+ protected:
903
+ /// Constructor to create stack object var
904
+ StackObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, StackObjNode) {}
905
+
906
+ public:
907
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
908
+ //@{
909
+ static inline bool classof(const StackObjVar*)
910
+ {
911
+ return true;
912
+ }
913
+ static inline bool classof(const BaseObjVar* node)
914
+ {
915
+ return node->getNodeKind() == StackObjNode;
916
+ }
917
+ static inline bool classof(const ObjVar* node)
918
+ {
919
+ return node->getNodeKind() == StackObjNode;
920
+ }
921
+ static inline bool classof(const SVFVar* node)
922
+ {
923
+ return node->getNodeKind() == StackObjNode;
924
+ }
925
+ static inline bool classof(const GenericPAGNodeTy* node)
926
+ {
927
+ return node->getNodeKind() == StackObjNode;
928
+ }
929
+ static inline bool classof(const SVFValue* node)
930
+ {
931
+ return node->getNodeKind() == StackObjNode;
932
+ }
933
+ //@}
934
+
935
+ /// Constructor
936
+ StackObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node):
937
+ BaseObjVar(i, ti, svfType, node, StackObjNode)
938
+ {
939
+ }
940
+
941
+ /// Return name of a LLVM value
942
+ inline const std::string getValueName() const
943
+ {
944
+ return " (stack base object)";
945
+ }
946
+
947
+ virtual const std::string toString() const;
948
+ };
949
+
950
+
951
+ class CallGraphNode;
952
+
953
+ class FunObjVar : public BaseObjVar
954
+ {
955
+ friend class SVFIRWriter;
956
+ friend class SVFIRReader;
957
+ friend class SVFIRBuilder;
958
+ friend class LLVMModuleSet;
959
+
960
+ public:
961
+ typedef SVFLoopAndDomInfo::BBSet BBSet;
962
+ typedef SVFLoopAndDomInfo::BBList BBList;
963
+ typedef SVFLoopAndDomInfo::LoopBBs LoopBBs;
964
+
965
+ typedef BasicBlockGraph::IDToNodeMapTy::const_iterator const_bb_iterator;
966
+
967
+
968
+ private:
969
+ bool isDecl; /// return true if this function does not have a body
970
+ bool intrinsic; /// return true if this function is an intrinsic function (e.g., llvm.dbg), which does not reside in the application code
971
+ bool isAddrTaken; /// return true if this function is address-taken (for indirect call purposes)
972
+ bool isUncalled; /// return true if this function is never called
973
+ bool isNotRet; /// return true if this function never returns
974
+ bool supVarArg; /// return true if this function supports variable arguments
975
+ const SVFFunctionType* funcType; /// FunctionType, which is different from the type (PointerType) of this SVF Function
976
+ SVFLoopAndDomInfo* loopAndDom; /// the loop and dominate information
977
+ const FunObjVar * realDefFun; /// the definition of a function across multiple modules
978
+ BasicBlockGraph* bbGraph; /// the basic block graph of this function
979
+ std::vector<const ArgValVar*> allArgs; /// all formal arguments of this function
980
+ const SVFBasicBlock *exitBlock; /// a 'single' basic block having no successors and containing return instruction in a function
981
+
982
+
983
+ private:
984
+ /// Constructor to create empty ObjVar (for SVFIRReader/deserialization)
985
+ FunObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i,node, FunObjNode) {}
986
+
987
+ public:
988
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
989
+ //@{
990
+ static inline bool classof(const FunObjVar*)
991
+ {
992
+ return true;
993
+ }
994
+ static inline bool classof(const BaseObjVar* node)
995
+ {
996
+ return node->getNodeKind() == FunObjNode;
997
+ }
998
+ static inline bool classof(const ObjVar* node)
999
+ {
1000
+ return node->getNodeKind() == FunObjNode;
1001
+ }
1002
+ static inline bool classof(const SVFVar* node)
1003
+ {
1004
+ return node->getNodeKind() == FunObjNode;
1005
+ }
1006
+ static inline bool classof(const GenericPAGNodeTy* node)
1007
+ {
1008
+ return node->getNodeKind() == FunObjNode;
1009
+ }
1010
+ static inline bool classof(const SVFValue* node)
1011
+ {
1012
+ return node->getNodeKind() == FunObjNode;
1013
+ }
1014
+ //@}
1015
+
1016
+ /// Constructor
1017
+ FunObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node);
1018
+
1019
+
1020
+ virtual ~FunObjVar()
1021
+ {
1022
+ delete loopAndDom;
1023
+ delete bbGraph;
1024
+ }
1025
+
1026
+ void initFunObjVar(bool decl, bool intrinc, bool addr, bool uncalled, bool notret, bool vararg, const SVFFunctionType *ft,
1027
+ SVFLoopAndDomInfo *ld, const FunObjVar *real, BasicBlockGraph *bbg,
1028
+ const std::vector<const ArgValVar *> &allarg, const SVFBasicBlock *exit);
1029
+
1030
+ void setRelDefFun(const FunObjVar *real)
1031
+ {
1032
+ realDefFun = real;
1033
+ }
1034
+
1035
+ virtual const FunObjVar*getFunction() const;
1036
+
1037
+ inline void addArgument(const ArgValVar *arg)
1038
+ {
1039
+ allArgs.push_back(arg);
1040
+ }
1041
+ inline bool isDeclaration() const
1042
+ {
1043
+ return isDecl;
1044
+ }
1045
+
1046
+ inline bool isIntrinsic() const
1047
+ {
1048
+ return intrinsic;
1049
+ }
1050
+
1051
+ inline bool hasAddressTaken() const
1052
+ {
1053
+ return isAddrTaken;
1054
+ }
1055
+
1056
+ inline bool isVarArg() const
1057
+ {
1058
+ return supVarArg;
1059
+ }
1060
+
1061
+ inline bool isUncalledFunction() const
1062
+ {
1063
+ return isUncalled;
1064
+ }
1065
+
1066
+ inline bool hasReturn() const
1067
+ {
1068
+ return !isNotRet;
1069
+ }
1070
+
1071
+ /// Returns the FunctionType
1072
+ inline const SVFFunctionType* getFunctionType() const
1073
+ {
1074
+ return funcType;
1075
+ }
1076
+
1077
+ /// Returns the FunctionType
1078
+ inline const SVFType* getReturnType() const
1079
+ {
1080
+ return funcType->getReturnType();
1081
+ }
1082
+
1083
+ inline SVFLoopAndDomInfo* getLoopAndDomInfo() const
1084
+ {
1085
+ return loopAndDom;
1086
+ }
1087
+
1088
+ inline const std::vector<const SVFBasicBlock*>& getReachableBBs() const
1089
+ {
1090
+ return loopAndDom->getReachableBBs();
1091
+ }
1092
+
1093
+ inline void getExitBlocksOfLoop(const SVFBasicBlock* bb, BBList& exitbbs) const
1094
+ {
1095
+ return loopAndDom->getExitBlocksOfLoop(bb,exitbbs);
1096
+ }
1097
+
1098
+ inline bool hasLoopInfo(const SVFBasicBlock* bb) const
1099
+ {
1100
+ return loopAndDom->hasLoopInfo(bb);
1101
+ }
1102
+
1103
+ const LoopBBs& getLoopInfo(const SVFBasicBlock* bb) const
1104
+ {
1105
+ return loopAndDom->getLoopInfo(bb);
1106
+ }
1107
+
1108
+ inline const SVFBasicBlock* getLoopHeader(const BBList& lp) const
1109
+ {
1110
+ return loopAndDom->getLoopHeader(lp);
1111
+ }
1112
+
1113
+ inline bool loopContainsBB(const BBList& lp, const SVFBasicBlock* bb) const
1114
+ {
1115
+ return loopAndDom->loopContainsBB(lp,bb);
1116
+ }
1117
+
1118
+ inline const Map<const SVFBasicBlock*,BBSet>& getDomTreeMap() const
1119
+ {
1120
+ return loopAndDom->getDomTreeMap();
1121
+ }
1122
+
1123
+ inline const Map<const SVFBasicBlock*,BBSet>& getDomFrontierMap() const
1124
+ {
1125
+ return loopAndDom->getDomFrontierMap();
1126
+ }
1127
+
1128
+ inline bool isLoopHeader(const SVFBasicBlock* bb) const
1129
+ {
1130
+ return loopAndDom->isLoopHeader(bb);
1131
+ }
1132
+
1133
+ inline bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
1134
+ {
1135
+ return loopAndDom->dominate(bbKey,bbValue);
1136
+ }
1137
+
1138
+ inline bool postDominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
1139
+ {
1140
+ return loopAndDom->postDominate(bbKey,bbValue);
1141
+ }
1142
+
1143
+ inline const FunObjVar* getDefFunForMultipleModule() const
1144
+ {
1145
+ if(realDefFun==nullptr)
1146
+ return this;
1147
+ return realDefFun;
1148
+ }
1149
+
1150
+ void setBasicBlockGraph(BasicBlockGraph* graph)
1151
+ {
1152
+ this->bbGraph = graph;
1153
+ }
1154
+
1155
+ BasicBlockGraph* getBasicBlockGraph()
1156
+ {
1157
+ return bbGraph;
1158
+ }
1159
+
1160
+ const BasicBlockGraph* getBasicBlockGraph() const
1161
+ {
1162
+ return bbGraph;
1163
+ }
1164
+
1165
+ inline bool hasBasicBlock() const
1166
+ {
1167
+ return bbGraph && bbGraph->begin() != bbGraph->end();
1168
+ }
1169
+
1170
+ inline const SVFBasicBlock* getEntryBlock() const
1171
+ {
1172
+ assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1173
+ assert(bbGraph->begin()->second->getInEdges().size() == 0 && "the first basic block is not entry block");
1174
+ return bbGraph->begin()->second;
1175
+ }
1176
+
1177
+ inline const SVFBasicBlock* getExitBB() const
1178
+ {
1179
+ assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1180
+ assert(exitBlock && "must have an exitBlock");
1181
+ return exitBlock;
1182
+ }
1183
+
1184
+ inline void setExitBlock(SVFBasicBlock *bb)
1185
+ {
1186
+ assert(!exitBlock && "have already set exit Basicblock!");
1187
+ exitBlock = bb;
1188
+ }
1189
+
1190
+
1191
+ u32_t inline arg_size() const
1192
+ {
1193
+ return allArgs.size();
1194
+ }
1195
+
1196
+ inline const ArgValVar* getArg(u32_t idx) const
1197
+ {
1198
+ assert (idx < allArgs.size() && "getArg() out of range!");
1199
+ return allArgs[idx];
1200
+ }
1201
+
1202
+ inline const SVFBasicBlock* front() const
1203
+ {
1204
+ return getEntryBlock();
1205
+ }
1206
+
1207
+ inline const SVFBasicBlock* back() const
1208
+ {
1209
+ assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
1210
+ /// Carefully! 'back' is just the last basic block of function,
1211
+ /// but not necessarily a exit basic block
1212
+ /// more refer to: https://github.com/SVF-tools/SVF/pull/1262
1213
+ return std::prev(bbGraph->end())->second;
1214
+ }
1215
+
1216
+ inline const_bb_iterator begin() const
1217
+ {
1218
+ return bbGraph->begin();
1219
+ }
1220
+
1221
+ inline const_bb_iterator end() const
1222
+ {
1223
+ return bbGraph->end();
1224
+ }
1225
+
1226
+ virtual bool isIsolatedNode() const;
1227
+
1228
+ virtual const std::string toString() const;
1229
+ };
1230
+ class FunValVar : public ValVar
1231
+ {
1232
+ friend class SVFIRWriter;
1233
+ friend class SVFIRReader;
1234
+ private:
1235
+ const FunObjVar* funObjVar;
1236
+
1237
+ public:
1238
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1239
+ //@{
1240
+ static inline bool classof(const FunValVar*)
1241
+ {
1242
+ return true;
1243
+ }
1244
+ static inline bool classof(const ValVar* node)
1245
+ {
1246
+ return node->getNodeKind() == FunValNode;
1247
+ }
1248
+ static inline bool classof(const SVFVar* node)
1249
+ {
1250
+ return node->getNodeKind() == FunValNode;
1251
+ }
1252
+ static inline bool classof(const GenericPAGNodeTy* node)
1253
+ {
1254
+ return node->getNodeKind() == FunValNode;
1255
+ }
1256
+ static inline bool classof(const SVFValue* node)
1257
+ {
1258
+ return node->getNodeKind() == FunValNode;
1259
+ }
1260
+ //@}
1261
+
1262
+ inline virtual const FunObjVar* getFunction() const
1263
+ {
1264
+ return funObjVar->getFunction();
1265
+ }
1266
+
1267
+ /// Constructor
1268
+ FunValVar(NodeID i, const ICFGNode* icn, const FunObjVar* cgn, const SVFType* svfType);
1269
+
1270
+
1271
+ virtual bool isPointer() const
1272
+ {
1273
+ return true;
1274
+ }
1275
+
1276
+ virtual const std::string toString() const;
1277
+ };
1278
+
1279
+
1280
+
1281
+ class GlobalValVar : public ValVar
1282
+ {
1283
+ friend class SVFIRWriter;
1284
+ friend class SVFIRReader;
1285
+
1286
+ public:
1287
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1288
+ //@{
1289
+ static inline bool classof(const GlobalValVar*)
1290
+ {
1291
+ return true;
1292
+ }
1293
+ static inline bool classof(const ValVar* node)
1294
+ {
1295
+ return node->getNodeKind() == GlobalValNode;
1296
+ }
1297
+ static inline bool classof(const SVFVar* node)
1298
+ {
1299
+ return node->getNodeKind() == GlobalValNode;
1300
+ }
1301
+ static inline bool classof(const GenericPAGNodeTy* node)
1302
+ {
1303
+ return node->getNodeKind() == GlobalValNode;
1304
+ }
1305
+ static inline bool classof(const SVFValue* node)
1306
+ {
1307
+ return node->getNodeKind() == GlobalValNode;
1308
+ }
1309
+ //@}
1310
+
1311
+ /// Constructor
1312
+ GlobalValVar(NodeID i, const ICFGNode* icn, const SVFType* svfType)
1313
+ : ValVar(i, svfType, icn, GlobalValNode)
1314
+ {
1315
+ type = svfType;
1316
+ }
1317
+
1318
+
1319
+ virtual const std::string toString() const;
1320
+ };
1321
+
1322
+ class ConstAggValVar: public ValVar
1323
+ {
1324
+ friend class SVFIRWriter;
1325
+ friend class SVFIRReader;
1326
+
1327
+ public:
1328
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1329
+ //@{
1330
+ static inline bool classof(const ConstAggValVar*)
1331
+ {
1332
+ return true;
1333
+ }
1334
+ static inline bool classof(const ValVar* node)
1335
+ {
1336
+ return node->getNodeKind() == ConstAggValNode;
1337
+ }
1338
+ static inline bool classof(const SVFVar* node)
1339
+ {
1340
+ return node->getNodeKind() == ConstAggValNode;
1341
+ }
1342
+ static inline bool classof(const GenericPAGNodeTy* node)
1343
+ {
1344
+ return node->getNodeKind() == ConstAggValNode;
1345
+ }
1346
+ static inline bool classof(const SVFValue* node)
1347
+ {
1348
+ return node->getNodeKind() == ConstAggValNode;
1349
+ }
1350
+ //@}
1351
+
1352
+ /// Constructor
1353
+ ConstAggValVar(NodeID i, const ICFGNode* icn, const SVFType* svfTy)
1354
+ : ValVar(i, svfTy, icn, ConstAggValNode)
1355
+ {
1356
+ type = svfTy;
1357
+ }
1358
+
1359
+
1360
+ virtual bool isConstDataOrAggData() const
1361
+ {
1362
+ return true;
1363
+ }
1364
+
1365
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1366
+ {
1367
+ return true;
1368
+ }
1369
+
1370
+ virtual const std::string toString() const;
1371
+ };
1372
+
1373
+
1374
+ class ConstDataValVar : public ValVar
1375
+ {
1376
+ friend class SVFIRWriter;
1377
+ friend class SVFIRReader;
1378
+
1379
+ public:
1380
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1381
+ //@{
1382
+ static inline bool classof(const ConstDataValVar*)
1383
+ {
1384
+ return true;
1385
+ }
1386
+ static inline bool classof(const ValVar* node)
1387
+ {
1388
+ return isConstantDataValVar(node->getNodeKind());
1389
+ }
1390
+ static inline bool classof(const SVFVar* node)
1391
+ {
1392
+ return isConstantDataValVar(node->getNodeKind());
1393
+ }
1394
+ static inline bool classof(const GenericPAGNodeTy* node)
1395
+ {
1396
+ return isConstantDataValVar(node->getNodeKind());
1397
+ }
1398
+ static inline bool classof(const SVFValue* node)
1399
+ {
1400
+ return isConstantDataValVar(node->getNodeKind());
1401
+ }
1402
+ //@}
1403
+
1404
+ /// Constructor
1405
+ ConstDataValVar(NodeID i, const ICFGNode* icn, const SVFType* svfType,
1406
+ PNODEK ty = ConstDataValNode)
1407
+ : ValVar(i, svfType, icn, ty)
1408
+ {
1409
+
1410
+ }
1411
+
1412
+ virtual bool isConstDataOrAggData() const
1413
+ {
1414
+ return true;
1415
+ }
1416
+
1417
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1418
+ {
1419
+ return true;
1420
+ }
1421
+
1422
+ virtual const std::string toString() const;
1423
+ };
1424
+
1425
+ class BlackHoleValVar : public ConstDataValVar
1426
+ {
1427
+ friend class SVFIRWriter;
1428
+ friend class SVFIRReader;
1429
+
1430
+ public:
1431
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1432
+ //@{
1433
+ static inline bool classof(const BlackHoleValVar*)
1434
+ {
1435
+ return true;
1436
+ }
1437
+ static inline bool classof(const ConstDataValVar* node)
1438
+ {
1439
+ return node->getNodeKind() == BlackHoleValNode;
1440
+ }
1441
+ static inline bool classof(const ValVar* node)
1442
+ {
1443
+ return node->getNodeKind() == BlackHoleValNode;
1444
+ }
1445
+ static inline bool classof(const SVFVar* node)
1446
+ {
1447
+ return node->getNodeKind() == BlackHoleValNode;
1448
+ }
1449
+ static inline bool classof(const GenericPAGNodeTy* node)
1450
+ {
1451
+ return node->getNodeKind() == BlackHoleValNode;
1452
+ }
1453
+ static inline bool classof(const SVFValue* node)
1454
+ {
1455
+ return node->getNodeKind() == BlackHoleValNode;
1456
+ }
1457
+ //@}
1458
+
1459
+ /// Constructor
1460
+ BlackHoleValVar(NodeID i, const SVFType* svfType, PNODEK ty = BlackHoleValNode)
1461
+ : ConstDataValVar(i, nullptr, svfType, ty)
1462
+ {
1463
+
1464
+ }
1465
+
1466
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1467
+ {
1468
+ return false;
1469
+ }
1470
+
1471
+ virtual const std::string toString() const
1472
+ {
1473
+ return "BlackHoleValVar";
1474
+ }
1475
+ };
1476
+
1477
+ class ConstFPValVar : public ConstDataValVar
1478
+ {
1479
+ friend class SVFIRWriter;
1480
+ friend class SVFIRReader;
1481
+ private:
1482
+ double dval;
1483
+
1484
+ public:
1485
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1486
+ //@{
1487
+ static inline bool classof(const ConstFPValVar*)
1488
+ {
1489
+ return true;
1490
+ }
1491
+ static inline bool classof(const ConstDataValVar* node)
1492
+ {
1493
+ return node->getNodeKind() == ConstFPValNode;
1494
+ }
1495
+ static inline bool classof(const ValVar* node)
1496
+ {
1497
+ return node->getNodeKind() == ConstFPValNode;
1498
+ }
1499
+ static inline bool classof(const SVFVar* node)
1500
+ {
1501
+ return node->getNodeKind() == ConstFPValNode;
1502
+ }
1503
+ static inline bool classof(const GenericPAGNodeTy* node)
1504
+ {
1505
+ return node->getNodeKind() == ConstFPValNode;
1506
+ }
1507
+ static inline bool classof(const SVFValue* node)
1508
+ {
1509
+ return node->getNodeKind() == ConstFPValNode;
1510
+ }
1511
+ //@}
1512
+
1513
+ inline double getFPValue() const
1514
+ {
1515
+ return dval;
1516
+ }
1517
+
1518
+ /// Constructor
1519
+ ConstFPValVar(NodeID i, double dv,
1520
+ const ICFGNode* icn, const SVFType* svfType)
1521
+ : ConstDataValVar(i, icn, svfType, ConstFPValNode), dval(dv)
1522
+ {
1523
+ }
1524
+
1525
+ virtual const std::string toString() const;
1526
+ };
1527
+
1528
+ class ConstIntValVar : public ConstDataValVar
1529
+ {
1530
+ friend class SVFIRWriter;
1531
+ friend class SVFIRReader;
1532
+ private:
1533
+ u64_t zval;
1534
+ s64_t sval;
1535
+
1536
+ public:
1537
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1538
+ //@{
1539
+ static inline bool classof(const ConstIntValVar*)
1540
+ {
1541
+ return true;
1542
+ }
1543
+ static inline bool classof(const ConstDataValVar* node)
1544
+ {
1545
+ return node->getNodeKind() == ConstIntValNode;
1546
+ }
1547
+ static inline bool classof(const ValVar* node)
1548
+ {
1549
+ return node->getNodeKind() == ConstIntValNode;
1550
+ }
1551
+ static inline bool classof(const SVFVar* node)
1552
+ {
1553
+ return node->getNodeKind() == ConstIntValNode;
1554
+ }
1555
+ static inline bool classof(const GenericPAGNodeTy* node)
1556
+ {
1557
+ return node->getNodeKind() == ConstIntValNode;
1558
+ }
1559
+ static inline bool classof(const SVFValue* node)
1560
+ {
1561
+ return node->getNodeKind() == ConstIntValNode;
1562
+ }
1563
+ //@}
1564
+
1565
+ s64_t getSExtValue() const
1566
+ {
1567
+ return sval;
1568
+ }
1569
+
1570
+
1571
+ u64_t getZExtValue() const
1572
+ {
1573
+ return zval;
1574
+ }
1575
+
1576
+ /// Constructor
1577
+ ConstIntValVar(NodeID i, s64_t sv, u64_t zv, const ICFGNode* icn, const SVFType* svfType)
1578
+ : ConstDataValVar(i, icn, svfType, ConstIntValNode), zval(zv), sval(sv)
1579
+ {
1580
+
1581
+ }
1582
+ virtual const std::string toString() const;
1583
+ };
1584
+
1585
+ class ConstNullPtrValVar : public ConstDataValVar
1586
+ {
1587
+ friend class SVFIRWriter;
1588
+ friend class SVFIRReader;
1589
+
1590
+ public:
1591
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1592
+ //@{
1593
+ static inline bool classof(const ConstNullPtrValVar*)
1594
+ {
1595
+ return true;
1596
+ }
1597
+ static inline bool classof(const ConstDataValVar* node)
1598
+ {
1599
+ return node->getNodeKind() == ConstNullptrValNode;
1600
+ }
1601
+ static inline bool classof(const ValVar* node)
1602
+ {
1603
+ return node->getNodeKind() == ConstNullptrValNode;
1604
+ }
1605
+ static inline bool classof(const SVFVar* node)
1606
+ {
1607
+ return node->getNodeKind() == ConstNullptrValNode;
1608
+ }
1609
+ static inline bool classof(const GenericPAGNodeTy* node)
1610
+ {
1611
+ return node->getNodeKind() == ConstNullptrValNode;
1612
+ }
1613
+ static inline bool classof(const SVFValue* node)
1614
+ {
1615
+ return node->getNodeKind() == ConstNullptrValNode;
1616
+ }
1617
+ //@}
1618
+
1619
+ /// Constructor
1620
+ ConstNullPtrValVar(NodeID i, const ICFGNode* icn, const SVFType* svfType)
1621
+ : ConstDataValVar(i, icn, svfType, ConstNullptrValNode)
1622
+ {
1623
+
1624
+ }
1625
+
1626
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1627
+ {
1628
+ return false;
1629
+ }
1630
+
1631
+ virtual const std::string toString() const;
1632
+ };
1633
+
1634
+ class GlobalObjVar : public BaseObjVar
1635
+ {
1636
+ friend class SVFIRWriter;
1637
+ friend class SVFIRReader;
1638
+
1639
+ private:
1640
+ /// Constructor to create empty ObjVar (for SVFIRReader/deserialization)
1641
+ GlobalObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, GlobalObjNode) {}
1642
+
1643
+ public:
1644
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1645
+ //@{
1646
+ static inline bool classof(const GlobalObjVar*)
1647
+ {
1648
+ return true;
1649
+ }
1650
+ static inline bool classof(const BaseObjVar* node)
1651
+ {
1652
+ return node->getNodeKind() == GlobalObjNode;
1653
+ }
1654
+ static inline bool classof(const ObjVar* node)
1655
+ {
1656
+ return node->getNodeKind() == GlobalObjNode;
1657
+ }
1658
+ static inline bool classof(const SVFVar* node)
1659
+ {
1660
+ return node->getNodeKind() == GlobalObjNode;
1661
+ }
1662
+ static inline bool classof(const GenericPAGNodeTy* node)
1663
+ {
1664
+ return node->getNodeKind() == GlobalObjNode;
1665
+ }
1666
+ static inline bool classof(const SVFValue* node)
1667
+ {
1668
+ return node->getNodeKind() == GlobalObjNode;
1669
+ }
1670
+ //@}
1671
+
1672
+ /// Constructor
1673
+ GlobalObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node,
1674
+ PNODEK ty = GlobalObjNode): BaseObjVar(i, ti, svfType, node, ty)
1675
+ {
1676
+
1677
+ }
1678
+
1679
+
1680
+ virtual const std::string toString() const;
1681
+ };
1682
+
1683
+ class ConstAggObjVar : public BaseObjVar
1684
+ {
1685
+ friend class SVFIRWriter;
1686
+ friend class SVFIRReader;
1687
+
1688
+ public:
1689
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1690
+ //@{
1691
+ static inline bool classof(const ConstAggObjVar*)
1692
+ {
1693
+ return true;
1694
+ }
1695
+ static inline bool classof(const BaseObjVar* node)
1696
+ {
1697
+ return node->getNodeKind() == ConstAggObjNode;
1698
+ }
1699
+
1700
+ static inline bool classof(const ObjVar* node)
1701
+ {
1702
+ return node->getNodeKind() == ConstAggObjNode;
1703
+ }
1704
+ static inline bool classof(const SVFVar* node)
1705
+ {
1706
+ return node->getNodeKind() == ConstAggObjNode;
1707
+ }
1708
+ static inline bool classof(const GenericPAGNodeTy* node)
1709
+ {
1710
+ return node->getNodeKind() == ConstAggObjNode;
1711
+ }
1712
+ static inline bool classof(const SVFValue* node)
1713
+ {
1714
+ return node->getNodeKind() == ConstAggObjNode;
1715
+ }
1716
+ //@}
1717
+
1718
+ /// Constructor
1719
+ ConstAggObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1720
+ : BaseObjVar(i, ti, svfType, node, ConstAggObjNode)
1721
+ {
1722
+
1723
+ }
1724
+
1725
+ virtual bool isConstDataOrAggData() const
1726
+ {
1727
+ return true;
1728
+ }
1729
+
1730
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1731
+ {
1732
+ return true;
1733
+ }
1734
+
1735
+ virtual const std::string toString() const;
1736
+ };
1737
+
1738
+ class ConstDataObjVar : public BaseObjVar
1739
+ {
1740
+ friend class SVFIRWriter;
1741
+ friend class SVFIRReader;
1742
+
1743
+ protected:
1744
+ /// Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
1745
+ ConstDataObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, ConstDataObjNode) {}
1746
+
1747
+ public:
1748
+ //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
1749
+ static inline bool classof(const ConstDataObjVar*)
1750
+ {
1751
+ return true;
1752
+ }
1753
+ static inline bool classof(const BaseObjVar* node)
1754
+ {
1755
+ return isConstantDataObjVarKinds(node->getNodeKind());
1756
+ }
1757
+ static inline bool classof(const SVFVar* node)
1758
+ {
1759
+ return isConstantDataObjVarKinds(node->getNodeKind());
1760
+ }
1761
+ static inline bool classof(const ObjVar* node)
1762
+ {
1763
+ return isConstantDataObjVarKinds(node->getNodeKind());
1764
+ }
1765
+ static inline bool classof(const GenericPAGNodeTy* node)
1766
+ {
1767
+ return isConstantDataObjVarKinds(node->getNodeKind());
1768
+ }
1769
+
1770
+ static inline bool classof(const SVFValue* node)
1771
+ {
1772
+ return isConstantDataObjVarKinds(node->getNodeKind());
1773
+ }
1774
+ //@}
1775
+
1776
+ /// Constructor
1777
+ ConstDataObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node, PNODEK ty = ConstDataObjNode)
1778
+ : BaseObjVar(i, ti, svfType, node, ty)
1779
+ {
1780
+ }
1781
+
1782
+ virtual bool isConstDataOrAggData() const
1783
+ {
1784
+ return true;
1785
+ }
1786
+
1787
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1788
+ {
1789
+ return true;
1790
+ }
1791
+
1792
+ virtual const std::string toString() const;
1793
+ };
1794
+
1795
+ class ConstFPObjVar : public ConstDataObjVar
1796
+ {
1797
+ friend class SVFIRWriter;
1798
+ friend class SVFIRReader;
1799
+
1800
+ private:
1801
+ /// Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
1802
+ ConstFPObjVar(NodeID i, const ICFGNode* node) : ConstDataObjVar(i, node) {}
1803
+
1804
+ private:
1805
+ float dval;
1806
+
1807
+ public:
1808
+ //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
1809
+ static inline bool classof(const ConstFPObjVar*)
1810
+ {
1811
+ return true;
1812
+ }
1813
+ static inline bool classof(const ConstDataObjVar* node)
1814
+ {
1815
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1816
+ }
1817
+ static inline bool classof(const BaseObjVar* node)
1818
+ {
1819
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1820
+ }
1821
+
1822
+ static inline bool classof(const SVFVar* node)
1823
+ {
1824
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1825
+ }
1826
+
1827
+ static inline bool classof(const ObjVar* node)
1828
+ {
1829
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1830
+ }
1831
+
1832
+ static inline bool classof(const GenericPAGNodeTy* node)
1833
+ {
1834
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1835
+ }
1836
+
1837
+ static inline bool classof(const SVFValue* node)
1838
+ {
1839
+ return node->getNodeKind() == SVFVar::ConstFPObjNode;
1840
+ }
1841
+ //@}
1842
+
1843
+ /// Constructor
1844
+ ConstFPObjVar(NodeID i, double dv, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1845
+ : ConstDataObjVar(i, ti, svfType, node, ConstFPObjNode), dval(dv)
1846
+ {
1847
+ }
1848
+
1849
+ inline double getFPValue() const
1850
+ {
1851
+ return dval;
1852
+ }
1853
+
1854
+
1855
+ virtual const std::string toString() const;
1856
+ };
1857
+
1858
+ class ConstIntObjVar : public ConstDataObjVar
1859
+ {
1860
+ friend class SVFIRWriter;
1861
+ friend class SVFIRReader;
1862
+
1863
+ private:
1864
+ /// Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
1865
+ ConstIntObjVar(NodeID i, const ICFGNode* node) : ConstDataObjVar(i, node) {}
1866
+
1867
+ private:
1868
+ u64_t zval;
1869
+ s64_t sval;
1870
+
1871
+ public:
1872
+ //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
1873
+ static inline bool classof(const ConstIntObjVar*)
1874
+ {
1875
+ return true;
1876
+ }
1877
+
1878
+ static inline bool classof(const ConstDataObjVar* node)
1879
+ {
1880
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1881
+ }
1882
+
1883
+ static inline bool classof(const BaseObjVar* node)
1884
+ {
1885
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1886
+ }
1887
+
1888
+ static inline bool classof(const SVFVar* node)
1889
+ {
1890
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1891
+ }
1892
+ static inline bool classof(const ObjVar* node)
1893
+ {
1894
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1895
+ }
1896
+ static inline bool classof(const GenericPAGNodeTy* node)
1897
+ {
1898
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1899
+ }
1900
+
1901
+ static inline bool classof(const SVFValue* node)
1902
+ {
1903
+ return node->getNodeKind() == SVFVar::ConstIntObjNode;
1904
+ }
1905
+
1906
+ s64_t getSExtValue() const
1907
+ {
1908
+ return sval;
1909
+ }
1910
+
1911
+
1912
+ u64_t getZExtValue() const
1913
+ {
1914
+ return zval;
1915
+ }
1916
+ //@}
1917
+
1918
+ /// Constructor
1919
+ ConstIntObjVar(NodeID i, s64_t sv, u64_t zv, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1920
+ : ConstDataObjVar(i, ti, svfType, node, ConstIntObjNode), zval(zv), sval(sv)
1921
+ {
1922
+ }
1923
+
1924
+
1925
+ virtual const std::string toString() const;
1926
+ };
1927
+
1928
+ class ConstNullPtrObjVar : public ConstDataObjVar
1929
+ {
1930
+ friend class SVFIRWriter;
1931
+ friend class SVFIRReader;
1932
+
1933
+ private:
1934
+ /// Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
1935
+ ConstNullPtrObjVar(NodeID i, const ICFGNode* node) : ConstDataObjVar(i, node) {}
1936
+
1937
+ public:
1938
+ //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
1939
+ static inline bool classof(const ConstNullPtrObjVar*)
1940
+ {
1941
+ return true;
1942
+ }
1943
+
1944
+ static inline bool classof(const ConstDataObjVar* node)
1945
+ {
1946
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1947
+ }
1948
+
1949
+ static inline bool classof(const BaseObjVar* node)
1950
+ {
1951
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1952
+ }
1953
+
1954
+ static inline bool classof(const SVFVar* node)
1955
+ {
1956
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1957
+ }
1958
+ static inline bool classof(const ObjVar* node)
1959
+ {
1960
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1961
+ }
1962
+ static inline bool classof(const GenericPAGNodeTy* node)
1963
+ {
1964
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1965
+ }
1966
+
1967
+ static inline bool classof(const SVFValue* node)
1968
+ {
1969
+ return node->getNodeKind() == SVFVar::ConstNullptrObjNode;
1970
+ }
1971
+ //@}
1972
+
1973
+ /// Constructor
1974
+ ConstNullPtrObjVar(NodeID i, ObjTypeInfo* ti, const SVFType* svfType, const ICFGNode* node)
1975
+ : ConstDataObjVar(i, ti, svfType, node, ConstNullptrObjNode)
1976
+ {
1977
+ }
1978
+ virtual bool isConstDataOrAggDataButNotNullPtr() const
1979
+ {
1980
+ return false;
1981
+ }
1982
+ virtual const std::string toString() const;
1983
+ };
1984
+ /*
1985
+ * Unique Return node of a procedure
1986
+ */
1987
+ class RetValPN : public ValVar
1988
+ {
1989
+ friend class SVFIRWriter;
1990
+ friend class SVFIRReader;
1991
+
1992
+ private:
1993
+ const FunObjVar* callGraphNode;
1994
+ private:
1995
+ /// Constructor to create empty RetValPN (for SVFIRReader/deserialization)
1996
+ RetValPN(NodeID i) : ValVar(i, RetValNode) {}
1997
+
1998
+ public:
1999
+ //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
2000
+ static inline bool classof(const RetValPN*)
2001
+ {
2002
+ return true;
2003
+ }
2004
+ static inline bool classof(const SVFVar* node)
2005
+ {
2006
+ return node->getNodeKind() == SVFVar::RetValNode;
2007
+ }
2008
+ static inline bool classof(const ValVar* node)
2009
+ {
2010
+ return node->getNodeKind() == SVFVar::RetValNode;
2011
+ }
2012
+ static inline bool classof(const GenericPAGNodeTy* node)
2013
+ {
2014
+ return node->getNodeKind() == SVFVar::RetValNode;
2015
+ }
2016
+ static inline bool classof(const SVFValue* node)
2017
+ {
2018
+ return node->getNodeKind() == SVFVar::RetValNode;
2019
+ }
2020
+ //@}
2021
+
2022
+
2023
+ /// Constructor
2024
+ RetValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn);
2025
+
2026
+ inline const FunObjVar* getCallGraphNode() const
2027
+ {
2028
+ return callGraphNode;
2029
+ }
2030
+
2031
+ virtual const FunObjVar* getFunction() const;
2032
+
2033
+ virtual bool isPointer() const;
2034
+
2035
+ /// Return name of a LLVM value
2036
+ const std::string getValueName() const;
2037
+
2038
+ virtual const std::string toString() const;
2039
+ };
2040
+
2041
+ /*
2042
+ * Unique vararg node of a procedure
2043
+ */
2044
+ class VarArgValPN : public ValVar
2045
+ {
2046
+ friend class SVFIRWriter;
2047
+ friend class SVFIRReader;
2048
+ private:
2049
+ const FunObjVar* callGraphNode;
2050
+
2051
+ private:
2052
+ /// Constructor to create empty VarArgValPN (for SVFIRReader/deserialization)
2053
+ VarArgValPN(NodeID i) : ValVar(i, VarargValNode) {}
2054
+
2055
+ public:
2056
+ //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
2057
+ static inline bool classof(const VarArgValPN*)
2058
+ {
2059
+ return true;
2060
+ }
2061
+ static inline bool classof(const SVFVar* node)
2062
+ {
2063
+ return node->getNodeKind() == SVFVar::VarargValNode;
2064
+ }
2065
+ static inline bool classof(const ValVar* node)
2066
+ {
2067
+ return node->getNodeKind() == SVFVar::VarargValNode;
2068
+ }
2069
+ static inline bool classof(const GenericPAGNodeTy* node)
2070
+ {
2071
+ return node->getNodeKind() == SVFVar::VarargValNode;
2072
+ }
2073
+ static inline bool classof(const SVFValue* node)
2074
+ {
2075
+ return node->getNodeKind() == SVFVar::VarargValNode;
2076
+ }
2077
+ //@}
2078
+
2079
+ /// Constructor
2080
+ VarArgValPN(NodeID i, const FunObjVar* node, const SVFType* svfType, const ICFGNode* icn)
2081
+ : ValVar(i, svfType, icn, VarargValNode), callGraphNode(node)
2082
+ {
2083
+ }
2084
+
2085
+ virtual const FunObjVar* getFunction() const;
2086
+
2087
+ /// Return name of a LLVM value
2088
+ const std::string getValueName() const;
2089
+
2090
+ virtual bool isPointer() const
2091
+ {
2092
+ return true;
2093
+ }
2094
+ virtual const std::string toString() const;
2095
+ };
2096
+
2097
+ /*
2098
+ * Dummy variable without any LLVM value
2099
+ */
2100
+ class DummyValVar: public ValVar
2101
+ {
2102
+ friend class SVFIRWriter;
2103
+ friend class SVFIRReader;
2104
+
2105
+ public:
2106
+ //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
2107
+ static inline bool classof(const DummyValVar*)
2108
+ {
2109
+ return true;
2110
+ }
2111
+ static inline bool classof(const SVFVar* node)
2112
+ {
2113
+ return node->getNodeKind() == SVFVar::DummyValNode;
2114
+ }
2115
+ static inline bool classof(const ValVar* node)
2116
+ {
2117
+ return node->getNodeKind() == SVFVar::DummyValNode;
2118
+ }
2119
+ static inline bool classof(const GenericPAGNodeTy* node)
2120
+ {
2121
+ return node->getNodeKind() == SVFVar::DummyValNode;
2122
+ }
2123
+ static inline bool classof(const SVFValue* node)
2124
+ {
2125
+ return node->getNodeKind() == SVFVar::DummyValNode;
2126
+ }
2127
+ //@}
2128
+
2129
+ /// Constructor
2130
+ DummyValVar(NodeID i, const ICFGNode* node, const SVFType* svfType = SVFType::getSVFPtrType())
2131
+ : ValVar(i, svfType, node, DummyValNode)
2132
+ {
2133
+ }
2134
+
2135
+ /// Return name of this node
2136
+ inline const std::string getValueName() const
2137
+ {
2138
+ return "dummyVal";
2139
+ }
2140
+
2141
+ virtual bool isPointer() const
2142
+ {
2143
+ return true;
2144
+ }
2145
+
2146
+ virtual const std::string toString() const;
2147
+ };
2148
+
2149
+ /*
2150
+ * Dummy object variable
2151
+ */
2152
+ class DummyObjVar: public BaseObjVar
2153
+ {
2154
+ friend class SVFIRWriter;
2155
+ friend class SVFIRReader;
2156
+
2157
+ private:
2158
+ /// Constructor to create empty DummyObjVar (for SVFIRReader/deserialization)
2159
+ DummyObjVar(NodeID i, const ICFGNode* node) : BaseObjVar(i, node, DummyObjNode) {}
2160
+
2161
+ public:
2162
+ //@{ Methods for support type inquiry through isa, cast, and dyn_cast:
2163
+ static inline bool classof(const DummyObjVar*)
2164
+ {
2165
+ return true;
2166
+ }
2167
+ static inline bool classof(const BaseObjVar* node)
2168
+ {
2169
+ return node->getNodeKind() == SVFVar::DummyObjNode;
2170
+ }
2171
+ static inline bool classof(const SVFVar* node)
2172
+ {
2173
+ return node->getNodeKind() == SVFVar::DummyObjNode;
2174
+ }
2175
+ static inline bool classof(const ObjVar* node)
2176
+ {
2177
+ return node->getNodeKind() == SVFVar::DummyObjNode;
2178
+ }
2179
+ static inline bool classof(const GenericPAGNodeTy* node)
2180
+ {
2181
+ return node->getNodeKind() == SVFVar::DummyObjNode;
2182
+ }
2183
+
2184
+ static inline bool classof(const SVFValue* node)
2185
+ {
2186
+ return node->getNodeKind() == SVFVar::DummyObjNode;
2187
+ }
2188
+ //@}
2189
+
2190
+ /// Constructor
2191
+ DummyObjVar(NodeID i, ObjTypeInfo* ti, const ICFGNode* node, const SVFType* svfType = SVFType::getSVFPtrType())
2192
+ : BaseObjVar(i, ti, svfType, node, DummyObjNode)
2193
+ {
2194
+ }
2195
+
2196
+ /// Return name of this node
2197
+ inline const std::string getValueName() const
2198
+ {
2199
+ return "dummyObj";
2200
+ }
2201
+
2202
+ virtual bool isPointer() const
2203
+ {
2204
+ return true;
2205
+ }
2206
+
2207
+ virtual const std::string toString() const;
2208
+ };
2209
+
2210
+ } // End namespace SVF
2211
+
2212
+ #endif /* INCLUDE_SVFIR_SVFVARIABLE_H_ */