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,1330 @@
1
+ //===- SVFStatements.h -- SVF statements-------------------------------------------//
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
+ /*
25
+ * SVFStatements.h
26
+ *
27
+ * Created on: Nov 10, 2013
28
+ * Author: Yulei Sui
29
+ */
30
+
31
+ #ifndef INCLUDE_SVFIR_SVFSTATEMENT_H_
32
+ #define INCLUDE_SVFIR_SVFSTATEMENT_H_
33
+
34
+ #include "Graphs/GenericGraph.h"
35
+ #include "MemoryModel/AccessPath.h"
36
+
37
+ namespace SVF
38
+ {
39
+
40
+ class SVFVar;
41
+ class ICFGNode;
42
+ class IntraICFGNode;
43
+ class CallICFGNode;
44
+ class FunEntryICFGNode;
45
+ class FunExitICFGNode;
46
+ class SVFBasicBlock;
47
+
48
+ /*
49
+ * SVFIR program statements (PAGEdges)
50
+ */
51
+ typedef GenericEdge<SVFVar> GenericPAGEdgeTy;
52
+ class SVFStmt : public GenericPAGEdgeTy
53
+ {
54
+ friend class SVFIRWriter;
55
+ friend class SVFIRReader;
56
+
57
+ public:
58
+ /// Types of SVFIR statements
59
+ /// Gep represents (base + offset) for field sensitivity
60
+ /// ThreadFork/ThreadJoin is to model parameter passings between thread
61
+ /// spawners and spawnees.
62
+ enum PEDGEK
63
+ {
64
+ Addr,
65
+ Copy,
66
+ Store,
67
+ Load,
68
+ Call,
69
+ Ret,
70
+ Gep,
71
+ Phi,
72
+ Select,
73
+ Cmp,
74
+ BinaryOp,
75
+ UnaryOp,
76
+ Branch,
77
+ ThreadFork,
78
+ ThreadJoin
79
+ };
80
+
81
+ private:
82
+ const SVFVar* value; ///< LLVM value
83
+ const SVFBasicBlock* basicBlock; ///< LLVM BasicBlock
84
+ ICFGNode* icfgNode; ///< ICFGNode
85
+ EdgeID edgeId; ///< Edge ID
86
+
87
+ protected:
88
+ /// Private constructor for reading SVFIR from file without side-effect
89
+ SVFStmt(GEdgeFlag k)
90
+ : GenericPAGEdgeTy({}, {}, k), value{}, basicBlock{}, icfgNode{}
91
+ {
92
+ }
93
+
94
+ public:
95
+ static u32_t totalEdgeNum; ///< Total edge number
96
+
97
+ /// Constructor
98
+ SVFStmt(SVFVar* s, SVFVar* d, GEdgeFlag k, bool real = true);
99
+ /// Destructor
100
+ ~SVFStmt() {}
101
+
102
+ /// ClassOf
103
+ //@{
104
+ static inline bool classof(const SVFStmt*)
105
+ {
106
+ return true;
107
+ }
108
+ static inline bool classof(const GenericPAGEdgeTy* edge)
109
+ {
110
+ return edge->getEdgeKind() == SVFStmt::Addr ||
111
+ edge->getEdgeKind() == SVFStmt::Copy ||
112
+ edge->getEdgeKind() == SVFStmt::Store ||
113
+ edge->getEdgeKind() == SVFStmt::Load ||
114
+ edge->getEdgeKind() == SVFStmt::Call ||
115
+ edge->getEdgeKind() == SVFStmt::Ret ||
116
+ edge->getEdgeKind() == SVFStmt::Gep ||
117
+ edge->getEdgeKind() == SVFStmt::Phi ||
118
+ edge->getEdgeKind() == SVFStmt::Select ||
119
+ edge->getEdgeKind() == SVFStmt::Cmp ||
120
+ edge->getEdgeKind() == SVFStmt::BinaryOp ||
121
+ edge->getEdgeKind() == SVFStmt::UnaryOp ||
122
+ edge->getEdgeKind() == SVFStmt::Branch ||
123
+ edge->getEdgeKind() == SVFStmt::ThreadFork ||
124
+ edge->getEdgeKind() == SVFStmt::ThreadJoin;
125
+ }
126
+ ///@}
127
+
128
+ /// Return Edge ID
129
+ inline EdgeID getEdgeID() const
130
+ {
131
+ return edgeId;
132
+ }
133
+ /// Whether src and dst nodes are both of pointer type
134
+ bool isPTAEdge() const;
135
+
136
+ /// Get/set methods for llvm instruction
137
+ //@{
138
+
139
+ inline void setValue(const SVFVar* val)
140
+ {
141
+ value = val;
142
+ }
143
+ inline const SVFVar* getValue() const
144
+ {
145
+ return value;
146
+ }
147
+
148
+ inline void setBB(const SVFBasicBlock* bb)
149
+ {
150
+ basicBlock = bb;
151
+ }
152
+ inline const SVFBasicBlock* getBB() const
153
+ {
154
+ return basicBlock;
155
+ }
156
+ inline void setICFGNode(ICFGNode* node)
157
+ {
158
+ icfgNode = node;
159
+ }
160
+ inline ICFGNode* getICFGNode() const
161
+ {
162
+ return icfgNode;
163
+ }
164
+ //@}
165
+
166
+ /// Compute the unique edgeFlag value from edge kind and second variable
167
+ /// operand for MultiOpndStmt.
168
+ static inline GEdgeFlag makeEdgeFlagWithAddionalOpnd(GEdgeKind k,
169
+ const SVFVar* var)
170
+ {
171
+ auto it_inserted = var2LabelMap.emplace(var, multiOpndLabelCounter);
172
+ if (it_inserted.second)
173
+ ++multiOpndLabelCounter;
174
+ u64_t label = it_inserted.first->second;
175
+ return (label << EdgeKindMaskBits) | k;
176
+ }
177
+
178
+ /// Compute the unique edgeFlag value from edge kind and call site
179
+ /// Instruction.
180
+ static inline GEdgeFlag makeEdgeFlagWithCallInst(GEdgeKind k,
181
+ const ICFGNode* cs)
182
+ {
183
+ auto it_inserted = inst2LabelMap.emplace(cs, callEdgeLabelCounter);
184
+ if (it_inserted.second)
185
+ ++callEdgeLabelCounter;
186
+ u64_t label = it_inserted.first->second;
187
+ return (label << EdgeKindMaskBits) | k;
188
+ }
189
+
190
+ /// Compute the unique edgeFlag value from edge kind and store Instruction.
191
+ /// Two store instructions may share the same StorePAGEdge
192
+ static inline GEdgeFlag makeEdgeFlagWithStoreInst(GEdgeKind k,
193
+ const ICFGNode* store)
194
+ {
195
+ auto it_inserted = inst2LabelMap.emplace(store, storeEdgeLabelCounter);
196
+ if (it_inserted.second)
197
+ ++storeEdgeLabelCounter;
198
+ u64_t label = it_inserted.first->second;
199
+ return (label << EdgeKindMaskBits) | k;
200
+ }
201
+
202
+ virtual const std::string toString() const;
203
+
204
+ //@}
205
+ /// Overloading operator << for dumping SVFVar value
206
+ //@{
207
+ friend OutStream& operator<<(OutStream& o, const SVFStmt& edge)
208
+ {
209
+ o << edge.toString();
210
+ return o;
211
+ }
212
+ //@}
213
+
214
+ typedef GenericNode<SVFVar,SVFStmt>::GEdgeSetTy SVFStmtSetTy;
215
+ typedef Map<EdgeID, SVFStmtSetTy> PAGEdgeToSetMapTy;
216
+ typedef PAGEdgeToSetMapTy KindToSVFStmtMapTy;
217
+ typedef SVFStmtSetTy PAGEdgeSetTy;
218
+
219
+ private:
220
+ typedef Map<const ICFGNode*, u32_t> Inst2LabelMap;
221
+ typedef Map<const SVFVar*, u32_t> Var2LabelMap;
222
+ static Inst2LabelMap inst2LabelMap; ///< Call site Instruction to label map
223
+ static Var2LabelMap var2LabelMap; ///< Second operand of MultiOpndStmt to label map
224
+ static u64_t callEdgeLabelCounter; ///< Call site Instruction counter
225
+ static u64_t storeEdgeLabelCounter; ///< Store Instruction counter
226
+ static u64_t multiOpndLabelCounter; ///< MultiOpndStmt counter
227
+ };
228
+
229
+ /*
230
+ Parent class of Addr, Copy, Store, Load, Call, Ret, NormalGep, VariantGep, ThreadFork, ThreadJoin
231
+ connecting RHS expression and LHS expression with an assignment (e.g., LHSExpr = RHSExpr)
232
+ Only one operand on the right hand side of an assignment
233
+ */
234
+ class AssignStmt : public SVFStmt
235
+ {
236
+ friend class SVFIRWriter;
237
+ friend class SVFIRReader;
238
+
239
+ private:
240
+ AssignStmt(); ///< place holder
241
+ AssignStmt(const AssignStmt &); ///< place holder
242
+ void operator=(const AssignStmt &); ///< place holder
243
+ SVFVar* getSrcNode(); ///< not allowed, use getRHSVar() instead
244
+ SVFVar* getDstNode(); ///< not allowed, use getLHSVar() instead
245
+ NodeID getSrcID(); ///< not allowed, use getRHSVarID() instead
246
+ NodeID getDstID(); ///< not allowed, use getLHSVarID() instead
247
+
248
+ protected:
249
+ /// constructor
250
+ AssignStmt(SVFVar* s, SVFVar* d, GEdgeFlag k) : SVFStmt(s, d, k) {}
251
+ /// Constructor to create empty AssignStmt (for SVFIRReader/serialization)
252
+ AssignStmt(GEdgeFlag k) : SVFStmt(k) {}
253
+
254
+ public:
255
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
256
+ //@{
257
+ static inline bool classof(const AssignStmt*)
258
+ {
259
+ return true;
260
+ }
261
+ static inline bool classof(const SVFStmt* edge)
262
+ {
263
+ return edge->getEdgeKind() == SVFStmt::Addr ||
264
+ edge->getEdgeKind() == SVFStmt::Copy ||
265
+ edge->getEdgeKind() == SVFStmt::Store ||
266
+ edge->getEdgeKind() == SVFStmt::Load ||
267
+ edge->getEdgeKind() == SVFStmt::Call ||
268
+ edge->getEdgeKind() == SVFStmt::Ret ||
269
+ edge->getEdgeKind() == SVFStmt::Gep ||
270
+ edge->getEdgeKind() == SVFStmt::ThreadFork ||
271
+ edge->getEdgeKind() == SVFStmt::ThreadJoin;
272
+ }
273
+ static inline bool classof(const GenericPAGEdgeTy* edge)
274
+ {
275
+ return edge->getEdgeKind() == SVFStmt::Addr ||
276
+ edge->getEdgeKind() == SVFStmt::Copy ||
277
+ edge->getEdgeKind() == SVFStmt::Store ||
278
+ edge->getEdgeKind() == SVFStmt::Load ||
279
+ edge->getEdgeKind() == SVFStmt::Call ||
280
+ edge->getEdgeKind() == SVFStmt::Ret ||
281
+ edge->getEdgeKind() == SVFStmt::Gep ||
282
+ edge->getEdgeKind() == SVFStmt::ThreadFork ||
283
+ edge->getEdgeKind() == SVFStmt::ThreadJoin;
284
+ }
285
+ //@}
286
+
287
+ inline SVFVar* getRHSVar() const
288
+ {
289
+ return SVFStmt::getSrcNode();
290
+ }
291
+ inline SVFVar* getLHSVar() const
292
+ {
293
+ return SVFStmt::getDstNode();
294
+ }
295
+ inline NodeID getRHSVarID() const
296
+ {
297
+ return SVFStmt::getSrcID();
298
+ }
299
+ inline NodeID getLHSVarID() const
300
+ {
301
+ return SVFStmt::getDstID();
302
+ }
303
+
304
+ virtual const std::string toString() const = 0;
305
+ };
306
+
307
+ /*!
308
+ * Address statement (memory allocations)
309
+ */
310
+ class AddrStmt: public AssignStmt
311
+ {
312
+ friend class SVFIRWriter;
313
+ friend class SVFIRReader;
314
+
315
+ private:
316
+ /// Constructs empty AddrStmt (for SVFIRReader/serialization)
317
+ AddrStmt() : AssignStmt(SVFStmt::Addr) {}
318
+ AddrStmt(const AddrStmt&); ///< place holder
319
+ void operator=(const AddrStmt&); ///< place holder
320
+
321
+ std::vector<SVFVar*> arrSize; ///< Array size of the allocated memory
322
+
323
+ public:
324
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
325
+ //@{
326
+ static inline bool classof(const AddrStmt*)
327
+ {
328
+ return true;
329
+ }
330
+ static inline bool classof(const SVFStmt* edge)
331
+ {
332
+ return edge->getEdgeKind() == SVFStmt::Addr;
333
+ }
334
+ static inline bool classof(const GenericPAGEdgeTy* edge)
335
+ {
336
+ return edge->getEdgeKind() == SVFStmt::Addr;
337
+ }
338
+ //@}
339
+
340
+ /// constructor
341
+ AddrStmt(SVFVar* s, SVFVar* d) : AssignStmt(s, d, SVFStmt::Addr) {}
342
+
343
+ virtual const std::string toString() const override;
344
+
345
+ inline void addArrSize(SVFVar* size) //TODO:addSizeVar
346
+ {
347
+ arrSize.push_back(size);
348
+ }
349
+
350
+ ///< get array size of the allocated memory
351
+ inline const std::vector<SVFVar*>& getArrSize() const //TODO:getSizeVars
352
+ {
353
+ return arrSize;
354
+ }
355
+
356
+ };
357
+
358
+ /*!
359
+ * Copy statements (simple assignment and casting)
360
+ */
361
+ class CopyStmt: public AssignStmt
362
+ {
363
+ friend class SVFIRWriter;
364
+ friend class SVFIRReader;
365
+ private:
366
+ /// Constructs empty CopyStmt (for SVFIRReader/serialization)
367
+ CopyStmt() : AssignStmt(SVFStmt::Copy) {}
368
+ CopyStmt(const CopyStmt&); ///< place holder
369
+ void operator=(const CopyStmt&); ///< place holder
370
+ public:
371
+ enum CopyKind
372
+ {
373
+ COPYVAL, // Value copies (default one)
374
+ ZEXT, // Zero extend integers
375
+ SEXT, // Sign extend integers
376
+ BITCAST, // Type cast
377
+ TRUNC, // Truncate integers
378
+ FPTRUNC, // Truncate floating point
379
+ FPTOUI, // floating point -> UInt
380
+ FPTOSI, // floating point -> SInt
381
+ UITOFP, // UInt -> floating point
382
+ SITOFP, // SInt -> floating point
383
+ INTTOPTR, // Integer -> Pointer
384
+ PTRTOINT // Pointer -> Integer
385
+ };
386
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
387
+ //@{
388
+ static inline bool classof(const CopyStmt*)
389
+ {
390
+ return true;
391
+ }
392
+ static inline bool classof(const SVFStmt* edge)
393
+ {
394
+ return edge->getEdgeKind() == SVFStmt::Copy;
395
+ }
396
+ static inline bool classof(const GenericPAGEdgeTy* edge)
397
+ {
398
+ return edge->getEdgeKind() == SVFStmt::Copy;
399
+ }
400
+ //@}
401
+
402
+ /// Return the kind of the copy statement
403
+ inline u32_t getCopyKind() const
404
+ {
405
+ return copyKind;
406
+ }
407
+
408
+ inline bool isBitCast() const
409
+ {
410
+ return copyKind == BITCAST;
411
+ }
412
+
413
+ inline bool isValueCopy() const
414
+ {
415
+ return copyKind == COPYVAL;
416
+ }
417
+
418
+ inline bool isInt2Ptr() const
419
+ {
420
+ return copyKind == INTTOPTR;
421
+ }
422
+
423
+ inline bool isPtr2Int() const
424
+ {
425
+ return copyKind == PTRTOINT;
426
+ }
427
+
428
+ inline bool isZext() const
429
+ {
430
+ return copyKind == ZEXT;
431
+ }
432
+
433
+ inline bool isSext() const
434
+ {
435
+ return copyKind == SEXT;
436
+ }
437
+
438
+ /// constructor
439
+ CopyStmt(SVFVar* s, SVFVar* d, CopyKind k) : AssignStmt(s, d, SVFStmt::Copy), copyKind(k) {}
440
+
441
+ virtual const std::string toString() const override;
442
+ private:
443
+ u32_t copyKind;
444
+ };
445
+
446
+ /*!
447
+ * Store statement
448
+ */
449
+ class StoreStmt: public AssignStmt
450
+ {
451
+ friend class SVFIRWriter;
452
+ friend class SVFIRReader;
453
+
454
+ private:
455
+ /// Constructs empty StoreStmt (for SVFIRReader/serialization)
456
+ StoreStmt() : AssignStmt(SVFStmt::Store) {}
457
+ StoreStmt(const StoreStmt&); ///< place holder
458
+ void operator=(const StoreStmt&); ///< place holder
459
+
460
+ public:
461
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
462
+ //@{
463
+ static inline bool classof(const StoreStmt*)
464
+ {
465
+ return true;
466
+ }
467
+ static inline bool classof(const SVFStmt* edge)
468
+ {
469
+ return edge->getEdgeKind() == SVFStmt::Store;
470
+ }
471
+ static inline bool classof(const GenericPAGEdgeTy* edge)
472
+ {
473
+ return edge->getEdgeKind() == SVFStmt::Store;
474
+ }
475
+ //@}
476
+
477
+ /// constructor
478
+ StoreStmt(SVFVar* s, SVFVar* d, const ICFGNode* st);
479
+
480
+ virtual const std::string toString() const override;
481
+ };
482
+
483
+ /*!
484
+ * Load statement
485
+ */
486
+ class LoadStmt: public AssignStmt
487
+ {
488
+ friend class SVFIRWriter;
489
+ friend class SVFIRReader;
490
+
491
+ private:
492
+ /// Constructs empty LoadStmt (for SVFIRReader/serialization)
493
+ LoadStmt(): AssignStmt(SVFStmt::Load) {}
494
+ LoadStmt(const LoadStmt&); ///< place holder
495
+ void operator=(const LoadStmt&); ///< place holder
496
+
497
+ public:
498
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
499
+ //@{
500
+ static inline bool classof(const LoadStmt*)
501
+ {
502
+ return true;
503
+ }
504
+ static inline bool classof(const SVFStmt* edge)
505
+ {
506
+ return edge->getEdgeKind() == SVFStmt::Load;
507
+ }
508
+ static inline bool classof(const GenericPAGEdgeTy* edge)
509
+ {
510
+ return edge->getEdgeKind() == SVFStmt::Load;
511
+ }
512
+ //@}
513
+
514
+ /// constructor
515
+ LoadStmt(SVFVar* s, SVFVar* d) : AssignStmt(s, d, SVFStmt::Load) {}
516
+
517
+ virtual const std::string toString() const override;
518
+ };
519
+
520
+ /*!
521
+ * Gep statement for struct field access, array access and pointer arithmetic
522
+ */
523
+ class GepStmt: public AssignStmt
524
+ {
525
+ friend class SVFIRWriter;
526
+ friend class SVFIRReader;
527
+
528
+ private:
529
+ /// Constructs empty GepStmt (for SVFIRReader/serialization)
530
+ GepStmt() : AssignStmt(SVFStmt::Gep) {}
531
+ GepStmt(const GepStmt &); ///< place holder
532
+ void operator=(const GepStmt &); ///< place holder
533
+
534
+ AccessPath ap; ///< Access path of the GEP edge
535
+ bool variantField; ///< Gep statement with a variant field index (pointer arithmetic) for struct field access (e.g., p = &(q + f), where f is a variable)
536
+ public:
537
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
538
+ //@{
539
+ static inline bool classof(const GepStmt*)
540
+ {
541
+ return true;
542
+ }
543
+ static inline bool classof(const SVFStmt* edge)
544
+ {
545
+ return edge->getEdgeKind() == SVFStmt::Gep;
546
+ }
547
+ static inline bool classof(const GenericPAGEdgeTy* edge)
548
+ {
549
+ return edge->getEdgeKind() == SVFStmt::Gep;
550
+ }
551
+ //@}
552
+
553
+ inline const AccessPath& getAccessPath() const
554
+ {
555
+ return ap;
556
+ }
557
+ inline const AccessPath::IdxOperandPairs getOffsetVarAndGepTypePairVec() const
558
+ {
559
+ return getAccessPath().getIdxOperandPairVec();
560
+ }
561
+ /// Return TRUE if this is a constant location set.
562
+ inline bool isConstantOffset() const
563
+ {
564
+ return getAccessPath().isConstantOffset();
565
+ }
566
+
567
+ /// Return accumulated constant offset (when accessing array or struct) if this offset is a constant.
568
+ /// elemBytesize is the element byte size of an static alloc or heap alloc array
569
+ /// e.g. GepStmt* gep = **,
570
+ /// s32_t elemBytesize = LLVMUtil::SVFType2ByteSize(gep->getRHSVar()->getValue()->getType());
571
+ /// APOffset byteOffset = gep->accumulateConstantByteOffset(elemBytesize);
572
+ inline APOffset accumulateConstantByteOffset() const
573
+ {
574
+ return getAccessPath().computeConstantByteOffset();
575
+ }
576
+
577
+ /// Return accumulated constant offset (when accessing array or struct) if this offset is a constant.
578
+ inline APOffset accumulateConstantOffset() const
579
+ {
580
+ return getAccessPath().computeConstantOffset();
581
+ }
582
+ /// Field index of the gep statement if it access the field of a struct
583
+ inline APOffset getConstantStructFldIdx() const
584
+ {
585
+ assert(isVariantFieldGep()==false && "Can't retrieve the AccessPath if using a variable field index (pointer arithmetic) for struct field access ");
586
+ return getAccessPath().getConstantStructFldIdx();
587
+ }
588
+ /// Gep statement with a variant field index (pointer arithmetic) for struct field access
589
+ inline bool isVariantFieldGep() const
590
+ {
591
+ return variantField;
592
+ }
593
+
594
+ /// constructor
595
+ GepStmt(SVFVar* s, SVFVar* d, const AccessPath& ap, bool varfld = false)
596
+ : AssignStmt(s, d, SVFStmt::Gep), ap(ap), variantField(varfld)
597
+ {
598
+ }
599
+
600
+ virtual const std::string toString() const;
601
+
602
+ };
603
+
604
+
605
+ /*!
606
+ * Call
607
+ */
608
+ class CallPE: public AssignStmt
609
+ {
610
+ friend class SVFIRWriter;
611
+ friend class SVFIRReader;
612
+
613
+ private:
614
+ CallPE(const CallPE&); ///< place holder
615
+ void operator=(const CallPE&); ///< place holder
616
+
617
+ const CallICFGNode* call; /// the callsite statement calling from
618
+ const FunEntryICFGNode* entry; /// the function exit statement calling to
619
+ protected:
620
+ /// Constructs empty CallPE (for SVFIRReader/serialization)
621
+ CallPE(GEdgeFlag k = SVFStmt::Call) : AssignStmt(k), call{}, entry{} {}
622
+
623
+ public:
624
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
625
+ //@{
626
+ static inline bool classof(const CallPE*)
627
+ {
628
+ return true;
629
+ }
630
+ static inline bool classof(const SVFStmt* edge)
631
+ {
632
+ return edge->getEdgeKind() == SVFStmt::Call ||
633
+ edge->getEdgeKind() == SVFStmt::ThreadFork;
634
+ }
635
+ static inline bool classof(const GenericPAGEdgeTy* edge)
636
+ {
637
+ return edge->getEdgeKind() == SVFStmt::Call ||
638
+ edge->getEdgeKind() == SVFStmt::ThreadFork;
639
+ }
640
+ //@}
641
+
642
+ /// constructor
643
+ CallPE(SVFVar* s, SVFVar* d, const CallICFGNode* i,
644
+ const FunEntryICFGNode* e, GEdgeKind k = SVFStmt::Call);
645
+
646
+ /// Get method for the call instruction
647
+ //@{
648
+ inline const CallICFGNode* getCallInst() const
649
+ {
650
+ return call;
651
+ }
652
+ inline const CallICFGNode* getCallSite() const
653
+ {
654
+ return call;
655
+ }
656
+ inline const FunEntryICFGNode* getFunEntryICFGNode() const
657
+ {
658
+ return entry;
659
+ }
660
+ //@}
661
+
662
+ virtual const std::string toString() const override;
663
+ };
664
+
665
+ /*!
666
+ * Return
667
+ */
668
+ class RetPE: public AssignStmt
669
+ {
670
+ friend class SVFIRWriter;
671
+ friend class SVFIRReader;
672
+
673
+ private:
674
+ RetPE(const RetPE&); ///< place holder
675
+ void operator=(const RetPE&); ///< place holder
676
+
677
+ const CallICFGNode* call; /// the callsite statement returning to
678
+ const FunExitICFGNode* exit; /// the function exit statement returned from
679
+
680
+ protected:
681
+ /// Constructs empty RetPE (for SVFIRReader/serialization)
682
+ RetPE(GEdgeFlag k = SVFStmt::Ret) : AssignStmt(k), call{}, exit{} {}
683
+
684
+ public:
685
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
686
+ //@{
687
+ static inline bool classof(const RetPE*)
688
+ {
689
+ return true;
690
+ }
691
+ static inline bool classof(const SVFStmt* edge)
692
+ {
693
+ return edge->getEdgeKind() == SVFStmt::Ret ||
694
+ edge->getEdgeKind() == SVFStmt::ThreadJoin;
695
+ }
696
+ static inline bool classof(const GenericPAGEdgeTy* edge)
697
+ {
698
+ return edge->getEdgeKind() == SVFStmt::Ret ||
699
+ edge->getEdgeKind() == SVFStmt::ThreadJoin;
700
+ }
701
+ //@}
702
+
703
+ /// constructor
704
+ RetPE(SVFVar* s, SVFVar* d, const CallICFGNode* i, const FunExitICFGNode* e,
705
+ GEdgeKind k = SVFStmt::Ret);
706
+
707
+ /// Get method for call instruction at caller
708
+ //@{
709
+ inline const CallICFGNode* getCallInst() const
710
+ {
711
+ return call;
712
+ }
713
+ inline const CallICFGNode* getCallSite() const
714
+ {
715
+ return call;
716
+ }
717
+ inline const FunExitICFGNode* getFunExitICFGNode() const
718
+ {
719
+ return exit;
720
+ }
721
+ //@}
722
+
723
+ virtual const std::string toString() const override;
724
+ };
725
+
726
+ /*
727
+ * Program statements with multiple operands including BinaryOPStmt, CmpStmt and PhiStmt
728
+ */
729
+ class MultiOpndStmt : public SVFStmt
730
+ {
731
+ friend class SVFIRWriter;
732
+ friend class SVFIRReader;
733
+
734
+ public:
735
+ typedef std::vector<SVFVar*> OPVars;
736
+
737
+ private:
738
+ MultiOpndStmt(); ///< place holder
739
+ MultiOpndStmt(const MultiOpndStmt&); ///< place holder
740
+ void operator=(const MultiOpndStmt&); ///< place holder
741
+ SVFVar* getSrcNode(); ///< not allowed, use getOpVar(idx) instead
742
+ SVFVar* getDstNode(); ///< not allowed, use getRes() instead
743
+ NodeID getSrcID(); ///< not allowed, use getOpVarID(idx) instead
744
+ NodeID getDstID(); ///< not allowed, use getResID() instead
745
+
746
+ protected:
747
+ OPVars opVars;
748
+ /// Constructor, only used by subclasses but not external users
749
+ MultiOpndStmt(SVFVar* r, const OPVars& opnds, GEdgeFlag k);
750
+ /// Constructs empty MultiOpndStmt (for SVFIRReader/serialization)
751
+ MultiOpndStmt(GEdgeFlag k) : SVFStmt(k) {}
752
+
753
+ public:
754
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
755
+ //@{
756
+ static inline bool classof(const MultiOpndStmt*)
757
+ {
758
+ return true;
759
+ }
760
+ static inline bool classof(const SVFStmt* node)
761
+ {
762
+ return node->getEdgeKind() == Phi || node->getEdgeKind() == Select ||
763
+ node->getEdgeKind() == BinaryOp || node->getEdgeKind() == Cmp;
764
+ }
765
+ static inline bool classof(const GenericPAGEdgeTy* node)
766
+ {
767
+ return node->getEdgeKind() == Phi || node->getEdgeKind() == Select ||
768
+ node->getEdgeKind() == BinaryOp || node->getEdgeKind() == Cmp;
769
+ }
770
+ //@}
771
+ /// Operands and result at a BinaryNode e.g., p = q + r, `p` is resVar and
772
+ /// `r` is OpVar
773
+ //@{
774
+ /// Operand SVFVars
775
+ inline const SVFVar* getOpVar(u32_t pos) const
776
+ {
777
+ return opVars.at(pos);
778
+ }
779
+ /// Result SVFVar
780
+ inline const SVFVar* getRes() const
781
+ {
782
+ return SVFStmt::getDstNode();
783
+ }
784
+
785
+ NodeID getOpVarID(u32_t pos) const;
786
+ NodeID getResID() const;
787
+
788
+ inline u32_t getOpVarNum() const
789
+ {
790
+ return opVars.size();
791
+ }
792
+ inline const OPVars& getOpndVars() const
793
+ {
794
+ return opVars;
795
+ }
796
+ inline OPVars::const_iterator opVarBegin() const
797
+ {
798
+ return opVars.begin();
799
+ }
800
+ inline OPVars::const_iterator opVerEnd() const
801
+ {
802
+ return opVars.end();
803
+ }
804
+ //@}
805
+ };
806
+
807
+ /*!
808
+ * Phi statement (e.g., p = phi(q,r) which receives values from variables q and r from different paths)
809
+ * it is typically at a joint point of the control-flow graph
810
+ */
811
+ class PhiStmt: public MultiOpndStmt
812
+ {
813
+ friend class SVFIRWriter;
814
+ friend class SVFIRReader;
815
+
816
+ public:
817
+ typedef std::vector<const ICFGNode*> OpICFGNodeVec;
818
+
819
+ private:
820
+ /// Constructs empty PhiStmt (for SVFIRReader/serialization)
821
+ PhiStmt() : MultiOpndStmt(SVFStmt::Phi) {}
822
+ PhiStmt(const PhiStmt&); ///< place holder
823
+ void operator=(const PhiStmt&); ///< place holder
824
+
825
+ OpICFGNodeVec opICFGNodes;
826
+
827
+ public:
828
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
829
+ //@{
830
+ static inline bool classof(const PhiStmt*)
831
+ {
832
+ return true;
833
+ }
834
+ static inline bool classof(const SVFStmt* edge)
835
+ {
836
+ return edge->getEdgeKind() == SVFStmt::Phi;
837
+ }
838
+ static inline bool classof(const MultiOpndStmt* edge)
839
+ {
840
+ return edge->getEdgeKind() == SVFStmt::Phi;
841
+ }
842
+ static inline bool classof(const GenericPAGEdgeTy* edge)
843
+ {
844
+ return edge->getEdgeKind() == SVFStmt::Phi;
845
+ }
846
+ //@}
847
+
848
+ /// constructor
849
+ PhiStmt(SVFVar* s, const OPVars& opnds, const OpICFGNodeVec& icfgNodes)
850
+ : MultiOpndStmt(s, opnds, SVFStmt::Phi), opICFGNodes(icfgNodes)
851
+ {
852
+ assert(opnds.size() == icfgNodes.size() &&
853
+ "Numbers of operands and their ICFGNodes are not consistent?");
854
+ }
855
+ void addOpVar(SVFVar* op, const ICFGNode* inode)
856
+ {
857
+ opVars.push_back(op);
858
+ opICFGNodes.push_back(inode);
859
+ assert(opVars.size() == opICFGNodes.size() &&
860
+ "Numbers of operands and their ICFGNodes are not consistent?");
861
+ }
862
+
863
+ /// Return the corresponding ICFGNode of this operand
864
+ inline const ICFGNode* getOpICFGNode(u32_t op_idx) const
865
+ {
866
+ return opICFGNodes.at(op_idx);
867
+ }
868
+
869
+ /// Return true if this is a phi at the function exit
870
+ /// to receive one or multiple return values of this function
871
+ bool isFunctionRetPhi() const;
872
+
873
+ virtual const std::string toString() const override;
874
+ };
875
+
876
+ /*!
877
+ * Select statement (e.g., p ? q: r which receives values from variables q and r based on condition p)
878
+ */
879
+ class SelectStmt: public MultiOpndStmt
880
+ {
881
+ friend class SVFIRWriter;
882
+ friend class SVFIRReader;
883
+
884
+ private:
885
+ /// Constructs empty SelectStmt (for SVFIRReader/serialization)
886
+ SelectStmt() : MultiOpndStmt(SVFStmt::Select), condition{} {}
887
+ SelectStmt(const SelectStmt&); ///< place holder
888
+ void operator=(const SelectStmt&); ///< place holder
889
+
890
+ const SVFVar* condition;
891
+
892
+ public:
893
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
894
+ //@{
895
+ static inline bool classof(const SelectStmt*)
896
+ {
897
+ return true;
898
+ }
899
+ static inline bool classof(const SVFStmt* edge)
900
+ {
901
+ return edge->getEdgeKind() == SVFStmt::Select;
902
+ }
903
+ static inline bool classof(const MultiOpndStmt* edge)
904
+ {
905
+ return edge->getEdgeKind() == SVFStmt::Select;
906
+ }
907
+ static inline bool classof(const GenericPAGEdgeTy* edge)
908
+ {
909
+ return edge->getEdgeKind() == SVFStmt::Select;
910
+ }
911
+ //@}
912
+
913
+ /// constructor
914
+ SelectStmt(SVFVar* s, const OPVars& opnds, const SVFVar* cond);
915
+ virtual const std::string toString() const override;
916
+
917
+ inline const SVFVar* getCondition() const
918
+ {
919
+ return condition;
920
+ }
921
+ inline const SVFVar* getTrueValue() const
922
+ {
923
+ return getOpVar(0);
924
+ }
925
+ inline const SVFVar* getFalseValue() const
926
+ {
927
+ return getOpVar(1);
928
+ }
929
+ };
930
+
931
+ /*!
932
+ * Comparison statement
933
+ */
934
+ class CmpStmt: public MultiOpndStmt
935
+ {
936
+ friend class SVFIRWriter;
937
+ friend class SVFIRReader;
938
+
939
+ private:
940
+ /// Constructs empty CmpStmt (for SVFIRReader/serialization)
941
+ CmpStmt() : MultiOpndStmt(SVFStmt::Cmp) {}
942
+ CmpStmt(const CmpStmt&); ///< place holder
943
+ void operator=(const CmpStmt&); ///< place holder
944
+
945
+ u32_t predicate;
946
+
947
+ public:
948
+ /// OpCode for CmpStmt, enum value is same to llvm CmpInst
949
+ enum Predicate : unsigned
950
+ {
951
+ // Opcode U L G E Intuitive operation
952
+ FCMP_FALSE = 0, ///< 0 0 0 0 Always false (always folded)
953
+ FCMP_OEQ = 1, ///< 0 0 0 1 True if ordered and equal
954
+ FCMP_OGT = 2, ///< 0 0 1 0 True if ordered and greater than
955
+ FCMP_OGE = 3, ///< 0 0 1 1 True if ordered and greater than or equal
956
+ FCMP_OLT = 4, ///< 0 1 0 0 True if ordered and less than
957
+ FCMP_OLE = 5, ///< 0 1 0 1 True if ordered and less than or equal
958
+ FCMP_ONE = 6, ///< 0 1 1 0 True if ordered and operands are unequal
959
+ FCMP_ORD = 7, ///< 0 1 1 1 True if ordered (no nans)
960
+ FCMP_UNO = 8, ///< 1 0 0 0 True if unordered: isnan(X) | isnan(Y)
961
+ FCMP_UEQ = 9, ///< 1 0 0 1 True if unordered or equal
962
+ FCMP_UGT = 10, ///< 1 0 1 0 True if unordered or greater than
963
+ FCMP_UGE = 11, ///< 1 0 1 1 True if unordered, greater than, or equal
964
+ FCMP_ULT = 12, ///< 1 1 0 0 True if unordered or less than
965
+ FCMP_ULE = 13, ///< 1 1 0 1 True if unordered, less than, or equal
966
+ FCMP_UNE = 14, ///< 1 1 1 0 True if unordered or not equal
967
+ FCMP_TRUE = 15, ///< 1 1 1 1 Always true (always folded)
968
+ FIRST_FCMP_PREDICATE = FCMP_FALSE,
969
+ LAST_FCMP_PREDICATE = FCMP_TRUE,
970
+ BAD_FCMP_PREDICATE = FCMP_TRUE + 1,
971
+ ICMP_EQ = 32, ///< equal
972
+ ICMP_NE = 33, ///< not equal
973
+ ICMP_UGT = 34, ///< unsigned greater than
974
+ ICMP_UGE = 35, ///< unsigned greater or equal
975
+ ICMP_ULT = 36, ///< unsigned less than
976
+ ICMP_ULE = 37, ///< unsigned less or equal
977
+ ICMP_SGT = 38, ///< signed greater than
978
+ ICMP_SGE = 39, ///< signed greater or equal
979
+ ICMP_SLT = 40, ///< signed less than
980
+ ICMP_SLE = 41, ///< signed less or equal
981
+ FIRST_ICMP_PREDICATE = ICMP_EQ,
982
+ LAST_ICMP_PREDICATE = ICMP_SLE,
983
+ BAD_ICMP_PREDICATE = ICMP_SLE + 1
984
+ };
985
+
986
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
987
+ //@{
988
+ static inline bool classof(const CmpStmt*)
989
+ {
990
+ return true;
991
+ }
992
+ static inline bool classof(const SVFStmt* edge)
993
+ {
994
+ return edge->getEdgeKind() == SVFStmt::Cmp;
995
+ }
996
+ static inline bool classof(const MultiOpndStmt* edge)
997
+ {
998
+ return edge->getEdgeKind() == SVFStmt::Cmp;
999
+ }
1000
+ static inline bool classof(const GenericPAGEdgeTy* edge)
1001
+ {
1002
+ return edge->getEdgeKind() == SVFStmt::Cmp;
1003
+ }
1004
+ //@}
1005
+
1006
+ /// constructor
1007
+ CmpStmt(SVFVar* s, const OPVars& opnds, u32_t pre);
1008
+
1009
+ u32_t getPredicate() const
1010
+ {
1011
+ return predicate;
1012
+ }
1013
+
1014
+ virtual const std::string toString() const override;
1015
+ };
1016
+
1017
+ /*!
1018
+ * Binary statement
1019
+ */
1020
+ class BinaryOPStmt: public MultiOpndStmt
1021
+ {
1022
+ friend class SVFIRWriter;
1023
+ friend class SVFIRReader;
1024
+
1025
+ private:
1026
+ /// Constructs empty BinaryOPStmt (for SVFIRReader/serialization)
1027
+ BinaryOPStmt() : MultiOpndStmt(SVFStmt::BinaryOp) {}
1028
+ BinaryOPStmt(const BinaryOPStmt&); ///< place holder
1029
+ void operator=(const BinaryOPStmt&); ///< place holder
1030
+ u32_t opcode;
1031
+
1032
+ public:
1033
+ /// OpCode for BinaryOPStmt, enum value is same to llvm BinaryOperator (llvm/IR/Instruction.def)
1034
+ enum OpCode : unsigned
1035
+ {
1036
+ Add = 13, // Sum of integers
1037
+ FAdd = 14, // Sum of floats
1038
+ Sub = 15, // Subtraction of integers
1039
+ FSub = 16, // Subtraction of floats
1040
+ Mul = 17, // Product of integers.
1041
+ FMul = 18, // Product of floats.
1042
+ UDiv = 19, // Unsigned division.
1043
+ SDiv = 20, // Signed division.
1044
+ FDiv = 21, // Float division.
1045
+ URem = 22, // Unsigned remainder
1046
+ SRem = 23, // Signed remainder
1047
+ FRem = 24, // Float remainder
1048
+ Shl = 25, // Shift left (logical)
1049
+ LShr = 26, // Shift right (logical)
1050
+ AShr = 27, // Shift right (arithmetic)
1051
+ And = 28, // Logical and
1052
+ Or = 29, // Logical or
1053
+ Xor = 30 // Logical xor
1054
+ };
1055
+
1056
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1057
+ //@{
1058
+ static inline bool classof(const BinaryOPStmt*)
1059
+ {
1060
+ return true;
1061
+ }
1062
+ static inline bool classof(const SVFStmt* edge)
1063
+ {
1064
+ return edge->getEdgeKind() == SVFStmt::BinaryOp;
1065
+ }
1066
+ static inline bool classof(const MultiOpndStmt* edge)
1067
+ {
1068
+ return edge->getEdgeKind() == SVFStmt::BinaryOp;
1069
+ }
1070
+ static inline bool classof(const GenericPAGEdgeTy* edge)
1071
+ {
1072
+ return edge->getEdgeKind() == SVFStmt::BinaryOp;
1073
+ }
1074
+ //@}
1075
+
1076
+ /// constructor
1077
+ BinaryOPStmt(SVFVar* s, const OPVars& opnds, u32_t oc);
1078
+
1079
+ u32_t getOpcode() const
1080
+ {
1081
+ return opcode;
1082
+ }
1083
+
1084
+ virtual const std::string toString() const override;
1085
+ };
1086
+
1087
+ /*!
1088
+ * Unary statement
1089
+ */
1090
+ class UnaryOPStmt: public SVFStmt
1091
+ {
1092
+ friend class SVFIRWriter;
1093
+ friend class SVFIRReader;
1094
+
1095
+ private:
1096
+ /// Constructs empty UnaryOPStmt (for SVFIRReader/serialization)
1097
+ UnaryOPStmt() : SVFStmt(SVFStmt::UnaryOp) {}
1098
+ UnaryOPStmt(const UnaryOPStmt&); ///< place holder
1099
+ void operator=(const UnaryOPStmt&); ///< place holder
1100
+ SVFVar* getSrcNode(); ///< place holder, use getOpVar() instead
1101
+ SVFVar* getDstNode(); ///< place holder, use getRes() instead
1102
+ NodeID getSrcID(); ///< place holder, use getOpVarID(pos) instead
1103
+ NodeID getDstID(); ///< place holder, use getResID() instead
1104
+
1105
+ u32_t opcode;
1106
+
1107
+ public:
1108
+ /// OpCode for UnaryOPStmt, enum value is same to llvm::UnaryOperator
1109
+ enum OpCode : unsigned
1110
+ {
1111
+ FNeg = 12
1112
+ };
1113
+
1114
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1115
+ //@{
1116
+ static inline bool classof(const UnaryOPStmt*)
1117
+ {
1118
+ return true;
1119
+ }
1120
+ static inline bool classof(const SVFStmt* edge)
1121
+ {
1122
+ return edge->getEdgeKind() == SVFStmt::UnaryOp;
1123
+ }
1124
+ static inline bool classof(const GenericPAGEdgeTy* edge)
1125
+ {
1126
+ return edge->getEdgeKind() == SVFStmt::UnaryOp;
1127
+ }
1128
+ //@}
1129
+
1130
+ /// constructor
1131
+ UnaryOPStmt(SVFVar* s, SVFVar* d, u32_t oc)
1132
+ : SVFStmt(s, d, SVFStmt::UnaryOp), opcode(oc)
1133
+ {
1134
+ }
1135
+
1136
+ u32_t getOpcode() const
1137
+ {
1138
+ return opcode;
1139
+ }
1140
+ inline const SVFVar* getOpVar() const
1141
+ {
1142
+ return SVFStmt::getSrcNode();
1143
+ }
1144
+ inline const SVFVar* getRes() const
1145
+ {
1146
+ return SVFStmt::getDstNode();
1147
+ }
1148
+ NodeID getOpVarID() const;
1149
+ NodeID getResID() const;
1150
+
1151
+ virtual const std::string toString() const override;
1152
+ };
1153
+
1154
+ /*!
1155
+ * Branch statements including if/else and switch
1156
+ */
1157
+ class BranchStmt: public SVFStmt
1158
+ {
1159
+ friend class SVFIRWriter;
1160
+ friend class SVFIRReader;
1161
+
1162
+ public:
1163
+ typedef std::vector<std::pair<const ICFGNode*, s32_t>> SuccAndCondPairVec;
1164
+
1165
+ private:
1166
+ /// Constructs empty BranchStmt (for SVFIRReader/serialization)
1167
+ BranchStmt() : SVFStmt(SVFStmt::Branch), cond{}, brInst{} {}
1168
+ BranchStmt(const BranchStmt&); ///< place holder
1169
+ void operator=(const BranchStmt&); ///< place holder
1170
+ SVFVar* getSrcNode(); ///< place holder, not allowed
1171
+ SVFVar* getDstNode(); ///< place holder, not allowed
1172
+ NodeID getSrcID(); ///< place holder, use getOpVarID(pos) instead
1173
+ NodeID getDstID(); ///< place holder, use getResID() instead
1174
+
1175
+ SuccAndCondPairVec successors;
1176
+ const SVFVar* cond;
1177
+ const SVFVar* brInst;
1178
+
1179
+ public:
1180
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1181
+ //@{
1182
+ static inline bool classof(const BranchStmt*)
1183
+ {
1184
+ return true;
1185
+ }
1186
+ static inline bool classof(const SVFStmt* edge)
1187
+ {
1188
+ return edge->getEdgeKind() == SVFStmt::Branch;
1189
+ }
1190
+ static inline bool classof(const GenericPAGEdgeTy* edge)
1191
+ {
1192
+ return edge->getEdgeKind() == SVFStmt::Branch;
1193
+ }
1194
+ //@}
1195
+
1196
+ /// constructor
1197
+ BranchStmt(SVFVar* inst, SVFVar* c, const SuccAndCondPairVec& succs)
1198
+ : SVFStmt(c, inst, SVFStmt::Branch), successors(succs), cond(c),
1199
+ brInst(inst)
1200
+ {
1201
+ }
1202
+
1203
+ /// The branch is unconditional if cond is a null value
1204
+ bool isUnconditional() const;
1205
+ /// The branch is conditional if cond is not a null value
1206
+ bool isConditional() const;
1207
+ /// Return the condition
1208
+ const SVFVar* getCondition() const;
1209
+ const SVFVar* getBranchInst() const
1210
+ {
1211
+ return brInst;
1212
+ }
1213
+
1214
+ /// For example if(c) {stmt1} else {stmt2}
1215
+ /// successor(0): stmt1, 1
1216
+ /// successor(1): stmt2, 0
1217
+
1218
+ /// For example switch(c) case 0: {stmt1; break;} case 1: {stmt2; break;}
1219
+ /// default {stmt3: break} successor(0): stmt1, 0 successor(1): stmt2, 1
1220
+ /// successor(3): stmt3, -1
1221
+
1222
+ /// Successors of this branch statement
1223
+ ///@{
1224
+ u32_t getNumSuccessors() const
1225
+ {
1226
+ return successors.size();
1227
+ }
1228
+ const SuccAndCondPairVec& getSuccessors() const
1229
+ {
1230
+ return successors;
1231
+ }
1232
+ const ICFGNode* getSuccessor(u32_t i) const
1233
+ {
1234
+ return successors.at(i).first;
1235
+ }
1236
+ s64_t getSuccessorCondValue(u32_t i) const
1237
+ {
1238
+ return successors.at(i).second;
1239
+ }
1240
+ //@}
1241
+ virtual const std::string toString() const override;
1242
+ };
1243
+
1244
+ /*!
1245
+ * Thread Fork
1246
+ */
1247
+ class TDForkPE:
1248
+ public CallPE
1249
+ {
1250
+ friend class SVFIRWriter;
1251
+ friend class SVFIRReader;
1252
+
1253
+ private:
1254
+ /// Constructs empty TDForkPE (for SVFIRReader/serialization)
1255
+ TDForkPE() : CallPE(SVFStmt::ThreadFork) {}
1256
+ TDForkPE(const TDForkPE&); ///< place holder
1257
+ void operator=(const TDForkPE&); ///< place holder
1258
+
1259
+ public:
1260
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1261
+ //@{
1262
+ static inline bool classof(const TDForkPE*)
1263
+ {
1264
+ return true;
1265
+ }
1266
+ static inline bool classof(const SVFStmt* edge)
1267
+ {
1268
+ return edge->getEdgeKind() == SVFStmt::ThreadFork;
1269
+ }
1270
+ static inline bool classof(const GenericPAGEdgeTy* edge)
1271
+ {
1272
+ return edge->getEdgeKind() == SVFStmt::ThreadFork;
1273
+ }
1274
+ //@}
1275
+
1276
+ /// constructor
1277
+ TDForkPE(SVFVar* s, SVFVar* d, const CallICFGNode* i,
1278
+ const FunEntryICFGNode* entry)
1279
+ : CallPE(s, d, i, entry, SVFStmt::ThreadFork)
1280
+ {
1281
+ }
1282
+
1283
+ virtual const std::string toString() const;
1284
+ };
1285
+
1286
+ /*!
1287
+ * Thread Join
1288
+ */
1289
+ class TDJoinPE:
1290
+ public RetPE
1291
+ {
1292
+ friend class SVFIRWriter;
1293
+ friend class SVFIRReader;
1294
+
1295
+ private:
1296
+ /// Constructs empty TDJoinPE (for SVFIRReader/serialization)
1297
+ TDJoinPE() : RetPE(SVFStmt::ThreadJoin) {}
1298
+ TDJoinPE(const TDJoinPE&); ///< place holder
1299
+ void operator=(const TDJoinPE&); ///< place holder
1300
+
1301
+ public:
1302
+ /// Methods for support type inquiry through isa, cast, and dyn_cast:
1303
+ //@{
1304
+ static inline bool classof(const TDJoinPE*)
1305
+ {
1306
+ return true;
1307
+ }
1308
+ static inline bool classof(const SVFStmt* edge)
1309
+ {
1310
+ return edge->getEdgeKind() == SVFStmt::ThreadJoin;
1311
+ }
1312
+ static inline bool classof(const GenericPAGEdgeTy* edge)
1313
+ {
1314
+ return edge->getEdgeKind() == SVFStmt::ThreadJoin;
1315
+ }
1316
+ //@}
1317
+
1318
+ /// Constructor
1319
+ TDJoinPE(SVFVar* s, SVFVar* d, const CallICFGNode* i,
1320
+ const FunExitICFGNode* e)
1321
+ : RetPE(s, d, i, e, SVFStmt::ThreadJoin)
1322
+ {
1323
+ }
1324
+
1325
+ virtual const std::string toString() const;
1326
+ };
1327
+
1328
+ } // End namespace SVF
1329
+
1330
+ #endif /* INCLUDE_SVFIR_SVFSTATEMENT_H_ */