arkanalyzer 1.0.5

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 (322) hide show
  1. package/LICENSE +201 -0
  2. package/README.en.md +88 -0
  3. package/README.md +98 -0
  4. package/docs/HowToCreatePR.md +55 -0
  5. package/docs/HowToHandleIssues.md +155 -0
  6. package/docs/quickstart.pdf +0 -0
  7. package/lib/Config.d.ts +26 -0
  8. package/lib/Config.d.ts.map +1 -0
  9. package/lib/Config.js +128 -0
  10. package/lib/Scene.d.ts +125 -0
  11. package/lib/Scene.d.ts.map +1 -0
  12. package/lib/Scene.js +762 -0
  13. package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +28 -0
  14. package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -0
  15. package/lib/callgraph/algorithm/AbstractAnalysis.js +137 -0
  16. package/lib/callgraph/algorithm/ClassHierarchyAnalysis.d.ts +11 -0
  17. package/lib/callgraph/algorithm/ClassHierarchyAnalysis.d.ts.map +1 -0
  18. package/lib/callgraph/algorithm/ClassHierarchyAnalysis.js +71 -0
  19. package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts +16 -0
  20. package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -0
  21. package/lib/callgraph/algorithm/RapidTypeAnalysis.js +147 -0
  22. package/lib/callgraph/common/Statistics.d.ts +58 -0
  23. package/lib/callgraph/common/Statistics.d.ts.map +1 -0
  24. package/lib/callgraph/common/Statistics.js +203 -0
  25. package/lib/callgraph/model/BaseGraph.d.ts +62 -0
  26. package/lib/callgraph/model/BaseGraph.d.ts.map +1 -0
  27. package/lib/callgraph/model/BaseGraph.js +158 -0
  28. package/lib/callgraph/model/CallGraph.d.ts +94 -0
  29. package/lib/callgraph/model/CallGraph.d.ts.map +1 -0
  30. package/lib/callgraph/model/CallGraph.js +339 -0
  31. package/lib/callgraph/model/builder/CallGraphBuilder.d.ts +16 -0
  32. package/lib/callgraph/model/builder/CallGraphBuilder.d.ts.map +1 -0
  33. package/lib/callgraph/model/builder/CallGraphBuilder.js +106 -0
  34. package/lib/callgraph/pointerAnalysis/Context.d.ts +38 -0
  35. package/lib/callgraph/pointerAnalysis/Context.d.ts.map +1 -0
  36. package/lib/callgraph/pointerAnalysis/Context.js +156 -0
  37. package/lib/callgraph/pointerAnalysis/DummyCallCreator.d.ts +23 -0
  38. package/lib/callgraph/pointerAnalysis/DummyCallCreator.d.ts.map +1 -0
  39. package/lib/callgraph/pointerAnalysis/DummyCallCreator.js +104 -0
  40. package/lib/callgraph/pointerAnalysis/Pag.d.ts +209 -0
  41. package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -0
  42. package/lib/callgraph/pointerAnalysis/Pag.js +774 -0
  43. package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts +88 -0
  44. package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts.map +1 -0
  45. package/lib/callgraph/pointerAnalysis/PagBuilder.js +821 -0
  46. package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts +64 -0
  47. package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts.map +1 -0
  48. package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +502 -0
  49. package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.d.ts +9 -0
  50. package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.d.ts.map +1 -0
  51. package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.js +57 -0
  52. package/lib/callgraph/pointerAnalysis/PtsDS.d.ts +58 -0
  53. package/lib/callgraph/pointerAnalysis/PtsDS.d.ts.map +1 -0
  54. package/lib/callgraph/pointerAnalysis/PtsDS.js +234 -0
  55. package/lib/core/base/Constant.d.ts +17 -0
  56. package/lib/core/base/Constant.d.ts.map +1 -0
  57. package/lib/core/base/Constant.js +53 -0
  58. package/lib/core/base/Decorator.d.ts +15 -0
  59. package/lib/core/base/Decorator.d.ts.map +1 -0
  60. package/lib/core/base/Decorator.js +43 -0
  61. package/lib/core/base/DefUseChain.d.ts +9 -0
  62. package/lib/core/base/DefUseChain.d.ts.map +1 -0
  63. package/lib/core/base/DefUseChain.js +25 -0
  64. package/lib/core/base/Expr.d.ts +219 -0
  65. package/lib/core/base/Expr.d.ts.map +1 -0
  66. package/lib/core/base/Expr.js +896 -0
  67. package/lib/core/base/Local.d.ts +40 -0
  68. package/lib/core/base/Local.d.ts.map +1 -0
  69. package/lib/core/base/Local.js +101 -0
  70. package/lib/core/base/Position.d.ts +39 -0
  71. package/lib/core/base/Position.d.ts.map +1 -0
  72. package/lib/core/base/Position.js +86 -0
  73. package/lib/core/base/Ref.d.ts +75 -0
  74. package/lib/core/base/Ref.d.ts.map +1 -0
  75. package/lib/core/base/Ref.js +286 -0
  76. package/lib/core/base/Stmt.d.ts +109 -0
  77. package/lib/core/base/Stmt.d.ts.map +1 -0
  78. package/lib/core/base/Stmt.js +374 -0
  79. package/lib/core/base/Type.d.ts +220 -0
  80. package/lib/core/base/Type.d.ts.map +1 -0
  81. package/lib/core/base/Type.js +477 -0
  82. package/lib/core/base/Value.d.ts +11 -0
  83. package/lib/core/base/Value.d.ts.map +1 -0
  84. package/lib/core/base/Value.js +16 -0
  85. package/lib/core/common/ArkIRTransformer.d.ts +101 -0
  86. package/lib/core/common/ArkIRTransformer.d.ts.map +1 -0
  87. package/lib/core/common/ArkIRTransformer.js +1674 -0
  88. package/lib/core/common/BodyBuilder.d.ts +10 -0
  89. package/lib/core/common/BodyBuilder.d.ts.map +1 -0
  90. package/lib/core/common/BodyBuilder.js +34 -0
  91. package/lib/core/common/Builtin.d.ts +35 -0
  92. package/lib/core/common/Builtin.d.ts.map +1 -0
  93. package/lib/core/common/Builtin.js +78 -0
  94. package/lib/core/common/CfgBuilder.d.ts +136 -0
  95. package/lib/core/common/CfgBuilder.d.ts.map +1 -0
  96. package/lib/core/common/CfgBuilder.js +1241 -0
  97. package/lib/core/common/Const.d.ts +15 -0
  98. package/lib/core/common/Const.d.ts.map +1 -0
  99. package/lib/core/common/Const.js +34 -0
  100. package/lib/core/common/DummyMainCreater.d.ts +48 -0
  101. package/lib/core/common/DummyMainCreater.d.ts.map +1 -0
  102. package/lib/core/common/DummyMainCreater.js +433 -0
  103. package/lib/core/common/EtsConst.d.ts +65 -0
  104. package/lib/core/common/EtsConst.d.ts.map +1 -0
  105. package/lib/core/common/EtsConst.js +918 -0
  106. package/lib/core/common/ExprUseReplacer.d.ts +18 -0
  107. package/lib/core/common/ExprUseReplacer.d.ts.map +1 -0
  108. package/lib/core/common/ExprUseReplacer.js +88 -0
  109. package/lib/core/common/IRUtils.d.ts +7 -0
  110. package/lib/core/common/IRUtils.d.ts.map +1 -0
  111. package/lib/core/common/IRUtils.js +39 -0
  112. package/lib/core/common/ModelUtils.d.ts +61 -0
  113. package/lib/core/common/ModelUtils.d.ts.map +1 -0
  114. package/lib/core/common/ModelUtils.js +628 -0
  115. package/lib/core/common/RefUseReplacer.d.ts +14 -0
  116. package/lib/core/common/RefUseReplacer.d.ts.map +1 -0
  117. package/lib/core/common/RefUseReplacer.js +50 -0
  118. package/lib/core/common/StmtUseReplacer.d.ts +16 -0
  119. package/lib/core/common/StmtUseReplacer.d.ts.map +1 -0
  120. package/lib/core/common/StmtUseReplacer.js +88 -0
  121. package/lib/core/common/TSConst.d.ts +11 -0
  122. package/lib/core/common/TSConst.d.ts.map +1 -0
  123. package/lib/core/common/TSConst.js +28 -0
  124. package/lib/core/common/TypeInference.d.ts +44 -0
  125. package/lib/core/common/TypeInference.d.ts.map +1 -0
  126. package/lib/core/common/TypeInference.js +519 -0
  127. package/lib/core/common/ValueUtil.d.ts +17 -0
  128. package/lib/core/common/ValueUtil.d.ts.map +1 -0
  129. package/lib/core/common/ValueUtil.js +71 -0
  130. package/lib/core/common/VisibleValue.d.ts +37 -0
  131. package/lib/core/common/VisibleValue.d.ts.map +1 -0
  132. package/lib/core/common/VisibleValue.js +212 -0
  133. package/lib/core/dataflow/DataflowProblem.d.ts +21 -0
  134. package/lib/core/dataflow/DataflowProblem.d.ts.map +1 -0
  135. package/lib/core/dataflow/DataflowProblem.js +33 -0
  136. package/lib/core/dataflow/DataflowResult.d.ts +8 -0
  137. package/lib/core/dataflow/DataflowResult.d.ts.map +1 -0
  138. package/lib/core/dataflow/DataflowResult.js +26 -0
  139. package/lib/core/dataflow/DataflowSolver.d.ts +40 -0
  140. package/lib/core/dataflow/DataflowSolver.d.ts.map +1 -0
  141. package/lib/core/dataflow/DataflowSolver.js +318 -0
  142. package/lib/core/dataflow/Edge.d.ts +16 -0
  143. package/lib/core/dataflow/Edge.d.ts.map +1 -0
  144. package/lib/core/dataflow/Edge.js +40 -0
  145. package/lib/core/dataflow/Fact.d.ts +7 -0
  146. package/lib/core/dataflow/Fact.d.ts.map +1 -0
  147. package/lib/core/dataflow/Fact.js +24 -0
  148. package/lib/core/dataflow/TiantAnalysis.d.ts +37 -0
  149. package/lib/core/dataflow/TiantAnalysis.d.ts.map +1 -0
  150. package/lib/core/dataflow/TiantAnalysis.js +326 -0
  151. package/lib/core/dataflow/UndefinedVariable.d.ts +32 -0
  152. package/lib/core/dataflow/UndefinedVariable.d.ts.map +1 -0
  153. package/lib/core/dataflow/UndefinedVariable.js +235 -0
  154. package/lib/core/dataflow/Util.d.ts +8 -0
  155. package/lib/core/dataflow/Util.d.ts.map +1 -0
  156. package/lib/core/dataflow/Util.js +137 -0
  157. package/lib/core/graph/BasicBlock.d.ts +26 -0
  158. package/lib/core/graph/BasicBlock.d.ts.map +1 -0
  159. package/lib/core/graph/BasicBlock.js +92 -0
  160. package/lib/core/graph/Cfg.d.ts +29 -0
  161. package/lib/core/graph/Cfg.d.ts.map +1 -0
  162. package/lib/core/graph/Cfg.js +154 -0
  163. package/lib/core/graph/DominanceFinder.d.ts +16 -0
  164. package/lib/core/graph/DominanceFinder.d.ts.map +1 -0
  165. package/lib/core/graph/DominanceFinder.js +121 -0
  166. package/lib/core/graph/DominanceTree.d.ts +13 -0
  167. package/lib/core/graph/DominanceTree.d.ts.map +1 -0
  168. package/lib/core/graph/DominanceTree.js +70 -0
  169. package/lib/core/graph/ViewTree.d.ts +115 -0
  170. package/lib/core/graph/ViewTree.d.ts.map +1 -0
  171. package/lib/core/graph/ViewTree.js +16 -0
  172. package/lib/core/graph/builder/ViewTreeBuilder.d.ts +204 -0
  173. package/lib/core/graph/builder/ViewTreeBuilder.d.ts.map +1 -0
  174. package/lib/core/graph/builder/ViewTreeBuilder.js +1046 -0
  175. package/lib/core/model/ArkBody.d.ts +22 -0
  176. package/lib/core/model/ArkBody.d.ts.map +1 -0
  177. package/lib/core/model/ArkBody.js +63 -0
  178. package/lib/core/model/ArkClass.d.ts +110 -0
  179. package/lib/core/model/ArkClass.d.ts.map +1 -0
  180. package/lib/core/model/ArkClass.js +315 -0
  181. package/lib/core/model/ArkExport.d.ts +70 -0
  182. package/lib/core/model/ArkExport.d.ts.map +1 -0
  183. package/lib/core/model/ArkExport.js +143 -0
  184. package/lib/core/model/ArkField.d.ts +60 -0
  185. package/lib/core/model/ArkField.d.ts.map +1 -0
  186. package/lib/core/model/ArkField.js +157 -0
  187. package/lib/core/model/ArkFile.d.ts +62 -0
  188. package/lib/core/model/ArkFile.d.ts.map +1 -0
  189. package/lib/core/model/ArkFile.js +160 -0
  190. package/lib/core/model/ArkImport.d.ts +43 -0
  191. package/lib/core/model/ArkImport.d.ts.map +1 -0
  192. package/lib/core/model/ArkImport.js +109 -0
  193. package/lib/core/model/ArkMethod.d.ts +76 -0
  194. package/lib/core/model/ArkMethod.d.ts.map +1 -0
  195. package/lib/core/model/ArkMethod.js +235 -0
  196. package/lib/core/model/ArkNamespace.d.ts +65 -0
  197. package/lib/core/model/ArkNamespace.d.ts.map +1 -0
  198. package/lib/core/model/ArkNamespace.js +182 -0
  199. package/lib/core/model/ArkSignature.d.ts +98 -0
  200. package/lib/core/model/ArkSignature.d.ts.map +1 -0
  201. package/lib/core/model/ArkSignature.js +281 -0
  202. package/lib/core/model/builder/ArkClassBuilder.d.ts +13 -0
  203. package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -0
  204. package/lib/core/model/builder/ArkClassBuilder.js +422 -0
  205. package/lib/core/model/builder/ArkExportBuilder.d.ts +25 -0
  206. package/lib/core/model/builder/ArkExportBuilder.d.ts.map +1 -0
  207. package/lib/core/model/builder/ArkExportBuilder.js +207 -0
  208. package/lib/core/model/builder/ArkFieldBuilder.d.ts +9 -0
  209. package/lib/core/model/builder/ArkFieldBuilder.d.ts.map +1 -0
  210. package/lib/core/model/builder/ArkFieldBuilder.js +189 -0
  211. package/lib/core/model/builder/ArkFileBuilder.d.ts +10 -0
  212. package/lib/core/model/builder/ArkFileBuilder.d.ts.map +1 -0
  213. package/lib/core/model/builder/ArkFileBuilder.js +164 -0
  214. package/lib/core/model/builder/ArkImportBuilder.d.ts +4 -0
  215. package/lib/core/model/builder/ArkImportBuilder.d.ts.map +1 -0
  216. package/lib/core/model/builder/ArkImportBuilder.js +125 -0
  217. package/lib/core/model/builder/ArkMethodBuilder.d.ts +60 -0
  218. package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -0
  219. package/lib/core/model/builder/ArkMethodBuilder.js +419 -0
  220. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +5 -0
  221. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -0
  222. package/lib/core/model/builder/ArkNamespaceBuilder.js +171 -0
  223. package/lib/core/model/builder/ArkSignatureBuilder.d.ts +9 -0
  224. package/lib/core/model/builder/ArkSignatureBuilder.d.ts.map +1 -0
  225. package/lib/core/model/builder/ArkSignatureBuilder.js +40 -0
  226. package/lib/core/model/builder/builderUtils.d.ts +18 -0
  227. package/lib/core/model/builder/builderUtils.d.ts.map +1 -0
  228. package/lib/core/model/builder/builderUtils.js +449 -0
  229. package/lib/index.d.ts +77 -0
  230. package/lib/index.d.ts.map +1 -0
  231. package/lib/index.js +190 -0
  232. package/lib/save/ArkStream.d.ts +24 -0
  233. package/lib/save/ArkStream.d.ts.map +1 -0
  234. package/lib/save/ArkStream.js +83 -0
  235. package/lib/save/DotPrinter.d.ts +48 -0
  236. package/lib/save/DotPrinter.d.ts.map +1 -0
  237. package/lib/save/DotPrinter.js +229 -0
  238. package/lib/save/GraphPrinter.d.ts +17 -0
  239. package/lib/save/GraphPrinter.d.ts.map +1 -0
  240. package/lib/save/GraphPrinter.js +135 -0
  241. package/lib/save/JsonPrinter.d.ts +28 -0
  242. package/lib/save/JsonPrinter.d.ts.map +1 -0
  243. package/lib/save/JsonPrinter.js +511 -0
  244. package/lib/save/Printer.d.ts +17 -0
  245. package/lib/save/Printer.d.ts.map +1 -0
  246. package/lib/save/Printer.js +27 -0
  247. package/lib/save/PrinterBuilder.d.ts +38 -0
  248. package/lib/save/PrinterBuilder.d.ts.map +1 -0
  249. package/lib/save/PrinterBuilder.js +102 -0
  250. package/lib/save/serializeArkIR.d.ts +3 -0
  251. package/lib/save/serializeArkIR.d.ts.map +1 -0
  252. package/lib/save/serializeArkIR.js +166 -0
  253. package/lib/save/source/SourceBase.d.ts +32 -0
  254. package/lib/save/source/SourceBase.d.ts.map +1 -0
  255. package/lib/save/source/SourceBase.js +93 -0
  256. package/lib/save/source/SourceBody.d.ts +60 -0
  257. package/lib/save/source/SourceBody.d.ts.map +1 -0
  258. package/lib/save/source/SourceBody.js +292 -0
  259. package/lib/save/source/SourceClass.d.ts +27 -0
  260. package/lib/save/source/SourceClass.d.ts.map +1 -0
  261. package/lib/save/source/SourceClass.js +202 -0
  262. package/lib/save/source/SourceField.d.ts +15 -0
  263. package/lib/save/source/SourceField.d.ts.map +1 -0
  264. package/lib/save/source/SourceField.js +68 -0
  265. package/lib/save/source/SourceFilePrinter.d.ts +14 -0
  266. package/lib/save/source/SourceFilePrinter.d.ts.map +1 -0
  267. package/lib/save/source/SourceFilePrinter.js +73 -0
  268. package/lib/save/source/SourceMethod.d.ts +24 -0
  269. package/lib/save/source/SourceMethod.d.ts.map +1 -0
  270. package/lib/save/source/SourceMethod.js +170 -0
  271. package/lib/save/source/SourceModule.d.ts +18 -0
  272. package/lib/save/source/SourceModule.d.ts.map +1 -0
  273. package/lib/save/source/SourceModule.js +120 -0
  274. package/lib/save/source/SourceNamespace.d.ts +13 -0
  275. package/lib/save/source/SourceNamespace.d.ts.map +1 -0
  276. package/lib/save/source/SourceNamespace.js +80 -0
  277. package/lib/save/source/SourceStmt.d.ts +172 -0
  278. package/lib/save/source/SourceStmt.d.ts.map +1 -0
  279. package/lib/save/source/SourceStmt.js +757 -0
  280. package/lib/save/source/SourceTransformer.d.ts +37 -0
  281. package/lib/save/source/SourceTransformer.d.ts.map +1 -0
  282. package/lib/save/source/SourceTransformer.js +338 -0
  283. package/lib/save/source/SourceUtils.d.ts +25 -0
  284. package/lib/save/source/SourceUtils.d.ts.map +1 -0
  285. package/lib/save/source/SourceUtils.js +201 -0
  286. package/lib/transformer/FunctionTransformer.d.ts +3 -0
  287. package/lib/transformer/FunctionTransformer.d.ts.map +1 -0
  288. package/lib/transformer/FunctionTransformer.js +17 -0
  289. package/lib/transformer/SceneTransformer.d.ts +3 -0
  290. package/lib/transformer/SceneTransformer.d.ts.map +1 -0
  291. package/lib/transformer/SceneTransformer.js +17 -0
  292. package/lib/transformer/StaticSingleAssignmentFormer.d.ts +13 -0
  293. package/lib/transformer/StaticSingleAssignmentFormer.d.ts.map +1 -0
  294. package/lib/transformer/StaticSingleAssignmentFormer.js +259 -0
  295. package/lib/transformer/Transformer.d.ts +7 -0
  296. package/lib/transformer/Transformer.d.ts.map +1 -0
  297. package/lib/transformer/Transformer.js +22 -0
  298. package/lib/utils/CfgStructualAnalysis.d.ts +93 -0
  299. package/lib/utils/CfgStructualAnalysis.d.ts.map +1 -0
  300. package/lib/utils/CfgStructualAnalysis.js +955 -0
  301. package/lib/utils/FileUtils.d.ts +18 -0
  302. package/lib/utils/FileUtils.d.ts.map +1 -0
  303. package/lib/utils/FileUtils.js +131 -0
  304. package/lib/utils/callGraphUtils.d.ts +31 -0
  305. package/lib/utils/callGraphUtils.d.ts.map +1 -0
  306. package/lib/utils/callGraphUtils.js +208 -0
  307. package/lib/utils/entryMethodUtils.d.ts +16 -0
  308. package/lib/utils/entryMethodUtils.d.ts.map +1 -0
  309. package/lib/utils/entryMethodUtils.js +139 -0
  310. package/lib/utils/getAllFiles.d.ts +10 -0
  311. package/lib/utils/getAllFiles.d.ts.map +1 -0
  312. package/lib/utils/getAllFiles.js +91 -0
  313. package/lib/utils/json5parser.d.ts +7 -0
  314. package/lib/utils/json5parser.d.ts.map +1 -0
  315. package/lib/utils/json5parser.js +146 -0
  316. package/lib/utils/logger.d.ts +19 -0
  317. package/lib/utils/logger.d.ts.map +1 -0
  318. package/lib/utils/logger.js +90 -0
  319. package/lib/utils/pathTransfer.d.ts +2 -0
  320. package/lib/utils/pathTransfer.d.ts.map +1 -0
  321. package/lib/utils/pathTransfer.js +25 -0
  322. package/package.json +29 -0
@@ -0,0 +1,58 @@
1
+ interface Idx {
2
+ }
3
+ interface IPtsCollection<T extends Idx> {
4
+ contains(elem: T): boolean;
5
+ insert(elem: T): boolean;
6
+ remove(elem: T): boolean;
7
+ clone(): this;
8
+ union(other: this): boolean;
9
+ subtract(other: this): boolean;
10
+ clear(): void;
11
+ count(): number;
12
+ isEmpty(): boolean;
13
+ superset(other: this): boolean;
14
+ intersect(other: this): boolean;
15
+ [Symbol.iterator](): IterableIterator<T>;
16
+ }
17
+ export declare class PtsSet<T extends Idx> implements IPtsCollection<T> {
18
+ pts: Set<T>;
19
+ constructor();
20
+ contains(elem: T): boolean;
21
+ insert(elem: T): boolean;
22
+ remove(elem: T): boolean;
23
+ clone(): this;
24
+ union(other: this): boolean;
25
+ subtract(other: this): boolean;
26
+ clear(): void;
27
+ count(): number;
28
+ isEmpty(): boolean;
29
+ superset(other: this): boolean;
30
+ intersect(other: this): boolean;
31
+ getProtoPtsSet(): Set<T>;
32
+ [Symbol.iterator](): IterableIterator<T>;
33
+ }
34
+ export declare class DiffPTData<K, D extends Idx, DS extends IPtsCollection<D>> {
35
+ private DSCreator;
36
+ diffPtsMap: Map<K, DS>;
37
+ propaPtsMap: Map<K, DS>;
38
+ constructor(DSCreator: new () => DS);
39
+ clear(): void;
40
+ addPts(v: K, elem: D): boolean;
41
+ resetElem(v: K): boolean;
42
+ unionDiffPts(dstv: K, srcv: K): boolean;
43
+ unionPts(dstv: K, srcv: K): boolean;
44
+ unionPtsTo(dstv: K, srcDs: DS): boolean;
45
+ removePtsElem(v: K, elem: D): boolean;
46
+ getDiffPts(v: K): DS | undefined;
47
+ getMutDiffPts(v: K): DS | undefined;
48
+ getPropaPts(v: K): DS | undefined;
49
+ getPropaPtsMut(v: K): DS;
50
+ flush(v: K): void;
51
+ clearPts(v: K): void;
52
+ clearDiffPts(v: K): void;
53
+ clearPropaPts(v: K): void;
54
+ dumpPtData(): void;
55
+ calculateDiff(src: K, dst: K): DS;
56
+ }
57
+ export {};
58
+ //# sourceMappingURL=PtsDS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PtsDS.d.ts","sourceRoot":"","sources":["../../../src/callgraph/pointerAnalysis/PtsDS.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2024 Huawei Device Co., Ltd.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.DiffPTData = exports.PtsSet = void 0;
18
+ /*
19
+ * A simple set to store pts data
20
+ */
21
+ class PtsSet {
22
+ // static new<T extends Idx>(this: new () => PtsSet<T>): PtsSet<T> {
23
+ // return new this();
24
+ // }
25
+ constructor() {
26
+ this.pts = new Set();
27
+ }
28
+ contains(elem) {
29
+ return this.pts.has(elem);
30
+ }
31
+ insert(elem) {
32
+ if (this.pts.has(elem)) {
33
+ return false;
34
+ }
35
+ this.pts.add(elem);
36
+ return true;
37
+ }
38
+ remove(elem) {
39
+ if (!this.pts.has(elem)) {
40
+ return false;
41
+ }
42
+ this.pts.delete(elem);
43
+ return true;
44
+ }
45
+ clone() {
46
+ let clonedSet = new PtsSet();
47
+ clonedSet.pts = new Set(this.pts);
48
+ // TODO: need validate
49
+ return clonedSet;
50
+ }
51
+ union(other) {
52
+ let changed = false;
53
+ for (const elem of other.pts) {
54
+ changed = this.insert(elem) || changed;
55
+ }
56
+ return changed;
57
+ }
58
+ subtract(other) {
59
+ let changed = false;
60
+ for (const elem of other.pts) {
61
+ changed = this.remove(elem) || changed;
62
+ }
63
+ return changed;
64
+ }
65
+ clear() {
66
+ this.pts.clear();
67
+ }
68
+ count() {
69
+ return this.pts.size;
70
+ }
71
+ isEmpty() {
72
+ return this.pts.size === 0;
73
+ }
74
+ // If current collection is a super set of other
75
+ superset(other) {
76
+ for (const elem of other.pts) {
77
+ if (!this.pts.has(elem)) {
78
+ return false;
79
+ }
80
+ }
81
+ return true;
82
+ }
83
+ // If current collection is intersect with other
84
+ intersect(other) {
85
+ for (const elem of other.pts) {
86
+ if (this.pts.has(elem)) {
87
+ return true;
88
+ }
89
+ }
90
+ return false;
91
+ }
92
+ getProtoPtsSet() {
93
+ return this.pts;
94
+ }
95
+ [Symbol.iterator]() {
96
+ return this.pts[Symbol.iterator]();
97
+ }
98
+ }
99
+ exports.PtsSet = PtsSet;
100
+ class DiffPTData {
101
+ constructor(DSCreator) {
102
+ this.DSCreator = DSCreator;
103
+ this.diffPtsMap = new Map();
104
+ this.propaPtsMap = new Map();
105
+ }
106
+ clear() {
107
+ this.diffPtsMap.clear();
108
+ this.propaPtsMap.clear();
109
+ }
110
+ addPts(v, elem) {
111
+ let propa = this.propaPtsMap.get(v);
112
+ if (propa && propa.contains(elem)) {
113
+ return false;
114
+ }
115
+ let diff = this.diffPtsMap.get(v) || new this.DSCreator();
116
+ this.diffPtsMap.set(v, diff);
117
+ return diff.insert(elem);
118
+ }
119
+ resetElem(v) {
120
+ let propa = this.propaPtsMap.get(v);
121
+ if (propa) {
122
+ this.diffPtsMap.set(v, propa.clone());
123
+ // this.propaPtsMap.set(v, new this.DSCreator());
124
+ return true;
125
+ }
126
+ return false;
127
+ }
128
+ unionDiffPts(dstv, srcv) {
129
+ if (dstv === srcv) {
130
+ return false;
131
+ }
132
+ let changed = false;
133
+ let diff = this.diffPtsMap.get(srcv);
134
+ if (diff) {
135
+ let srcDs = diff.clone();
136
+ changed = this.unionPtsTo(dstv, srcDs);
137
+ }
138
+ return changed;
139
+ }
140
+ unionPts(dstv, srcv) {
141
+ if (dstv === srcv) {
142
+ return false;
143
+ }
144
+ let changed = false;
145
+ let diff = this.diffPtsMap.get(srcv);
146
+ if (diff) {
147
+ let srcDs = diff.clone();
148
+ changed = this.unionPtsTo(dstv, srcDs);
149
+ }
150
+ let propa = this.propaPtsMap.get(srcv);
151
+ if (propa) {
152
+ let srcDs = propa.clone();
153
+ changed = this.unionPtsTo(dstv, srcDs) || changed;
154
+ }
155
+ return changed;
156
+ }
157
+ unionPtsTo(dstv, srcDs) {
158
+ let diff = this.diffPtsMap.get(dstv) || new this.DSCreator();
159
+ let propa = this.propaPtsMap.get(dstv) || new this.DSCreator();
160
+ let newSet = srcDs.clone();
161
+ newSet.subtract(propa);
162
+ let changed = diff.union(newSet);
163
+ this.diffPtsMap.set(dstv, diff);
164
+ return changed;
165
+ }
166
+ removePtsElem(v, elem) {
167
+ var _a, _b, _c, _d;
168
+ let removedFromDiff = (_b = (_a = this.diffPtsMap.get(v)) === null || _a === void 0 ? void 0 : _a.remove(elem)) !== null && _b !== void 0 ? _b : false;
169
+ let removedFromPropa = (_d = (_c = this.propaPtsMap.get(v)) === null || _c === void 0 ? void 0 : _c.remove(elem)) !== null && _d !== void 0 ? _d : false;
170
+ return removedFromDiff || removedFromPropa;
171
+ }
172
+ getDiffPts(v) {
173
+ return this.diffPtsMap.get(v);
174
+ }
175
+ getMutDiffPts(v) {
176
+ if (!this.diffPtsMap.has(v)) {
177
+ this.diffPtsMap.set(v, new this.DSCreator());
178
+ }
179
+ return this.diffPtsMap.get(v);
180
+ }
181
+ getPropaPts(v) {
182
+ return this.propaPtsMap.get(v);
183
+ }
184
+ getPropaPtsMut(v) {
185
+ if (!this.propaPtsMap.has(v)) {
186
+ this.propaPtsMap.set(v, new this.DSCreator());
187
+ }
188
+ return this.propaPtsMap.get(v);
189
+ }
190
+ flush(v) {
191
+ if (!this.diffPtsMap.has(v))
192
+ return;
193
+ let diff = this.diffPtsMap.get(v);
194
+ let propa = this.getPropaPtsMut(v);
195
+ // do not clear origin propa, only copy the pt and add it to diff
196
+ //let propa = this.propaPtsMap.get(v) || new this.DSCreator();
197
+ propa.union(diff);
198
+ diff.clear();
199
+ }
200
+ clearPts(v) {
201
+ let diff = this.diffPtsMap.get(v);
202
+ if (diff)
203
+ diff.clear();
204
+ let propa = this.propaPtsMap.get(v);
205
+ if (propa)
206
+ propa.clear();
207
+ }
208
+ clearDiffPts(v) {
209
+ let diff = this.diffPtsMap.get(v);
210
+ if (diff)
211
+ diff.clear();
212
+ }
213
+ clearPropaPts(v) {
214
+ let propa = this.propaPtsMap.get(v);
215
+ if (propa)
216
+ propa.clear();
217
+ }
218
+ dumpPtData() {
219
+ // TODO: to be implemented
220
+ console.log(this.diffPtsMap);
221
+ console.log(this.propaPtsMap);
222
+ }
223
+ calculateDiff(src, dst) {
224
+ let srcDiff = this.diffPtsMap.get(src);
225
+ let dstPropa = this.propaPtsMap.get(dst);
226
+ if (!dstPropa) {
227
+ return srcDiff.clone();
228
+ }
229
+ let result = srcDiff.clone();
230
+ result.subtract(dstPropa);
231
+ return result;
232
+ }
233
+ }
234
+ exports.DiffPTData = DiffPTData;
@@ -0,0 +1,17 @@
1
+ import { Type } from './Type';
2
+ import { Value } from './Value';
3
+ /**
4
+ * @category core/base
5
+ */
6
+ export declare class Constant implements Value {
7
+ private value;
8
+ private type;
9
+ constructor(value: string, type?: Type);
10
+ getValue(): string;
11
+ setValue(newValue: string): void;
12
+ getUses(): Value[];
13
+ getType(): Type;
14
+ setType(newType: Type): void;
15
+ toString(): string;
16
+ }
17
+ //# sourceMappingURL=Constant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Constant.d.ts","sourceRoot":"","sources":["../../../src/core/base/Constant.ts"],"names":[],"mappings":"AAeA,OAAO,EAAc,IAAI,EAAe,MAAM,QAAQ,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;GAEG;AACH,qBAAa,QAAS,YAAW,KAAK;IAClC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,IAAI,CAAO;gBAEP,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,IAAgC;IAK1D,QAAQ,IAAI,MAAM;IAIlB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAIhC,OAAO,IAAI,KAAK,EAAE;IAIlB,OAAO,IAAI,IAAI;IAIf,OAAO,CAAC,OAAO,EAAE,IAAI,GAAG,IAAI;IAI5B,QAAQ,IAAI,MAAM;CAS5B"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2024 Huawei Device Co., Ltd.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Constant = void 0;
18
+ const Type_1 = require("./Type");
19
+ /**
20
+ * @category core/base
21
+ */
22
+ class Constant {
23
+ constructor(value, type = Type_1.UnknownType.getInstance()) {
24
+ this.value = value;
25
+ this.type = type;
26
+ }
27
+ getValue() {
28
+ return this.value;
29
+ }
30
+ setValue(newValue) {
31
+ this.value = newValue;
32
+ }
33
+ getUses() {
34
+ return [];
35
+ }
36
+ getType() {
37
+ return this.type;
38
+ }
39
+ setType(newType) {
40
+ this.type = newType;
41
+ }
42
+ toString() {
43
+ let str = '';
44
+ if (this.type instanceof Type_1.StringType) {
45
+ str = '\'' + this.value + '\'';
46
+ }
47
+ else {
48
+ str = this.value;
49
+ }
50
+ return str;
51
+ }
52
+ }
53
+ exports.Constant = Constant;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @category core/base
3
+ */
4
+ export declare class Decorator {
5
+ kind: string;
6
+ content: string;
7
+ param: string;
8
+ constructor(name: string);
9
+ getKind(): string;
10
+ setContent(content: string): void;
11
+ getContent(): string;
12
+ setParam(param: string): void;
13
+ getParam(): string;
14
+ }
15
+ //# sourceMappingURL=Decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Decorator.d.ts","sourceRoot":"","sources":["../../../src/core/base/Decorator.ts"],"names":[],"mappings":"AAeA;;GAEG;AACH,qBAAa,SAAS;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAM;IACrB,KAAK,EAAE,MAAM,CAAM;gBACP,IAAI,EAAE,MAAM;IAGjB,OAAO,IAAI,MAAM;IAGjB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAGjC,UAAU,IAAI,MAAM;IAGpB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAG7B,QAAQ,IAAI,MAAM;CAG5B"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2024 Huawei Device Co., Ltd.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.Decorator = void 0;
18
+ /**
19
+ * @category core/base
20
+ */
21
+ class Decorator {
22
+ constructor(name) {
23
+ this.content = '';
24
+ this.param = '';
25
+ this.kind = name;
26
+ }
27
+ getKind() {
28
+ return this.kind;
29
+ }
30
+ setContent(content) {
31
+ this.content = content;
32
+ }
33
+ getContent() {
34
+ return this.content;
35
+ }
36
+ setParam(param) {
37
+ this.param = param;
38
+ }
39
+ getParam() {
40
+ return this.param;
41
+ }
42
+ }
43
+ exports.Decorator = Decorator;
@@ -0,0 +1,9 @@
1
+ import { Value } from './Value';
2
+ import { Stmt } from './Stmt';
3
+ export declare class DefUseChain {
4
+ value: Value;
5
+ def: Stmt;
6
+ use: Stmt;
7
+ constructor(value: Value, def: Stmt, use: Stmt);
8
+ }
9
+ //# sourceMappingURL=DefUseChain.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DefUseChain.d.ts","sourceRoot":"","sources":["../../../src/core/base/DefUseChain.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,qBAAa,WAAW;IACpB,KAAK,EAAC,KAAK,CAAC;IACZ,GAAG,EAAC,IAAI,CAAC;IACT,GAAG,EAAC,IAAI,CAAC;gBACG,KAAK,EAAC,KAAK,EAAC,GAAG,EAAC,IAAI,EAAC,GAAG,EAAC,IAAI;CAK5C"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2024 Huawei Device Co., Ltd.
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.DefUseChain = void 0;
18
+ class DefUseChain {
19
+ constructor(value, def, use) {
20
+ this.value = value;
21
+ this.def = def;
22
+ this.use = use;
23
+ }
24
+ }
25
+ exports.DefUseChain = DefUseChain;
@@ -0,0 +1,219 @@
1
+ import { BasicBlock } from '../graph/BasicBlock';
2
+ import { ArkClass } from '../model/ArkClass';
3
+ import { MethodSignature } from '../model/ArkSignature';
4
+ import { Local } from './Local';
5
+ import { ArrayType, ClassType, Type } from './Type';
6
+ import { Value } from './Value';
7
+ import { AbstractFieldRef } from './Ref';
8
+ /**
9
+ * @category core/base/expr
10
+ */
11
+ export declare abstract class AbstractExpr implements Value {
12
+ abstract getUses(): Value[];
13
+ abstract getType(): Type;
14
+ abstract toString(): string;
15
+ inferType(arkClass: ArkClass): AbstractExpr;
16
+ }
17
+ export declare abstract class AbstractInvokeExpr extends AbstractExpr {
18
+ private methodSignature;
19
+ private args;
20
+ private realGenericTypes?;
21
+ constructor(methodSignature: MethodSignature, args: Value[], realGenericTypes?: Type[]);
22
+ getMethodSignature(): MethodSignature;
23
+ setMethodSignature(newMethodSignature: MethodSignature): void;
24
+ getArg(index: number): Value;
25
+ getArgs(): Value[];
26
+ setArgs(newArgs: Value[]): void;
27
+ getType(): Type;
28
+ getRealGenericTypes(): Type[] | undefined;
29
+ getUses(): Value[];
30
+ }
31
+ export declare class ArkInstanceInvokeExpr extends AbstractInvokeExpr {
32
+ private base;
33
+ constructor(base: Local, methodSignature: MethodSignature, args: Value[], realGenericTypes?: Type[]);
34
+ getBase(): Local;
35
+ setBase(newBase: Local): void;
36
+ getUses(): Value[];
37
+ toString(): string;
38
+ inferType(arkClass: ArkClass): AbstractInvokeExpr;
39
+ private processForEach;
40
+ private tryInferFormGlobal;
41
+ private inferMethod;
42
+ }
43
+ export declare class ArkStaticInvokeExpr extends AbstractInvokeExpr {
44
+ constructor(methodSignature: MethodSignature, args: Value[], realGenericTypes?: Type[]);
45
+ toString(): string;
46
+ inferType(arkClass: ArkClass): ArkStaticInvokeExpr;
47
+ }
48
+ export declare class ArkPtrInvokeExpr extends AbstractInvokeExpr {
49
+ private funPtrLocal;
50
+ constructor(methodSignature: MethodSignature, ptr: Local, args: Value[], realGenericTypes?: Type[]);
51
+ setFunPtrLocal(ptr: Local): void;
52
+ getFuncPtrLocal(): Local;
53
+ toString(): string;
54
+ inferType(arkClass: ArkClass): ArkPtrInvokeExpr;
55
+ }
56
+ export declare class ArkNewExpr extends AbstractExpr {
57
+ private classType;
58
+ constructor(classType: ClassType);
59
+ getClassType(): ClassType;
60
+ getUses(): Value[];
61
+ getType(): Type;
62
+ toString(): string;
63
+ inferType(arkClass: ArkClass): ArkNewExpr;
64
+ }
65
+ export declare class ArkNewArrayExpr extends AbstractExpr {
66
+ private baseType;
67
+ private size;
68
+ private fromLiteral;
69
+ constructor(baseType: Type, size: Value, fromLiteral?: boolean);
70
+ getSize(): Value;
71
+ setSize(newSize: Value): void;
72
+ getType(): ArrayType;
73
+ getBaseType(): Type;
74
+ setBaseType(newType: Type): void;
75
+ isFromLiteral(): boolean;
76
+ inferType(arkClass: ArkClass): ArkNewArrayExpr;
77
+ getUses(): Value[];
78
+ toString(): string;
79
+ }
80
+ export declare class ArkDeleteExpr extends AbstractExpr {
81
+ private field;
82
+ constructor(field: AbstractFieldRef);
83
+ getField(): AbstractFieldRef;
84
+ setField(newField: AbstractFieldRef): void;
85
+ getType(): Type;
86
+ getUses(): Value[];
87
+ toString(): string;
88
+ }
89
+ export declare class ArkAwaitExpr extends AbstractExpr {
90
+ private promise;
91
+ constructor(promise: Value);
92
+ getPromise(): Value;
93
+ setPromise(newPromise: Value): void;
94
+ getType(): Type;
95
+ inferType(arkClass: ArkClass): ArkAwaitExpr;
96
+ getUses(): Value[];
97
+ toString(): string;
98
+ }
99
+ export declare class ArkYieldExpr extends AbstractExpr {
100
+ private yieldValue;
101
+ constructor(yieldValue: Value);
102
+ getYieldValue(): Value;
103
+ setYieldValue(newYieldValue: Value): void;
104
+ getType(): Type;
105
+ getUses(): Value[];
106
+ toString(): string;
107
+ }
108
+ export declare enum NormalBinaryOperator {
109
+ NullishCoalescing = "??",
110
+ Exponentiation = "**",
111
+ Division = "/",
112
+ Addition = "+",
113
+ Subtraction = "-",
114
+ Multiplication = "*",
115
+ Remainder = "%",
116
+ LeftShift = "<<",
117
+ RightShift = ">>",
118
+ UnsignedRightShift = ">>>",
119
+ BitwiseAnd = "&",
120
+ BitwiseOr = "|",
121
+ BitwiseXor = "^",
122
+ LogicalAnd = "&&",
123
+ LogicalOr = "||"
124
+ }
125
+ export declare enum RelationalBinaryOperator {
126
+ LessThan = "<",
127
+ LessThanOrEqual = "<=",
128
+ GreaterThan = ">",
129
+ GreaterThanOrEqual = ">=",
130
+ Equality = "==",
131
+ InEquality = "!=",
132
+ StrictEquality = "===",
133
+ StrictInequality = "!=="
134
+ }
135
+ export type BinaryOperator = NormalBinaryOperator | RelationalBinaryOperator;
136
+ export declare abstract class AbstractBinopExpr extends AbstractExpr {
137
+ protected op1: Value;
138
+ protected op2: Value;
139
+ protected operator: BinaryOperator;
140
+ protected type: Type;
141
+ constructor(op1: Value, op2: Value, operator: BinaryOperator);
142
+ getOp1(): Value;
143
+ setOp1(newOp1: Value): void;
144
+ getOp2(): Value;
145
+ setOp2(newOp2: Value): void;
146
+ getOperator(): BinaryOperator;
147
+ getType(): Type;
148
+ getUses(): Value[];
149
+ toString(): string;
150
+ protected inferOpType(op: Value, arkClass: ArkClass): void;
151
+ protected setType(): void;
152
+ inferType(arkClass: ArkClass): AbstractBinopExpr;
153
+ }
154
+ export declare class ArkConditionExpr extends AbstractBinopExpr {
155
+ constructor(op1: Value, op2: Value, operator: RelationalBinaryOperator);
156
+ inferType(arkClass: ArkClass): ArkConditionExpr;
157
+ }
158
+ export declare class ArkNormalBinopExpr extends AbstractBinopExpr {
159
+ constructor(op1: Value, op2: Value, operator: NormalBinaryOperator);
160
+ }
161
+ export declare class ArkTypeOfExpr extends AbstractExpr {
162
+ private op;
163
+ constructor(op: Value);
164
+ getOp(): Value;
165
+ setOp(newOp: Value): void;
166
+ getUses(): Value[];
167
+ getType(): Type;
168
+ toString(): string;
169
+ }
170
+ export declare class ArkInstanceOfExpr extends AbstractExpr {
171
+ private op;
172
+ private checkType;
173
+ constructor(op: Value, checkType: Type);
174
+ getOp(): Value;
175
+ setOp(newOp: Value): void;
176
+ getCheckType(): Type;
177
+ getType(): Type;
178
+ getUses(): Value[];
179
+ toString(): string;
180
+ }
181
+ export declare class ArkCastExpr extends AbstractExpr {
182
+ private op;
183
+ private type;
184
+ constructor(op: Value, type: Type);
185
+ getOp(): Value;
186
+ setOp(newOp: Value): void;
187
+ getUses(): Value[];
188
+ getType(): Type;
189
+ inferType(arkClass: ArkClass): AbstractExpr;
190
+ toString(): string;
191
+ }
192
+ export declare class ArkPhiExpr extends AbstractExpr {
193
+ private args;
194
+ private argToBlock;
195
+ constructor();
196
+ getUses(): Value[];
197
+ getArgs(): Local[];
198
+ setArgs(args: Local[]): void;
199
+ getArgToBlock(): Map<Local, BasicBlock>;
200
+ setArgToBlock(argToBlock: Map<Local, BasicBlock>): void;
201
+ getType(): Type;
202
+ toString(): string;
203
+ }
204
+ export declare enum UnaryOperator {
205
+ Neg = "-",
206
+ BitwiseNot = "~",
207
+ LogicalNot = "!"
208
+ }
209
+ export declare class ArkUnopExpr extends AbstractExpr {
210
+ private op;
211
+ private operator;
212
+ constructor(op: Value, operator: UnaryOperator);
213
+ getUses(): Value[];
214
+ getOp(): Value;
215
+ getType(): Type;
216
+ getOperator(): UnaryOperator;
217
+ toString(): string;
218
+ }
219
+ //# sourceMappingURL=Expr.d.ts.map