@grain/binaryen.ml 0.10.0 → 0.11.0

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 (75) hide show
  1. binaryen-archive/CHANGELOG.md +22 -0
  2. binaryen-archive/README.md +27 -3
  3. binaryen-archive/binaryen.opam +8 -8
  4. binaryen-archive/esy.lock/index.json +537 -460
  5. binaryen-archive/esy.lock/opam/{base.v0.14.1 → base.v0.14.2}/opam +4 -4
  6. binaryen-archive/esy.lock/opam/biniou.1.2.1/opam +1 -1
  7. binaryen-archive/esy.lock/opam/{cppo.1.6.7 → cppo.1.6.8}/opam +4 -6
  8. binaryen-archive/esy.lock/opam/{csexp.1.4.0 → csexp.1.5.1}/opam +11 -9
  9. binaryen-archive/esy.lock/opam/{dune-build-info.2.8.2 → dune-build-info.2.9.1}/opam +5 -5
  10. binaryen-archive/esy.lock/opam/{dune-configurator.2.8.2 → dune-configurator.2.9.1}/opam +5 -5
  11. binaryen-archive/esy.lock/opam/{dune.2.8.2 → dune.2.9.1}/opam +4 -4
  12. binaryen-archive/esy.lock/opam/easy-format.1.3.2/opam +1 -1
  13. binaryen-archive/esy.lock/opam/{fix.20201120 → fix.20211231}/opam +7 -5
  14. binaryen-archive/esy.lock/opam/js_of_ocaml-compiler.3.11.0/opam +54 -0
  15. binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.11.0/opam +44 -0
  16. binaryen-archive/esy.lock/opam/js_of_ocaml.3.11.0/opam +45 -0
  17. binaryen-archive/esy.lock/opam/{menhir.20201216 → menhir.20211128}/opam +8 -6
  18. binaryen-archive/esy.lock/opam/{menhirLib.20201216 → menhirLib.20211128}/opam +8 -6
  19. binaryen-archive/esy.lock/opam/{menhirSdk.20201216 → menhirSdk.20211128}/opam +8 -6
  20. binaryen-archive/esy.lock/opam/ocaml-compiler-libs.v0.12.4/opam +39 -0
  21. binaryen-archive/esy.lock/opam/{ocaml-lsp-server.1.4.0 → ocaml-lsp-server.1.9.0}/opam +15 -12
  22. binaryen-archive/esy.lock/opam/{ocaml-migrate-parsetree.2.1.0 → ocaml-migrate-parsetree.2.3.0}/opam +13 -10
  23. binaryen-archive/esy.lock/opam/ocaml-version.3.4.0/opam +49 -0
  24. binaryen-archive/esy.lock/opam/ocamlbuild.0.14.0/opam +1 -1
  25. binaryen-archive/esy.lock/opam/{ocamlfind.1.8.1 → ocamlfind.1.9.1}/opam +19 -39
  26. binaryen-archive/esy.lock/opam/ocamlformat-rpc-lib.0.19.0/opam +40 -0
  27. binaryen-archive/esy.lock/opam/ocamlformat.0.18.0/opam +56 -0
  28. binaryen-archive/esy.lock/opam/{odoc.1.5.2 → odoc.1.5.3}/opam +12 -12
  29. binaryen-archive/esy.lock/opam/pp.1.1.2/opam +58 -0
  30. binaryen-archive/esy.lock/opam/ppx_derivers.1.2.1/opam +1 -1
  31. binaryen-archive/esy.lock/opam/ppx_yojson_conv_lib.v0.14.0/opam +2 -2
  32. binaryen-archive/esy.lock/opam/{ppxlib.0.21.0 → ppxlib.0.22.2}/opam +40 -32
  33. binaryen-archive/esy.lock/opam/{re.1.9.0 → re.1.10.3}/opam +8 -4
  34. binaryen-archive/esy.lock/opam/result.1.5/opam +2 -2
  35. binaryen-archive/esy.lock/opam/sexplib0.v0.14.0/opam +2 -2
  36. binaryen-archive/esy.lock/opam/spawn.v0.15.0/opam +56 -0
  37. binaryen-archive/esy.lock/opam/stdio.v0.14.0/opam +2 -2
  38. binaryen-archive/esy.lock/opam/{topkg.1.0.3 → topkg.1.0.4}/opam +18 -22
  39. binaryen-archive/esy.lock/opam/tyxml.4.5.0/opam +42 -0
  40. binaryen-archive/esy.lock/opam/uucp.14.0.0/opam +41 -0
  41. binaryen-archive/esy.lock/opam/{uuseg.13.0.0 → uuseg.14.0.0}/opam +22 -28
  42. binaryen-archive/esy.lock/opam/yojson.1.7.0/opam +1 -1
  43. binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.8.1_opam_override/files/findlib-1.8.1.patch → opam__s__ocamlfind_opam__c__1.9.1_opam_override/files/findlib-1.9.1.patch} +0 -0
  44. binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.8.1_opam_override → opam__s__ocamlfind_opam__c__1.9.1_opam_override}/package.json +1 -1
  45. binaryen-archive/{vendor/js/index.es5.js → js/binaryen.es5.js} +0 -0
  46. binaryen-archive/js/dune +1 -6
  47. binaryen-archive/package.json +14 -20
  48. binaryen-archive/src/dune +3 -41
  49. binaryen-archive/src/ocaml_helpers.c +0 -8
  50. binaryen-archive/src/ocaml_helpers.h +0 -3
  51. binaryen-archive/test/config/dune +8 -0
  52. binaryen-archive/test/config/ocamlopt_flags.ml +16 -0
  53. binaryen-archive/test/dune +4 -0
  54. binaryen-archive/esy.lock/opam/conf-m4.1/opam +0 -22
  55. binaryen-archive/esy.lock/opam/dot-merlin-reader.4.1/opam +0 -30
  56. binaryen-archive/esy.lock/opam/js_of_ocaml-compiler.3.9.1/opam +0 -40
  57. binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.9.0/opam +0 -30
  58. binaryen-archive/esy.lock/opam/js_of_ocaml.3.9.0/opam +0 -31
  59. binaryen-archive/esy.lock/opam/ocaml-compiler-libs.v0.12.3/opam +0 -29
  60. binaryen-archive/esy.lock/opam/ocamlfind.1.8.1/files/ocaml-stub +0 -4
  61. binaryen-archive/esy.lock/opam/ocamlfind.1.8.1/files/ocamlfind.install +0 -6
  62. binaryen-archive/esy.lock/opam/ocamlformat.0.15.1/opam +0 -41
  63. binaryen-archive/esy.lock/opam/tyxml.4.4.0/opam +0 -47
  64. binaryen-archive/esy.lock/opam/uucp.13.0.0/opam +0 -44
  65. binaryen-archive/esy.lock/overrides/opam__s__conf_m4_opam__c__1_opam_override/package.json +0 -6
  66. binaryen-archive/src/config/dune +0 -8
  67. binaryen-archive/src/config/library_flags.ml +0 -16
  68. binaryen-archive/vendor/binaryen-c.h +0 -2720
  69. binaryen-archive/vendor/linux/libbinaryen.a +0 -0
  70. binaryen-archive/vendor/linux/libbinaryen.so +0 -0
  71. binaryen-archive/vendor/macosx/libbinaryen.a +0 -0
  72. binaryen-archive/vendor/macosx/libbinaryen.dylib +0 -0
  73. binaryen-archive/vendor/mingw64/libbinaryen.a +0 -0
  74. binaryen-archive/vendor/mingw64/libbinaryen.dll +0 -0
  75. binaryen-archive/vendor/wasm-delegations.h +0 -83
@@ -1,2720 +0,0 @@
1
- /*
2
- * Copyright 2016 WebAssembly Community Group participants
3
- *
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
-
17
- //================
18
- // Binaryen C API
19
- //
20
- // The first part of the API lets you create modules and their parts.
21
- //
22
- // The second part of the API lets you perform operations on modules.
23
- //
24
- // The third part of the API lets you provide a general control-flow
25
- // graph (CFG) as input.
26
- //
27
- // The final part of the API contains miscellaneous utilities like
28
- // debugging for the API itself.
29
- //
30
- // ---------------
31
- //
32
- // Thread safety: You can create Expressions in parallel, as they do not
33
- // refer to global state. BinaryenAddFunction is also
34
- // thread-safe, which means that you can create functions and
35
- // their contents in multiple threads. This is important since
36
- // functions are where the majority of the work is done.
37
- // Other methods - creating imports, exports, etc. - are
38
- // not currently thread-safe (as there is typically no need
39
- // to parallelize them).
40
- //
41
- //================
42
-
43
- #ifndef wasm_binaryen_c_h
44
- #define wasm_binaryen_c_h
45
-
46
- #include <stdbool.h>
47
- #include <stddef.h>
48
- #include <stdint.h>
49
-
50
- #ifdef __GNUC__
51
- #define WASM_DEPRECATED __attribute__((deprecated))
52
- #elif defined(_MSC_VER)
53
- #define WASM_DEPRECATED __declspec(deprecated)
54
- #else
55
- #define WASM_DEPRECATED
56
- #endif
57
-
58
- #if defined(__EMSCRIPTEN__)
59
- #include <emscripten.h>
60
- #define BINARYEN_API EMSCRIPTEN_KEEPALIVE
61
- #elif defined(_MSC_VER) && !defined(BUILD_STATIC_LIBRARY)
62
- #define BINARYEN_API __declspec(dllexport)
63
- #else
64
- #define BINARYEN_API
65
- #endif
66
-
67
- #ifdef __cplusplus
68
- #define BINARYEN_REF(NAME) \
69
- namespace wasm { \
70
- class NAME; \
71
- }; \
72
- typedef class wasm::NAME* Binaryen##NAME##Ref;
73
- #else
74
- #define BINARYEN_REF(NAME) typedef struct Binaryen##NAME* Binaryen##NAME##Ref;
75
- #endif
76
-
77
- #ifdef __cplusplus
78
- extern "C" {
79
- #endif
80
-
81
- //
82
- // ========== Module Creation ==========
83
- //
84
-
85
- // BinaryenIndex
86
- //
87
- // Used for internal indexes and list sizes.
88
-
89
- typedef uint32_t BinaryenIndex;
90
-
91
- // Core types (call to get the value of each; you can cache them, they
92
- // never change)
93
-
94
- typedef uintptr_t BinaryenType;
95
-
96
- BINARYEN_API BinaryenType BinaryenTypeNone(void);
97
- BINARYEN_API BinaryenType BinaryenTypeInt32(void);
98
- BINARYEN_API BinaryenType BinaryenTypeInt64(void);
99
- BINARYEN_API BinaryenType BinaryenTypeFloat32(void);
100
- BINARYEN_API BinaryenType BinaryenTypeFloat64(void);
101
- BINARYEN_API BinaryenType BinaryenTypeVec128(void);
102
- BINARYEN_API BinaryenType BinaryenTypeFuncref(void);
103
- BINARYEN_API BinaryenType BinaryenTypeExternref(void);
104
- BINARYEN_API BinaryenType BinaryenTypeAnyref(void);
105
- BINARYEN_API BinaryenType BinaryenTypeEqref(void);
106
- BINARYEN_API BinaryenType BinaryenTypeI31ref(void);
107
- BINARYEN_API BinaryenType BinaryenTypeDataref(void);
108
- BINARYEN_API BinaryenType BinaryenTypeUnreachable(void);
109
- // Not a real type. Used as the last parameter to BinaryenBlock to let
110
- // the API figure out the type instead of providing one.
111
- BINARYEN_API BinaryenType BinaryenTypeAuto(void);
112
- BINARYEN_API BinaryenType BinaryenTypeCreate(BinaryenType* valueTypes,
113
- uint32_t numTypes);
114
- BINARYEN_API uint32_t BinaryenTypeArity(BinaryenType t);
115
- BINARYEN_API void BinaryenTypeExpand(BinaryenType t, BinaryenType* buf);
116
-
117
- WASM_DEPRECATED BinaryenType BinaryenNone(void);
118
- WASM_DEPRECATED BinaryenType BinaryenInt32(void);
119
- WASM_DEPRECATED BinaryenType BinaryenInt64(void);
120
- WASM_DEPRECATED BinaryenType BinaryenFloat32(void);
121
- WASM_DEPRECATED BinaryenType BinaryenFloat64(void);
122
- WASM_DEPRECATED BinaryenType BinaryenUndefined(void);
123
-
124
- // Expression ids (call to get the value of each; you can cache them)
125
-
126
- typedef uint32_t BinaryenExpressionId;
127
-
128
- BINARYEN_API BinaryenExpressionId BinaryenInvalidId(void);
129
-
130
- #define DELEGATE(CLASS_TO_VISIT) \
131
- BINARYEN_API BinaryenExpressionId Binaryen##CLASS_TO_VISIT##Id(void);
132
-
133
- #include "wasm-delegations.h"
134
-
135
- // External kinds (call to get the value of each; you can cache them)
136
-
137
- typedef uint32_t BinaryenExternalKind;
138
-
139
- BINARYEN_API BinaryenExternalKind BinaryenExternalFunction(void);
140
- BINARYEN_API BinaryenExternalKind BinaryenExternalTable(void);
141
- BINARYEN_API BinaryenExternalKind BinaryenExternalMemory(void);
142
- BINARYEN_API BinaryenExternalKind BinaryenExternalGlobal(void);
143
- BINARYEN_API BinaryenExternalKind BinaryenExternalEvent(void);
144
-
145
- // Features. Call to get the value of each; you can cache them. Use bitwise
146
- // operators to combine and test particular features.
147
-
148
- typedef uint32_t BinaryenFeatures;
149
-
150
- BINARYEN_API BinaryenFeatures BinaryenFeatureMVP(void);
151
- BINARYEN_API BinaryenFeatures BinaryenFeatureAtomics(void);
152
- BINARYEN_API BinaryenFeatures BinaryenFeatureBulkMemory(void);
153
- BINARYEN_API BinaryenFeatures BinaryenFeatureMutableGlobals(void);
154
- BINARYEN_API BinaryenFeatures BinaryenFeatureNontrappingFPToInt(void);
155
- BINARYEN_API BinaryenFeatures BinaryenFeatureSignExt(void);
156
- BINARYEN_API BinaryenFeatures BinaryenFeatureSIMD128(void);
157
- BINARYEN_API BinaryenFeatures BinaryenFeatureExceptionHandling(void);
158
- BINARYEN_API BinaryenFeatures BinaryenFeatureTailCall(void);
159
- BINARYEN_API BinaryenFeatures BinaryenFeatureReferenceTypes(void);
160
- BINARYEN_API BinaryenFeatures BinaryenFeatureMultivalue(void);
161
- BINARYEN_API BinaryenFeatures BinaryenFeatureGC(void);
162
- BINARYEN_API BinaryenFeatures BinaryenFeatureMemory64(void);
163
- BINARYEN_API BinaryenFeatures BinaryenFeatureTypedFunctionReferences(void);
164
- BINARYEN_API BinaryenFeatures BinaryenFeatureAll(void);
165
-
166
- // Modules
167
- //
168
- // Modules contain lists of functions, imports, exports, function types. The
169
- // Add* methods create them on a module. The module owns them and will free
170
- // their memory when the module is disposed of.
171
- //
172
- // Expressions are also allocated inside modules, and freed with the module.
173
- // They are not created by Add* methods, since they are not added directly on
174
- // the module, instead, they are arguments to other expressions (and then they
175
- // are the children of that AST node), or to a function (and then they are the
176
- // body of that function).
177
- //
178
- // A module can also contain a function table for indirect calls, a memory,
179
- // and a start method.
180
-
181
- BINARYEN_REF(Module);
182
-
183
- BINARYEN_API BinaryenModuleRef BinaryenModuleCreate(void);
184
- BINARYEN_API void BinaryenModuleDispose(BinaryenModuleRef module);
185
-
186
- // Literals. These are passed by value.
187
-
188
- struct BinaryenLiteral {
189
- uintptr_t type;
190
- union {
191
- int32_t i32;
192
- int64_t i64;
193
- float f32;
194
- double f64;
195
- uint8_t v128[16];
196
- const char* func;
197
- };
198
- };
199
-
200
- BINARYEN_API struct BinaryenLiteral BinaryenLiteralInt32(int32_t x);
201
- BINARYEN_API struct BinaryenLiteral BinaryenLiteralInt64(int64_t x);
202
- BINARYEN_API struct BinaryenLiteral BinaryenLiteralFloat32(float x);
203
- BINARYEN_API struct BinaryenLiteral BinaryenLiteralFloat64(double x);
204
- BINARYEN_API struct BinaryenLiteral BinaryenLiteralVec128(const uint8_t x[16]);
205
- BINARYEN_API struct BinaryenLiteral BinaryenLiteralFloat32Bits(int32_t x);
206
- BINARYEN_API struct BinaryenLiteral BinaryenLiteralFloat64Bits(int64_t x);
207
-
208
- // Expressions
209
- //
210
- // Some expressions have a BinaryenOp, which is the more
211
- // specific operation/opcode.
212
- //
213
- // Some expressions have optional parameters, like Return may not
214
- // return a value. You can supply a NULL pointer in those cases.
215
- //
216
- // For more information, see wasm.h
217
-
218
- typedef int32_t BinaryenOp;
219
-
220
- BINARYEN_API BinaryenOp BinaryenClzInt32(void);
221
- BINARYEN_API BinaryenOp BinaryenCtzInt32(void);
222
- BINARYEN_API BinaryenOp BinaryenPopcntInt32(void);
223
- BINARYEN_API BinaryenOp BinaryenNegFloat32(void);
224
- BINARYEN_API BinaryenOp BinaryenAbsFloat32(void);
225
- BINARYEN_API BinaryenOp BinaryenCeilFloat32(void);
226
- BINARYEN_API BinaryenOp BinaryenFloorFloat32(void);
227
- BINARYEN_API BinaryenOp BinaryenTruncFloat32(void);
228
- BINARYEN_API BinaryenOp BinaryenNearestFloat32(void);
229
- BINARYEN_API BinaryenOp BinaryenSqrtFloat32(void);
230
- BINARYEN_API BinaryenOp BinaryenEqZInt32(void);
231
- BINARYEN_API BinaryenOp BinaryenClzInt64(void);
232
- BINARYEN_API BinaryenOp BinaryenCtzInt64(void);
233
- BINARYEN_API BinaryenOp BinaryenPopcntInt64(void);
234
- BINARYEN_API BinaryenOp BinaryenNegFloat64(void);
235
- BINARYEN_API BinaryenOp BinaryenAbsFloat64(void);
236
- BINARYEN_API BinaryenOp BinaryenCeilFloat64(void);
237
- BINARYEN_API BinaryenOp BinaryenFloorFloat64(void);
238
- BINARYEN_API BinaryenOp BinaryenTruncFloat64(void);
239
- BINARYEN_API BinaryenOp BinaryenNearestFloat64(void);
240
- BINARYEN_API BinaryenOp BinaryenSqrtFloat64(void);
241
- BINARYEN_API BinaryenOp BinaryenEqZInt64(void);
242
- BINARYEN_API BinaryenOp BinaryenExtendSInt32(void);
243
- BINARYEN_API BinaryenOp BinaryenExtendUInt32(void);
244
- BINARYEN_API BinaryenOp BinaryenWrapInt64(void);
245
- BINARYEN_API BinaryenOp BinaryenTruncSFloat32ToInt32(void);
246
- BINARYEN_API BinaryenOp BinaryenTruncSFloat32ToInt64(void);
247
- BINARYEN_API BinaryenOp BinaryenTruncUFloat32ToInt32(void);
248
- BINARYEN_API BinaryenOp BinaryenTruncUFloat32ToInt64(void);
249
- BINARYEN_API BinaryenOp BinaryenTruncSFloat64ToInt32(void);
250
- BINARYEN_API BinaryenOp BinaryenTruncSFloat64ToInt64(void);
251
- BINARYEN_API BinaryenOp BinaryenTruncUFloat64ToInt32(void);
252
- BINARYEN_API BinaryenOp BinaryenTruncUFloat64ToInt64(void);
253
- BINARYEN_API BinaryenOp BinaryenReinterpretFloat32(void);
254
- BINARYEN_API BinaryenOp BinaryenReinterpretFloat64(void);
255
- BINARYEN_API BinaryenOp BinaryenConvertSInt32ToFloat32(void);
256
- BINARYEN_API BinaryenOp BinaryenConvertSInt32ToFloat64(void);
257
- BINARYEN_API BinaryenOp BinaryenConvertUInt32ToFloat32(void);
258
- BINARYEN_API BinaryenOp BinaryenConvertUInt32ToFloat64(void);
259
- BINARYEN_API BinaryenOp BinaryenConvertSInt64ToFloat32(void);
260
- BINARYEN_API BinaryenOp BinaryenConvertSInt64ToFloat64(void);
261
- BINARYEN_API BinaryenOp BinaryenConvertUInt64ToFloat32(void);
262
- BINARYEN_API BinaryenOp BinaryenConvertUInt64ToFloat64(void);
263
- BINARYEN_API BinaryenOp BinaryenPromoteFloat32(void);
264
- BINARYEN_API BinaryenOp BinaryenDemoteFloat64(void);
265
- BINARYEN_API BinaryenOp BinaryenReinterpretInt32(void);
266
- BINARYEN_API BinaryenOp BinaryenReinterpretInt64(void);
267
- BINARYEN_API BinaryenOp BinaryenExtendS8Int32(void);
268
- BINARYEN_API BinaryenOp BinaryenExtendS16Int32(void);
269
- BINARYEN_API BinaryenOp BinaryenExtendS8Int64(void);
270
- BINARYEN_API BinaryenOp BinaryenExtendS16Int64(void);
271
- BINARYEN_API BinaryenOp BinaryenExtendS32Int64(void);
272
- BINARYEN_API BinaryenOp BinaryenAddInt32(void);
273
- BINARYEN_API BinaryenOp BinaryenSubInt32(void);
274
- BINARYEN_API BinaryenOp BinaryenMulInt32(void);
275
- BINARYEN_API BinaryenOp BinaryenDivSInt32(void);
276
- BINARYEN_API BinaryenOp BinaryenDivUInt32(void);
277
- BINARYEN_API BinaryenOp BinaryenRemSInt32(void);
278
- BINARYEN_API BinaryenOp BinaryenRemUInt32(void);
279
- BINARYEN_API BinaryenOp BinaryenAndInt32(void);
280
- BINARYEN_API BinaryenOp BinaryenOrInt32(void);
281
- BINARYEN_API BinaryenOp BinaryenXorInt32(void);
282
- BINARYEN_API BinaryenOp BinaryenShlInt32(void);
283
- BINARYEN_API BinaryenOp BinaryenShrUInt32(void);
284
- BINARYEN_API BinaryenOp BinaryenShrSInt32(void);
285
- BINARYEN_API BinaryenOp BinaryenRotLInt32(void);
286
- BINARYEN_API BinaryenOp BinaryenRotRInt32(void);
287
- BINARYEN_API BinaryenOp BinaryenEqInt32(void);
288
- BINARYEN_API BinaryenOp BinaryenNeInt32(void);
289
- BINARYEN_API BinaryenOp BinaryenLtSInt32(void);
290
- BINARYEN_API BinaryenOp BinaryenLtUInt32(void);
291
- BINARYEN_API BinaryenOp BinaryenLeSInt32(void);
292
- BINARYEN_API BinaryenOp BinaryenLeUInt32(void);
293
- BINARYEN_API BinaryenOp BinaryenGtSInt32(void);
294
- BINARYEN_API BinaryenOp BinaryenGtUInt32(void);
295
- BINARYEN_API BinaryenOp BinaryenGeSInt32(void);
296
- BINARYEN_API BinaryenOp BinaryenGeUInt32(void);
297
- BINARYEN_API BinaryenOp BinaryenAddInt64(void);
298
- BINARYEN_API BinaryenOp BinaryenSubInt64(void);
299
- BINARYEN_API BinaryenOp BinaryenMulInt64(void);
300
- BINARYEN_API BinaryenOp BinaryenDivSInt64(void);
301
- BINARYEN_API BinaryenOp BinaryenDivUInt64(void);
302
- BINARYEN_API BinaryenOp BinaryenRemSInt64(void);
303
- BINARYEN_API BinaryenOp BinaryenRemUInt64(void);
304
- BINARYEN_API BinaryenOp BinaryenAndInt64(void);
305
- BINARYEN_API BinaryenOp BinaryenOrInt64(void);
306
- BINARYEN_API BinaryenOp BinaryenXorInt64(void);
307
- BINARYEN_API BinaryenOp BinaryenShlInt64(void);
308
- BINARYEN_API BinaryenOp BinaryenShrUInt64(void);
309
- BINARYEN_API BinaryenOp BinaryenShrSInt64(void);
310
- BINARYEN_API BinaryenOp BinaryenRotLInt64(void);
311
- BINARYEN_API BinaryenOp BinaryenRotRInt64(void);
312
- BINARYEN_API BinaryenOp BinaryenEqInt64(void);
313
- BINARYEN_API BinaryenOp BinaryenNeInt64(void);
314
- BINARYEN_API BinaryenOp BinaryenLtSInt64(void);
315
- BINARYEN_API BinaryenOp BinaryenLtUInt64(void);
316
- BINARYEN_API BinaryenOp BinaryenLeSInt64(void);
317
- BINARYEN_API BinaryenOp BinaryenLeUInt64(void);
318
- BINARYEN_API BinaryenOp BinaryenGtSInt64(void);
319
- BINARYEN_API BinaryenOp BinaryenGtUInt64(void);
320
- BINARYEN_API BinaryenOp BinaryenGeSInt64(void);
321
- BINARYEN_API BinaryenOp BinaryenGeUInt64(void);
322
- BINARYEN_API BinaryenOp BinaryenAddFloat32(void);
323
- BINARYEN_API BinaryenOp BinaryenSubFloat32(void);
324
- BINARYEN_API BinaryenOp BinaryenMulFloat32(void);
325
- BINARYEN_API BinaryenOp BinaryenDivFloat32(void);
326
- BINARYEN_API BinaryenOp BinaryenCopySignFloat32(void);
327
- BINARYEN_API BinaryenOp BinaryenMinFloat32(void);
328
- BINARYEN_API BinaryenOp BinaryenMaxFloat32(void);
329
- BINARYEN_API BinaryenOp BinaryenEqFloat32(void);
330
- BINARYEN_API BinaryenOp BinaryenNeFloat32(void);
331
- BINARYEN_API BinaryenOp BinaryenLtFloat32(void);
332
- BINARYEN_API BinaryenOp BinaryenLeFloat32(void);
333
- BINARYEN_API BinaryenOp BinaryenGtFloat32(void);
334
- BINARYEN_API BinaryenOp BinaryenGeFloat32(void);
335
- BINARYEN_API BinaryenOp BinaryenAddFloat64(void);
336
- BINARYEN_API BinaryenOp BinaryenSubFloat64(void);
337
- BINARYEN_API BinaryenOp BinaryenMulFloat64(void);
338
- BINARYEN_API BinaryenOp BinaryenDivFloat64(void);
339
- BINARYEN_API BinaryenOp BinaryenCopySignFloat64(void);
340
- BINARYEN_API BinaryenOp BinaryenMinFloat64(void);
341
- BINARYEN_API BinaryenOp BinaryenMaxFloat64(void);
342
- BINARYEN_API BinaryenOp BinaryenEqFloat64(void);
343
- BINARYEN_API BinaryenOp BinaryenNeFloat64(void);
344
- BINARYEN_API BinaryenOp BinaryenLtFloat64(void);
345
- BINARYEN_API BinaryenOp BinaryenLeFloat64(void);
346
- BINARYEN_API BinaryenOp BinaryenGtFloat64(void);
347
- BINARYEN_API BinaryenOp BinaryenGeFloat64(void);
348
- BINARYEN_API BinaryenOp BinaryenAtomicRMWAdd(void);
349
- BINARYEN_API BinaryenOp BinaryenAtomicRMWSub(void);
350
- BINARYEN_API BinaryenOp BinaryenAtomicRMWAnd(void);
351
- BINARYEN_API BinaryenOp BinaryenAtomicRMWOr(void);
352
- BINARYEN_API BinaryenOp BinaryenAtomicRMWXor(void);
353
- BINARYEN_API BinaryenOp BinaryenAtomicRMWXchg(void);
354
- BINARYEN_API BinaryenOp BinaryenTruncSatSFloat32ToInt32(void);
355
- BINARYEN_API BinaryenOp BinaryenTruncSatSFloat32ToInt64(void);
356
- BINARYEN_API BinaryenOp BinaryenTruncSatUFloat32ToInt32(void);
357
- BINARYEN_API BinaryenOp BinaryenTruncSatUFloat32ToInt64(void);
358
- BINARYEN_API BinaryenOp BinaryenTruncSatSFloat64ToInt32(void);
359
- BINARYEN_API BinaryenOp BinaryenTruncSatSFloat64ToInt64(void);
360
- BINARYEN_API BinaryenOp BinaryenTruncSatUFloat64ToInt32(void);
361
- BINARYEN_API BinaryenOp BinaryenTruncSatUFloat64ToInt64(void);
362
- BINARYEN_API BinaryenOp BinaryenSplatVecI8x16(void);
363
- BINARYEN_API BinaryenOp BinaryenExtractLaneSVecI8x16(void);
364
- BINARYEN_API BinaryenOp BinaryenExtractLaneUVecI8x16(void);
365
- BINARYEN_API BinaryenOp BinaryenReplaceLaneVecI8x16(void);
366
- BINARYEN_API BinaryenOp BinaryenSplatVecI16x8(void);
367
- BINARYEN_API BinaryenOp BinaryenExtractLaneSVecI16x8(void);
368
- BINARYEN_API BinaryenOp BinaryenExtractLaneUVecI16x8(void);
369
- BINARYEN_API BinaryenOp BinaryenReplaceLaneVecI16x8(void);
370
- BINARYEN_API BinaryenOp BinaryenSplatVecI32x4(void);
371
- BINARYEN_API BinaryenOp BinaryenExtractLaneVecI32x4(void);
372
- BINARYEN_API BinaryenOp BinaryenReplaceLaneVecI32x4(void);
373
- BINARYEN_API BinaryenOp BinaryenSplatVecI64x2(void);
374
- BINARYEN_API BinaryenOp BinaryenExtractLaneVecI64x2(void);
375
- BINARYEN_API BinaryenOp BinaryenReplaceLaneVecI64x2(void);
376
- BINARYEN_API BinaryenOp BinaryenSplatVecF32x4(void);
377
- BINARYEN_API BinaryenOp BinaryenExtractLaneVecF32x4(void);
378
- BINARYEN_API BinaryenOp BinaryenReplaceLaneVecF32x4(void);
379
- BINARYEN_API BinaryenOp BinaryenSplatVecF64x2(void);
380
- BINARYEN_API BinaryenOp BinaryenExtractLaneVecF64x2(void);
381
- BINARYEN_API BinaryenOp BinaryenReplaceLaneVecF64x2(void);
382
- BINARYEN_API BinaryenOp BinaryenEqVecI8x16(void);
383
- BINARYEN_API BinaryenOp BinaryenNeVecI8x16(void);
384
- BINARYEN_API BinaryenOp BinaryenLtSVecI8x16(void);
385
- BINARYEN_API BinaryenOp BinaryenLtUVecI8x16(void);
386
- BINARYEN_API BinaryenOp BinaryenGtSVecI8x16(void);
387
- BINARYEN_API BinaryenOp BinaryenGtUVecI8x16(void);
388
- BINARYEN_API BinaryenOp BinaryenLeSVecI8x16(void);
389
- BINARYEN_API BinaryenOp BinaryenLeUVecI8x16(void);
390
- BINARYEN_API BinaryenOp BinaryenGeSVecI8x16(void);
391
- BINARYEN_API BinaryenOp BinaryenGeUVecI8x16(void);
392
- BINARYEN_API BinaryenOp BinaryenEqVecI16x8(void);
393
- BINARYEN_API BinaryenOp BinaryenNeVecI16x8(void);
394
- BINARYEN_API BinaryenOp BinaryenLtSVecI16x8(void);
395
- BINARYEN_API BinaryenOp BinaryenLtUVecI16x8(void);
396
- BINARYEN_API BinaryenOp BinaryenGtSVecI16x8(void);
397
- BINARYEN_API BinaryenOp BinaryenGtUVecI16x8(void);
398
- BINARYEN_API BinaryenOp BinaryenLeSVecI16x8(void);
399
- BINARYEN_API BinaryenOp BinaryenLeUVecI16x8(void);
400
- BINARYEN_API BinaryenOp BinaryenGeSVecI16x8(void);
401
- BINARYEN_API BinaryenOp BinaryenGeUVecI16x8(void);
402
- BINARYEN_API BinaryenOp BinaryenEqVecI32x4(void);
403
- BINARYEN_API BinaryenOp BinaryenNeVecI32x4(void);
404
- BINARYEN_API BinaryenOp BinaryenLtSVecI32x4(void);
405
- BINARYEN_API BinaryenOp BinaryenLtUVecI32x4(void);
406
- BINARYEN_API BinaryenOp BinaryenGtSVecI32x4(void);
407
- BINARYEN_API BinaryenOp BinaryenGtUVecI32x4(void);
408
- BINARYEN_API BinaryenOp BinaryenLeSVecI32x4(void);
409
- BINARYEN_API BinaryenOp BinaryenLeUVecI32x4(void);
410
- BINARYEN_API BinaryenOp BinaryenGeSVecI32x4(void);
411
- BINARYEN_API BinaryenOp BinaryenGeUVecI32x4(void);
412
- BINARYEN_API BinaryenOp BinaryenEqVecI64x2(void);
413
- BINARYEN_API BinaryenOp BinaryenNeVecI64x2(void);
414
- BINARYEN_API BinaryenOp BinaryenLtSVecI64x2(void);
415
- BINARYEN_API BinaryenOp BinaryenGtSVecI64x2(void);
416
- BINARYEN_API BinaryenOp BinaryenLeSVecI64x2(void);
417
- BINARYEN_API BinaryenOp BinaryenGeSVecI64x2(void);
418
- BINARYEN_API BinaryenOp BinaryenEqVecF32x4(void);
419
- BINARYEN_API BinaryenOp BinaryenNeVecF32x4(void);
420
- BINARYEN_API BinaryenOp BinaryenLtVecF32x4(void);
421
- BINARYEN_API BinaryenOp BinaryenGtVecF32x4(void);
422
- BINARYEN_API BinaryenOp BinaryenLeVecF32x4(void);
423
- BINARYEN_API BinaryenOp BinaryenGeVecF32x4(void);
424
- BINARYEN_API BinaryenOp BinaryenEqVecF64x2(void);
425
- BINARYEN_API BinaryenOp BinaryenNeVecF64x2(void);
426
- BINARYEN_API BinaryenOp BinaryenLtVecF64x2(void);
427
- BINARYEN_API BinaryenOp BinaryenGtVecF64x2(void);
428
- BINARYEN_API BinaryenOp BinaryenLeVecF64x2(void);
429
- BINARYEN_API BinaryenOp BinaryenGeVecF64x2(void);
430
- BINARYEN_API BinaryenOp BinaryenNotVec128(void);
431
- BINARYEN_API BinaryenOp BinaryenAndVec128(void);
432
- BINARYEN_API BinaryenOp BinaryenOrVec128(void);
433
- BINARYEN_API BinaryenOp BinaryenXorVec128(void);
434
- BINARYEN_API BinaryenOp BinaryenAndNotVec128(void);
435
- BINARYEN_API BinaryenOp BinaryenBitselectVec128(void);
436
- BINARYEN_API BinaryenOp BinaryenAnyTrueVec128(void);
437
- BINARYEN_API BinaryenOp BinaryenPopcntVecI8x16(void);
438
- BINARYEN_API BinaryenOp BinaryenAbsVecI8x16(void);
439
- BINARYEN_API BinaryenOp BinaryenNegVecI8x16(void);
440
- BINARYEN_API BinaryenOp BinaryenAllTrueVecI8x16(void);
441
- BINARYEN_API BinaryenOp BinaryenBitmaskVecI8x16(void);
442
- BINARYEN_API BinaryenOp BinaryenShlVecI8x16(void);
443
- BINARYEN_API BinaryenOp BinaryenShrSVecI8x16(void);
444
- BINARYEN_API BinaryenOp BinaryenShrUVecI8x16(void);
445
- BINARYEN_API BinaryenOp BinaryenAddVecI8x16(void);
446
- BINARYEN_API BinaryenOp BinaryenAddSatSVecI8x16(void);
447
- BINARYEN_API BinaryenOp BinaryenAddSatUVecI8x16(void);
448
- BINARYEN_API BinaryenOp BinaryenSubVecI8x16(void);
449
- BINARYEN_API BinaryenOp BinaryenSubSatSVecI8x16(void);
450
- BINARYEN_API BinaryenOp BinaryenSubSatUVecI8x16(void);
451
- BINARYEN_API BinaryenOp BinaryenMinSVecI8x16(void);
452
- BINARYEN_API BinaryenOp BinaryenMinUVecI8x16(void);
453
- BINARYEN_API BinaryenOp BinaryenMaxSVecI8x16(void);
454
- BINARYEN_API BinaryenOp BinaryenMaxUVecI8x16(void);
455
- BINARYEN_API BinaryenOp BinaryenAvgrUVecI8x16(void);
456
- BINARYEN_API BinaryenOp BinaryenAbsVecI16x8(void);
457
- BINARYEN_API BinaryenOp BinaryenNegVecI16x8(void);
458
- BINARYEN_API BinaryenOp BinaryenAllTrueVecI16x8(void);
459
- BINARYEN_API BinaryenOp BinaryenBitmaskVecI16x8(void);
460
- BINARYEN_API BinaryenOp BinaryenShlVecI16x8(void);
461
- BINARYEN_API BinaryenOp BinaryenShrSVecI16x8(void);
462
- BINARYEN_API BinaryenOp BinaryenShrUVecI16x8(void);
463
- BINARYEN_API BinaryenOp BinaryenAddVecI16x8(void);
464
- BINARYEN_API BinaryenOp BinaryenAddSatSVecI16x8(void);
465
- BINARYEN_API BinaryenOp BinaryenAddSatUVecI16x8(void);
466
- BINARYEN_API BinaryenOp BinaryenSubVecI16x8(void);
467
- BINARYEN_API BinaryenOp BinaryenSubSatSVecI16x8(void);
468
- BINARYEN_API BinaryenOp BinaryenSubSatUVecI16x8(void);
469
- BINARYEN_API BinaryenOp BinaryenMulVecI16x8(void);
470
- BINARYEN_API BinaryenOp BinaryenMinSVecI16x8(void);
471
- BINARYEN_API BinaryenOp BinaryenMinUVecI16x8(void);
472
- BINARYEN_API BinaryenOp BinaryenMaxSVecI16x8(void);
473
- BINARYEN_API BinaryenOp BinaryenMaxUVecI16x8(void);
474
- BINARYEN_API BinaryenOp BinaryenAvgrUVecI16x8(void);
475
- BINARYEN_API BinaryenOp BinaryenQ15MulrSatSVecI16x8(void);
476
- BINARYEN_API BinaryenOp BinaryenExtMulLowSVecI16x8(void);
477
- BINARYEN_API BinaryenOp BinaryenExtMulHighSVecI16x8(void);
478
- BINARYEN_API BinaryenOp BinaryenExtMulLowUVecI16x8(void);
479
- BINARYEN_API BinaryenOp BinaryenExtMulHighUVecI16x8(void);
480
- BINARYEN_API BinaryenOp BinaryenAbsVecI32x4(void);
481
- BINARYEN_API BinaryenOp BinaryenNegVecI32x4(void);
482
- BINARYEN_API BinaryenOp BinaryenAllTrueVecI32x4(void);
483
- BINARYEN_API BinaryenOp BinaryenBitmaskVecI32x4(void);
484
- BINARYEN_API BinaryenOp BinaryenShlVecI32x4(void);
485
- BINARYEN_API BinaryenOp BinaryenShrSVecI32x4(void);
486
- BINARYEN_API BinaryenOp BinaryenShrUVecI32x4(void);
487
- BINARYEN_API BinaryenOp BinaryenAddVecI32x4(void);
488
- BINARYEN_API BinaryenOp BinaryenSubVecI32x4(void);
489
- BINARYEN_API BinaryenOp BinaryenMulVecI32x4(void);
490
- BINARYEN_API BinaryenOp BinaryenMinSVecI32x4(void);
491
- BINARYEN_API BinaryenOp BinaryenMinUVecI32x4(void);
492
- BINARYEN_API BinaryenOp BinaryenMaxSVecI32x4(void);
493
- BINARYEN_API BinaryenOp BinaryenMaxUVecI32x4(void);
494
- BINARYEN_API BinaryenOp BinaryenDotSVecI16x8ToVecI32x4(void);
495
- BINARYEN_API BinaryenOp BinaryenExtMulLowSVecI32x4(void);
496
- BINARYEN_API BinaryenOp BinaryenExtMulHighSVecI32x4(void);
497
- BINARYEN_API BinaryenOp BinaryenExtMulLowUVecI32x4(void);
498
- BINARYEN_API BinaryenOp BinaryenExtMulHighUVecI32x4(void);
499
- BINARYEN_API BinaryenOp BinaryenAbsVecI64x2(void);
500
- BINARYEN_API BinaryenOp BinaryenNegVecI64x2(void);
501
- BINARYEN_API BinaryenOp BinaryenAllTrueVecI64x2(void);
502
- BINARYEN_API BinaryenOp BinaryenBitmaskVecI64x2(void);
503
- BINARYEN_API BinaryenOp BinaryenShlVecI64x2(void);
504
- BINARYEN_API BinaryenOp BinaryenShrSVecI64x2(void);
505
- BINARYEN_API BinaryenOp BinaryenShrUVecI64x2(void);
506
- BINARYEN_API BinaryenOp BinaryenAddVecI64x2(void);
507
- BINARYEN_API BinaryenOp BinaryenSubVecI64x2(void);
508
- BINARYEN_API BinaryenOp BinaryenMulVecI64x2(void);
509
- BINARYEN_API BinaryenOp BinaryenExtMulLowSVecI64x2(void);
510
- BINARYEN_API BinaryenOp BinaryenExtMulHighSVecI64x2(void);
511
- BINARYEN_API BinaryenOp BinaryenExtMulLowUVecI64x2(void);
512
- BINARYEN_API BinaryenOp BinaryenExtMulHighUVecI64x2(void);
513
- BINARYEN_API BinaryenOp BinaryenAbsVecF32x4(void);
514
- BINARYEN_API BinaryenOp BinaryenNegVecF32x4(void);
515
- BINARYEN_API BinaryenOp BinaryenSqrtVecF32x4(void);
516
- BINARYEN_API BinaryenOp BinaryenAddVecF32x4(void);
517
- BINARYEN_API BinaryenOp BinaryenSubVecF32x4(void);
518
- BINARYEN_API BinaryenOp BinaryenMulVecF32x4(void);
519
- BINARYEN_API BinaryenOp BinaryenDivVecF32x4(void);
520
- BINARYEN_API BinaryenOp BinaryenMinVecF32x4(void);
521
- BINARYEN_API BinaryenOp BinaryenMaxVecF32x4(void);
522
- BINARYEN_API BinaryenOp BinaryenPMinVecF32x4(void);
523
- BINARYEN_API BinaryenOp BinaryenPMaxVecF32x4(void);
524
- BINARYEN_API BinaryenOp BinaryenCeilVecF32x4(void);
525
- BINARYEN_API BinaryenOp BinaryenFloorVecF32x4(void);
526
- BINARYEN_API BinaryenOp BinaryenTruncVecF32x4(void);
527
- BINARYEN_API BinaryenOp BinaryenNearestVecF32x4(void);
528
- BINARYEN_API BinaryenOp BinaryenAbsVecF64x2(void);
529
- BINARYEN_API BinaryenOp BinaryenNegVecF64x2(void);
530
- BINARYEN_API BinaryenOp BinaryenSqrtVecF64x2(void);
531
- BINARYEN_API BinaryenOp BinaryenAddVecF64x2(void);
532
- BINARYEN_API BinaryenOp BinaryenSubVecF64x2(void);
533
- BINARYEN_API BinaryenOp BinaryenMulVecF64x2(void);
534
- BINARYEN_API BinaryenOp BinaryenDivVecF64x2(void);
535
- BINARYEN_API BinaryenOp BinaryenMinVecF64x2(void);
536
- BINARYEN_API BinaryenOp BinaryenMaxVecF64x2(void);
537
- BINARYEN_API BinaryenOp BinaryenPMinVecF64x2(void);
538
- BINARYEN_API BinaryenOp BinaryenPMaxVecF64x2(void);
539
- BINARYEN_API BinaryenOp BinaryenCeilVecF64x2(void);
540
- BINARYEN_API BinaryenOp BinaryenFloorVecF64x2(void);
541
- BINARYEN_API BinaryenOp BinaryenTruncVecF64x2(void);
542
- BINARYEN_API BinaryenOp BinaryenNearestVecF64x2(void);
543
- BINARYEN_API BinaryenOp BinaryenExtAddPairwiseSVecI8x16ToI16x8(void);
544
- BINARYEN_API BinaryenOp BinaryenExtAddPairwiseUVecI8x16ToI16x8(void);
545
- BINARYEN_API BinaryenOp BinaryenExtAddPairwiseSVecI16x8ToI32x4(void);
546
- BINARYEN_API BinaryenOp BinaryenExtAddPairwiseUVecI16x8ToI32x4(void);
547
- BINARYEN_API BinaryenOp BinaryenTruncSatSVecF32x4ToVecI32x4(void);
548
- BINARYEN_API BinaryenOp BinaryenTruncSatUVecF32x4ToVecI32x4(void);
549
- BINARYEN_API BinaryenOp BinaryenConvertSVecI32x4ToVecF32x4(void);
550
- BINARYEN_API BinaryenOp BinaryenConvertUVecI32x4ToVecF32x4(void);
551
- BINARYEN_API BinaryenOp BinaryenLoad8SplatVec128(void);
552
- BINARYEN_API BinaryenOp BinaryenLoad16SplatVec128(void);
553
- BINARYEN_API BinaryenOp BinaryenLoad32SplatVec128(void);
554
- BINARYEN_API BinaryenOp BinaryenLoad64SplatVec128(void);
555
- BINARYEN_API BinaryenOp BinaryenLoad8x8SVec128(void);
556
- BINARYEN_API BinaryenOp BinaryenLoad8x8UVec128(void);
557
- BINARYEN_API BinaryenOp BinaryenLoad16x4SVec128(void);
558
- BINARYEN_API BinaryenOp BinaryenLoad16x4UVec128(void);
559
- BINARYEN_API BinaryenOp BinaryenLoad32x2SVec128(void);
560
- BINARYEN_API BinaryenOp BinaryenLoad32x2UVec128(void);
561
- BINARYEN_API BinaryenOp BinaryenLoad32ZeroVec128(void);
562
- BINARYEN_API BinaryenOp BinaryenLoad64ZeroVec128(void);
563
- BINARYEN_API BinaryenOp BinaryenLoad8LaneVec128(void);
564
- BINARYEN_API BinaryenOp BinaryenLoad16LaneVec128(void);
565
- BINARYEN_API BinaryenOp BinaryenLoad32LaneVec128(void);
566
- BINARYEN_API BinaryenOp BinaryenLoad64LaneVec128(void);
567
- BINARYEN_API BinaryenOp BinaryenStore8LaneVec128(void);
568
- BINARYEN_API BinaryenOp BinaryenStore16LaneVec128(void);
569
- BINARYEN_API BinaryenOp BinaryenStore32LaneVec128(void);
570
- BINARYEN_API BinaryenOp BinaryenStore64LaneVec128(void);
571
- BINARYEN_API BinaryenOp BinaryenNarrowSVecI16x8ToVecI8x16(void);
572
- BINARYEN_API BinaryenOp BinaryenNarrowUVecI16x8ToVecI8x16(void);
573
- BINARYEN_API BinaryenOp BinaryenNarrowSVecI32x4ToVecI16x8(void);
574
- BINARYEN_API BinaryenOp BinaryenNarrowUVecI32x4ToVecI16x8(void);
575
- BINARYEN_API BinaryenOp BinaryenExtendLowSVecI8x16ToVecI16x8(void);
576
- BINARYEN_API BinaryenOp BinaryenExtendHighSVecI8x16ToVecI16x8(void);
577
- BINARYEN_API BinaryenOp BinaryenExtendLowUVecI8x16ToVecI16x8(void);
578
- BINARYEN_API BinaryenOp BinaryenExtendHighUVecI8x16ToVecI16x8(void);
579
- BINARYEN_API BinaryenOp BinaryenExtendLowSVecI16x8ToVecI32x4(void);
580
- BINARYEN_API BinaryenOp BinaryenExtendHighSVecI16x8ToVecI32x4(void);
581
- BINARYEN_API BinaryenOp BinaryenExtendLowUVecI16x8ToVecI32x4(void);
582
- BINARYEN_API BinaryenOp BinaryenExtendHighUVecI16x8ToVecI32x4(void);
583
- BINARYEN_API BinaryenOp BinaryenExtendLowSVecI32x4ToVecI64x2(void);
584
- BINARYEN_API BinaryenOp BinaryenExtendHighSVecI32x4ToVecI64x2(void);
585
- BINARYEN_API BinaryenOp BinaryenExtendLowUVecI32x4ToVecI64x2(void);
586
- BINARYEN_API BinaryenOp BinaryenExtendHighUVecI32x4ToVecI64x2(void);
587
- BINARYEN_API BinaryenOp BinaryenConvertLowSVecI32x4ToVecF64x2(void);
588
- BINARYEN_API BinaryenOp BinaryenConvertLowUVecI32x4ToVecF64x2(void);
589
- BINARYEN_API BinaryenOp BinaryenTruncSatZeroSVecF64x2ToVecI32x4(void);
590
- BINARYEN_API BinaryenOp BinaryenTruncSatZeroUVecF64x2ToVecI32x4(void);
591
- BINARYEN_API BinaryenOp BinaryenDemoteZeroVecF64x2ToVecF32x4(void);
592
- BINARYEN_API BinaryenOp BinaryenPromoteLowVecF32x4ToVecF64x2(void);
593
- BINARYEN_API BinaryenOp BinaryenSwizzleVec8x16(void);
594
- BINARYEN_API BinaryenOp BinaryenRefIsNull(void);
595
- BINARYEN_API BinaryenOp BinaryenRefIsFunc(void);
596
- BINARYEN_API BinaryenOp BinaryenRefIsData(void);
597
- BINARYEN_API BinaryenOp BinaryenRefIsI31(void);
598
- BINARYEN_API BinaryenOp BinaryenRefAsNonNull(void);
599
- BINARYEN_API BinaryenOp BinaryenRefAsFunc(void);
600
- BINARYEN_API BinaryenOp BinaryenRefAsData(void);
601
- BINARYEN_API BinaryenOp BinaryenRefAsI31(void);
602
-
603
- BINARYEN_REF(Expression);
604
-
605
- // Block: name can be NULL. Specifying BinaryenUndefined() as the 'type'
606
- // parameter indicates that the block's type shall be figured out
607
- // automatically instead of explicitly providing it. This conforms
608
- // to the behavior before the 'type' parameter has been introduced.
609
- BINARYEN_API BinaryenExpressionRef
610
- BinaryenBlock(BinaryenModuleRef module,
611
- const char* name,
612
- BinaryenExpressionRef* children,
613
- BinaryenIndex numChildren,
614
- BinaryenType type);
615
- // If: ifFalse can be NULL
616
- BINARYEN_API BinaryenExpressionRef BinaryenIf(BinaryenModuleRef module,
617
- BinaryenExpressionRef condition,
618
- BinaryenExpressionRef ifTrue,
619
- BinaryenExpressionRef ifFalse);
620
- BINARYEN_API BinaryenExpressionRef BinaryenLoop(BinaryenModuleRef module,
621
- const char* in,
622
- BinaryenExpressionRef body);
623
- // Break: value and condition can be NULL
624
- BINARYEN_API BinaryenExpressionRef
625
- BinaryenBreak(BinaryenModuleRef module,
626
- const char* name,
627
- BinaryenExpressionRef condition,
628
- BinaryenExpressionRef value);
629
- // Switch: value can be NULL
630
- BINARYEN_API BinaryenExpressionRef
631
- BinaryenSwitch(BinaryenModuleRef module,
632
- const char** names,
633
- BinaryenIndex numNames,
634
- const char* defaultName,
635
- BinaryenExpressionRef condition,
636
- BinaryenExpressionRef value);
637
- // Call: Note the 'returnType' parameter. You must declare the
638
- // type returned by the function being called, as that
639
- // function might not have been created yet, so we don't
640
- // know what it is.
641
- BINARYEN_API BinaryenExpressionRef BinaryenCall(BinaryenModuleRef module,
642
- const char* target,
643
- BinaryenExpressionRef* operands,
644
- BinaryenIndex numOperands,
645
- BinaryenType returnType);
646
- BINARYEN_API BinaryenExpressionRef
647
- BinaryenCallIndirect(BinaryenModuleRef module,
648
- const char* table,
649
- BinaryenExpressionRef target,
650
- BinaryenExpressionRef* operands,
651
- BinaryenIndex numOperands,
652
- BinaryenType params,
653
- BinaryenType results);
654
- BINARYEN_API BinaryenExpressionRef
655
- BinaryenReturnCall(BinaryenModuleRef module,
656
- const char* target,
657
- BinaryenExpressionRef* operands,
658
- BinaryenIndex numOperands,
659
- BinaryenType returnType);
660
- BINARYEN_API BinaryenExpressionRef
661
- BinaryenReturnCallIndirect(BinaryenModuleRef module,
662
- const char* table,
663
- BinaryenExpressionRef target,
664
- BinaryenExpressionRef* operands,
665
- BinaryenIndex numOperands,
666
- BinaryenType params,
667
- BinaryenType results);
668
-
669
- // LocalGet: Note the 'type' parameter. It might seem redundant, since the
670
- // local at that index must have a type. However, this API lets you
671
- // build code "top-down": create a node, then its parents, and so
672
- // on, and finally create the function at the end. (Note that in fact
673
- // you do not mention a function when creating ExpressionRefs, only
674
- // a module.) And since LocalGet is a leaf node, we need to be told
675
- // its type. (Other nodes detect their type either from their
676
- // type or their opcode, or failing that, their children. But
677
- // LocalGet has no children, it is where a "stream" of type info
678
- // begins.)
679
- // Note also that the index of a local can refer to a param or
680
- // a var, that is, either a parameter to the function or a variable
681
- // declared when you call BinaryenAddFunction. See BinaryenAddFunction
682
- // for more details.
683
- BINARYEN_API BinaryenExpressionRef BinaryenLocalGet(BinaryenModuleRef module,
684
- BinaryenIndex index,
685
- BinaryenType type);
686
- BINARYEN_API BinaryenExpressionRef BinaryenLocalSet(
687
- BinaryenModuleRef module, BinaryenIndex index, BinaryenExpressionRef value);
688
- BINARYEN_API BinaryenExpressionRef BinaryenLocalTee(BinaryenModuleRef module,
689
- BinaryenIndex index,
690
- BinaryenExpressionRef value,
691
- BinaryenType type);
692
- BINARYEN_API BinaryenExpressionRef BinaryenGlobalGet(BinaryenModuleRef module,
693
- const char* name,
694
- BinaryenType type);
695
- BINARYEN_API BinaryenExpressionRef BinaryenGlobalSet(
696
- BinaryenModuleRef module, const char* name, BinaryenExpressionRef value);
697
- // Load: align can be 0, in which case it will be the natural alignment (equal
698
- // to bytes)
699
- BINARYEN_API BinaryenExpressionRef BinaryenLoad(BinaryenModuleRef module,
700
- uint32_t bytes,
701
- bool signed_,
702
- uint32_t offset,
703
- uint32_t align,
704
- BinaryenType type,
705
- BinaryenExpressionRef ptr);
706
- // Store: align can be 0, in which case it will be the natural alignment (equal
707
- // to bytes)
708
- BINARYEN_API BinaryenExpressionRef BinaryenStore(BinaryenModuleRef module,
709
- uint32_t bytes,
710
- uint32_t offset,
711
- uint32_t align,
712
- BinaryenExpressionRef ptr,
713
- BinaryenExpressionRef value,
714
- BinaryenType type);
715
- BINARYEN_API BinaryenExpressionRef BinaryenConst(BinaryenModuleRef module,
716
- struct BinaryenLiteral value);
717
- BINARYEN_API BinaryenExpressionRef BinaryenUnary(BinaryenModuleRef module,
718
- BinaryenOp op,
719
- BinaryenExpressionRef value);
720
- BINARYEN_API BinaryenExpressionRef BinaryenBinary(BinaryenModuleRef module,
721
- BinaryenOp op,
722
- BinaryenExpressionRef left,
723
- BinaryenExpressionRef right);
724
- BINARYEN_API BinaryenExpressionRef
725
- BinaryenSelect(BinaryenModuleRef module,
726
- BinaryenExpressionRef condition,
727
- BinaryenExpressionRef ifTrue,
728
- BinaryenExpressionRef ifFalse,
729
- BinaryenType type);
730
- BINARYEN_API BinaryenExpressionRef BinaryenDrop(BinaryenModuleRef module,
731
- BinaryenExpressionRef value);
732
- // Return: value can be NULL
733
- BINARYEN_API BinaryenExpressionRef BinaryenReturn(BinaryenModuleRef module,
734
- BinaryenExpressionRef value);
735
- BINARYEN_API BinaryenExpressionRef BinaryenMemorySize(BinaryenModuleRef module);
736
- BINARYEN_API BinaryenExpressionRef
737
- BinaryenMemoryGrow(BinaryenModuleRef module, BinaryenExpressionRef delta);
738
- BINARYEN_API BinaryenExpressionRef BinaryenNop(BinaryenModuleRef module);
739
- BINARYEN_API BinaryenExpressionRef
740
- BinaryenUnreachable(BinaryenModuleRef module);
741
- BINARYEN_API BinaryenExpressionRef
742
- BinaryenAtomicLoad(BinaryenModuleRef module,
743
- uint32_t bytes,
744
- uint32_t offset,
745
- BinaryenType type,
746
- BinaryenExpressionRef ptr);
747
- BINARYEN_API BinaryenExpressionRef
748
- BinaryenAtomicStore(BinaryenModuleRef module,
749
- uint32_t bytes,
750
- uint32_t offset,
751
- BinaryenExpressionRef ptr,
752
- BinaryenExpressionRef value,
753
- BinaryenType type);
754
- BINARYEN_API BinaryenExpressionRef
755
- BinaryenAtomicRMW(BinaryenModuleRef module,
756
- BinaryenOp op,
757
- BinaryenIndex bytes,
758
- BinaryenIndex offset,
759
- BinaryenExpressionRef ptr,
760
- BinaryenExpressionRef value,
761
- BinaryenType type);
762
- BINARYEN_API BinaryenExpressionRef
763
- BinaryenAtomicCmpxchg(BinaryenModuleRef module,
764
- BinaryenIndex bytes,
765
- BinaryenIndex offset,
766
- BinaryenExpressionRef ptr,
767
- BinaryenExpressionRef expected,
768
- BinaryenExpressionRef replacement,
769
- BinaryenType type);
770
- BINARYEN_API BinaryenExpressionRef
771
- BinaryenAtomicWait(BinaryenModuleRef module,
772
- BinaryenExpressionRef ptr,
773
- BinaryenExpressionRef expected,
774
- BinaryenExpressionRef timeout,
775
- BinaryenType type);
776
- BINARYEN_API BinaryenExpressionRef
777
- BinaryenAtomicNotify(BinaryenModuleRef module,
778
- BinaryenExpressionRef ptr,
779
- BinaryenExpressionRef notifyCount);
780
- BINARYEN_API BinaryenExpressionRef
781
- BinaryenAtomicFence(BinaryenModuleRef module);
782
- BINARYEN_API BinaryenExpressionRef
783
- BinaryenSIMDExtract(BinaryenModuleRef module,
784
- BinaryenOp op,
785
- BinaryenExpressionRef vec,
786
- uint8_t index);
787
- BINARYEN_API BinaryenExpressionRef
788
- BinaryenSIMDReplace(BinaryenModuleRef module,
789
- BinaryenOp op,
790
- BinaryenExpressionRef vec,
791
- uint8_t index,
792
- BinaryenExpressionRef value);
793
- BINARYEN_API BinaryenExpressionRef
794
- BinaryenSIMDShuffle(BinaryenModuleRef module,
795
- BinaryenExpressionRef left,
796
- BinaryenExpressionRef right,
797
- const uint8_t mask[16]);
798
- BINARYEN_API BinaryenExpressionRef BinaryenSIMDTernary(BinaryenModuleRef module,
799
- BinaryenOp op,
800
- BinaryenExpressionRef a,
801
- BinaryenExpressionRef b,
802
- BinaryenExpressionRef c);
803
- BINARYEN_API BinaryenExpressionRef
804
- BinaryenSIMDShift(BinaryenModuleRef module,
805
- BinaryenOp op,
806
- BinaryenExpressionRef vec,
807
- BinaryenExpressionRef shift);
808
- BINARYEN_API BinaryenExpressionRef BinaryenSIMDLoad(BinaryenModuleRef module,
809
- BinaryenOp op,
810
- uint32_t offset,
811
- uint32_t align,
812
- BinaryenExpressionRef ptr);
813
- BINARYEN_API BinaryenExpressionRef
814
- BinaryenSIMDLoadStoreLane(BinaryenModuleRef module,
815
- BinaryenOp op,
816
- uint32_t offset,
817
- uint32_t align,
818
- uint8_t index,
819
- BinaryenExpressionRef ptr,
820
- BinaryenExpressionRef vec);
821
- BINARYEN_API BinaryenExpressionRef
822
- BinaryenMemoryInit(BinaryenModuleRef module,
823
- uint32_t segment,
824
- BinaryenExpressionRef dest,
825
- BinaryenExpressionRef offset,
826
- BinaryenExpressionRef size);
827
- BINARYEN_API BinaryenExpressionRef BinaryenDataDrop(BinaryenModuleRef module,
828
- uint32_t segment);
829
- BINARYEN_API BinaryenExpressionRef
830
- BinaryenMemoryCopy(BinaryenModuleRef module,
831
- BinaryenExpressionRef dest,
832
- BinaryenExpressionRef source,
833
- BinaryenExpressionRef size);
834
- BINARYEN_API BinaryenExpressionRef
835
- BinaryenMemoryFill(BinaryenModuleRef module,
836
- BinaryenExpressionRef dest,
837
- BinaryenExpressionRef value,
838
- BinaryenExpressionRef size);
839
- BINARYEN_API BinaryenExpressionRef BinaryenRefNull(BinaryenModuleRef module,
840
- BinaryenType type);
841
- BINARYEN_API BinaryenExpressionRef BinaryenRefIs(BinaryenModuleRef module,
842
- BinaryenOp op,
843
- BinaryenExpressionRef value);
844
- BINARYEN_API BinaryenExpressionRef BinaryenRefAs(BinaryenModuleRef module,
845
- BinaryenOp op,
846
- BinaryenExpressionRef value);
847
- BINARYEN_API BinaryenExpressionRef BinaryenRefFunc(BinaryenModuleRef module,
848
- const char* func,
849
- BinaryenType type);
850
- BINARYEN_API BinaryenExpressionRef BinaryenRefEq(BinaryenModuleRef module,
851
- BinaryenExpressionRef left,
852
- BinaryenExpressionRef right);
853
- // Try: name can be NULL. delegateTarget should be NULL in try-catch.
854
- BINARYEN_API BinaryenExpressionRef
855
- BinaryenTry(BinaryenModuleRef module,
856
- const char* name,
857
- BinaryenExpressionRef body,
858
- const char** catchEvents,
859
- BinaryenIndex numCatchEvents,
860
- BinaryenExpressionRef* catchBodies,
861
- BinaryenIndex numCatchBodies,
862
- const char* delegateTarget);
863
- BINARYEN_API BinaryenExpressionRef
864
- BinaryenThrow(BinaryenModuleRef module,
865
- const char* event,
866
- BinaryenExpressionRef* operands,
867
- BinaryenIndex numOperands);
868
- BINARYEN_API BinaryenExpressionRef BinaryenRethrow(BinaryenModuleRef module,
869
- const char* target);
870
- BINARYEN_API BinaryenExpressionRef
871
- BinaryenTupleMake(BinaryenModuleRef module,
872
- BinaryenExpressionRef* operands,
873
- BinaryenIndex numOperands);
874
- BINARYEN_API BinaryenExpressionRef BinaryenTupleExtract(
875
- BinaryenModuleRef module, BinaryenExpressionRef tuple, BinaryenIndex index);
876
- BINARYEN_API BinaryenExpressionRef BinaryenPop(BinaryenModuleRef module,
877
- BinaryenType type);
878
- BINARYEN_API BinaryenExpressionRef BinaryenI31New(BinaryenModuleRef module,
879
- BinaryenExpressionRef value);
880
- BINARYEN_API BinaryenExpressionRef BinaryenI31Get(BinaryenModuleRef module,
881
- BinaryenExpressionRef i31,
882
- bool signed_);
883
- // TODO (gc): ref.test
884
- // TODO (gc): ref.cast
885
- // TODO (gc): br_on_cast
886
- // TODO (gc): rtt.canon
887
- // TODO (gc): rtt.sub
888
- // TODO (gc): struct.new
889
- // TODO (gc): struct.get
890
- // TODO (gc): struct.set
891
- // TODO (gc): array.new
892
- // TODO (gc): array.get
893
- // TODO (gc): array.set
894
- // TODO (gc): array.len
895
-
896
- // Expression
897
-
898
- // Gets the id (kind) of the given expression.
899
- BINARYEN_API BinaryenExpressionId
900
- BinaryenExpressionGetId(BinaryenExpressionRef expr);
901
- // Gets the type of the given expression.
902
- BINARYEN_API BinaryenType BinaryenExpressionGetType(BinaryenExpressionRef expr);
903
- // Sets the type of the given expression.
904
- BINARYEN_API void BinaryenExpressionSetType(BinaryenExpressionRef expr,
905
- BinaryenType type);
906
- // Prints text format of the given expression to stdout.
907
- BINARYEN_API void BinaryenExpressionPrint(BinaryenExpressionRef expr);
908
- // Re-finalizes an expression after it has been modified.
909
- BINARYEN_API void BinaryenExpressionFinalize(BinaryenExpressionRef expr);
910
- // Makes a deep copy of the given expression.
911
- BINARYEN_API BinaryenExpressionRef
912
- BinaryenExpressionCopy(BinaryenExpressionRef expr, BinaryenModuleRef module);
913
-
914
- // Block
915
-
916
- // Gets the name (label) of a `block` expression.
917
- BINARYEN_API const char* BinaryenBlockGetName(BinaryenExpressionRef expr);
918
- // Sets the name (label) of a `block` expression.
919
- BINARYEN_API void BinaryenBlockSetName(BinaryenExpressionRef expr,
920
- const char* name);
921
- // Gets the number of child expressions of a `block` expression.
922
- BINARYEN_API BinaryenIndex
923
- BinaryenBlockGetNumChildren(BinaryenExpressionRef expr);
924
- // Gets the child expression at the specified index of a `block` expression.
925
- BINARYEN_API BinaryenExpressionRef
926
- BinaryenBlockGetChildAt(BinaryenExpressionRef expr, BinaryenIndex index);
927
- // Sets (replaces) the child expression at the specified index of a `block`
928
- // expression.
929
- BINARYEN_API void BinaryenBlockSetChildAt(BinaryenExpressionRef expr,
930
- BinaryenIndex index,
931
- BinaryenExpressionRef childExpr);
932
- // Appends a child expression to a `block` expression, returning its insertion
933
- // index.
934
- BINARYEN_API BinaryenIndex BinaryenBlockAppendChild(
935
- BinaryenExpressionRef expr, BinaryenExpressionRef childExpr);
936
- // Inserts a child expression at the specified index of a `block` expression,
937
- // moving existing children including the one previously at that index one index
938
- // up.
939
- BINARYEN_API void BinaryenBlockInsertChildAt(BinaryenExpressionRef expr,
940
- BinaryenIndex index,
941
- BinaryenExpressionRef childExpr);
942
- // Removes the child expression at the specified index of a `block` expression,
943
- // moving all subsequent children one index down. Returns the child expression.
944
- BINARYEN_API BinaryenExpressionRef
945
- BinaryenBlockRemoveChildAt(BinaryenExpressionRef expr, BinaryenIndex index);
946
-
947
- // If
948
-
949
- // Gets the condition expression of an `if` expression.
950
- BINARYEN_API BinaryenExpressionRef
951
- BinaryenIfGetCondition(BinaryenExpressionRef expr);
952
- // Sets the condition expression of an `if` expression.
953
- BINARYEN_API void BinaryenIfSetCondition(BinaryenExpressionRef expr,
954
- BinaryenExpressionRef condExpr);
955
- // Gets the ifTrue (then) expression of an `if` expression.
956
- BINARYEN_API BinaryenExpressionRef
957
- BinaryenIfGetIfTrue(BinaryenExpressionRef expr);
958
- // Sets the ifTrue (then) expression of an `if` expression.
959
- BINARYEN_API void BinaryenIfSetIfTrue(BinaryenExpressionRef expr,
960
- BinaryenExpressionRef ifTrueExpr);
961
- // Gets the ifFalse (else) expression, if any, of an `if` expression.
962
- BINARYEN_API BinaryenExpressionRef
963
- BinaryenIfGetIfFalse(BinaryenExpressionRef expr);
964
- // Sets the ifFalse (else) expression, if any, of an `if` expression.
965
- BINARYEN_API void BinaryenIfSetIfFalse(BinaryenExpressionRef expr,
966
- BinaryenExpressionRef ifFalseExpr);
967
-
968
- // Loop
969
-
970
- // Gets the name (label) of a `loop` expression.
971
- BINARYEN_API const char* BinaryenLoopGetName(BinaryenExpressionRef expr);
972
- // Sets the name (label) of a `loop` expression.
973
- BINARYEN_API void BinaryenLoopSetName(BinaryenExpressionRef expr,
974
- const char* name);
975
- // Gets the body expression of a `loop` expression.
976
- BINARYEN_API BinaryenExpressionRef
977
- BinaryenLoopGetBody(BinaryenExpressionRef expr);
978
- // Sets the body expression of a `loop` expression.
979
- BINARYEN_API void BinaryenLoopSetBody(BinaryenExpressionRef expr,
980
- BinaryenExpressionRef bodyExpr);
981
-
982
- // Break
983
-
984
- // Gets the name (target label) of a `br` or `br_if` expression.
985
- BINARYEN_API const char* BinaryenBreakGetName(BinaryenExpressionRef expr);
986
- // Sets the name (target label) of a `br` or `br_if` expression.
987
- BINARYEN_API void BinaryenBreakSetName(BinaryenExpressionRef expr,
988
- const char* name);
989
- // Gets the condition expression, if any, of a `br_if` expression. No condition
990
- // indicates a `br` expression.
991
- BINARYEN_API BinaryenExpressionRef
992
- BinaryenBreakGetCondition(BinaryenExpressionRef expr);
993
- // Sets the condition expression, if any, of a `br_if` expression. No condition
994
- // makes it a `br` expression.
995
- BINARYEN_API void BinaryenBreakSetCondition(BinaryenExpressionRef expr,
996
- BinaryenExpressionRef condExpr);
997
- // Gets the value expression, if any, of a `br` or `br_if` expression.
998
- BINARYEN_API BinaryenExpressionRef
999
- BinaryenBreakGetValue(BinaryenExpressionRef expr);
1000
- // Sets the value expression, if any, of a `br` or `br_if` expression.
1001
- BINARYEN_API void BinaryenBreakSetValue(BinaryenExpressionRef expr,
1002
- BinaryenExpressionRef valueExpr);
1003
-
1004
- // Switch
1005
-
1006
- // Gets the number of names (target labels) of a `br_table` expression.
1007
- BINARYEN_API BinaryenIndex
1008
- BinaryenSwitchGetNumNames(BinaryenExpressionRef expr);
1009
- // Gets the name (target label) at the specified index of a `br_table`
1010
- // expression.
1011
- BINARYEN_API const char* BinaryenSwitchGetNameAt(BinaryenExpressionRef expr,
1012
- BinaryenIndex index);
1013
- // Sets the name (target label) at the specified index of a `br_table`
1014
- // expression.
1015
- BINARYEN_API void BinaryenSwitchSetNameAt(BinaryenExpressionRef expr,
1016
- BinaryenIndex index,
1017
- const char* name);
1018
- // Appends a name to a `br_table` expression, returning its insertion index.
1019
- BINARYEN_API BinaryenIndex BinaryenSwitchAppendName(BinaryenExpressionRef expr,
1020
- const char* name);
1021
- // Inserts a name at the specified index of a `br_table` expression, moving
1022
- // existing names including the one previously at that index one index up.
1023
- BINARYEN_API void BinaryenSwitchInsertNameAt(BinaryenExpressionRef expr,
1024
- BinaryenIndex index,
1025
- const char* name);
1026
- // Removes the name at the specified index of a `br_table` expression, moving
1027
- // all subsequent names one index down. Returns the name.
1028
- BINARYEN_API const char* BinaryenSwitchRemoveNameAt(BinaryenExpressionRef expr,
1029
- BinaryenIndex index);
1030
- // Gets the default name (target label), if any, of a `br_table` expression.
1031
- BINARYEN_API const char*
1032
- BinaryenSwitchGetDefaultName(BinaryenExpressionRef expr);
1033
- // Sets the default name (target label), if any, of a `br_table` expression.
1034
- BINARYEN_API void BinaryenSwitchSetDefaultName(BinaryenExpressionRef expr,
1035
- const char* name);
1036
- // Gets the condition expression of a `br_table` expression.
1037
- BINARYEN_API BinaryenExpressionRef
1038
- BinaryenSwitchGetCondition(BinaryenExpressionRef expr);
1039
- // Sets the condition expression of a `br_table` expression.
1040
- BINARYEN_API void BinaryenSwitchSetCondition(BinaryenExpressionRef expr,
1041
- BinaryenExpressionRef condExpr);
1042
- // Gets the value expression, if any, of a `br_table` expression.
1043
- BINARYEN_API BinaryenExpressionRef
1044
- BinaryenSwitchGetValue(BinaryenExpressionRef expr);
1045
- // Sets the value expression, if any, of a `br_table` expression.
1046
- BINARYEN_API void BinaryenSwitchSetValue(BinaryenExpressionRef expr,
1047
- BinaryenExpressionRef valueExpr);
1048
-
1049
- // Call
1050
-
1051
- // Gets the target function name of a `call` expression.
1052
- BINARYEN_API const char* BinaryenCallGetTarget(BinaryenExpressionRef expr);
1053
- // Sets the target function name of a `call` expression.
1054
- BINARYEN_API void BinaryenCallSetTarget(BinaryenExpressionRef expr,
1055
- const char* target);
1056
- // Gets the number of operands of a `call` expression.
1057
- BINARYEN_API BinaryenIndex
1058
- BinaryenCallGetNumOperands(BinaryenExpressionRef expr);
1059
- // Gets the operand expression at the specified index of a `call` expression.
1060
- BINARYEN_API BinaryenExpressionRef
1061
- BinaryenCallGetOperandAt(BinaryenExpressionRef expr, BinaryenIndex index);
1062
- // Sets the operand expression at the specified index of a `call` expression.
1063
- BINARYEN_API void BinaryenCallSetOperandAt(BinaryenExpressionRef expr,
1064
- BinaryenIndex index,
1065
- BinaryenExpressionRef operandExpr);
1066
- // Appends an operand expression to a `call` expression, returning its insertion
1067
- // index.
1068
- BINARYEN_API BinaryenIndex BinaryenCallAppendOperand(
1069
- BinaryenExpressionRef expr, BinaryenExpressionRef operandExpr);
1070
- // Inserts an operand expression at the specified index of a `call` expression,
1071
- // moving existing operands including the one previously at that index one index
1072
- // up.
1073
- BINARYEN_API void
1074
- BinaryenCallInsertOperandAt(BinaryenExpressionRef expr,
1075
- BinaryenIndex index,
1076
- BinaryenExpressionRef operandExpr);
1077
- // Removes the operand expression at the specified index of a `call` expression,
1078
- // moving all subsequent operands one index down. Returns the operand
1079
- // expression.
1080
- BINARYEN_API BinaryenExpressionRef
1081
- BinaryenCallRemoveOperandAt(BinaryenExpressionRef expr, BinaryenIndex index);
1082
- // Gets whether the specified `call` expression is a tail call.
1083
- BINARYEN_API bool BinaryenCallIsReturn(BinaryenExpressionRef expr);
1084
- // Sets whether the specified `call` expression is a tail call.
1085
- BINARYEN_API void BinaryenCallSetReturn(BinaryenExpressionRef expr,
1086
- bool isReturn);
1087
-
1088
- // CallIndirect
1089
-
1090
- // Gets the target expression of a `call_indirect` expression.
1091
- BINARYEN_API BinaryenExpressionRef
1092
- BinaryenCallIndirectGetTarget(BinaryenExpressionRef expr);
1093
- // Sets the target expression of a `call_indirect` expression.
1094
- BINARYEN_API void
1095
- BinaryenCallIndirectSetTarget(BinaryenExpressionRef expr,
1096
- BinaryenExpressionRef targetExpr);
1097
- // Gets the table name of a `call_indirect` expression.
1098
- BINARYEN_API const char*
1099
- BinaryenCallIndirectGetTable(BinaryenExpressionRef expr);
1100
- // Sets the table name of a `call_indirect` expression.
1101
- BINARYEN_API void BinaryenCallIndirectSetTable(BinaryenExpressionRef expr,
1102
- const char* table);
1103
- // Gets the number of operands of a `call_indirect` expression.
1104
- BINARYEN_API BinaryenIndex
1105
- BinaryenCallIndirectGetNumOperands(BinaryenExpressionRef expr);
1106
- // Gets the operand expression at the specified index of a `call_indirect`
1107
- // expression.
1108
- BINARYEN_API BinaryenExpressionRef BinaryenCallIndirectGetOperandAt(
1109
- BinaryenExpressionRef expr, BinaryenIndex index);
1110
- // Sets the operand expression at the specified index of a `call_indirect`
1111
- // expression.
1112
- BINARYEN_API void
1113
- BinaryenCallIndirectSetOperandAt(BinaryenExpressionRef expr,
1114
- BinaryenIndex index,
1115
- BinaryenExpressionRef operandExpr);
1116
- // Appends an operand expression to a `call_indirect` expression, returning its
1117
- // insertion index.
1118
- BINARYEN_API BinaryenIndex BinaryenCallIndirectAppendOperand(
1119
- BinaryenExpressionRef expr, BinaryenExpressionRef operandExpr);
1120
- // Inserts an operand expression at the specified index of a `call_indirect`
1121
- // expression, moving existing operands including the one previously at that
1122
- // index one index up.
1123
- BINARYEN_API void
1124
- BinaryenCallIndirectInsertOperandAt(BinaryenExpressionRef expr,
1125
- BinaryenIndex index,
1126
- BinaryenExpressionRef operandExpr);
1127
- // Removes the operand expression at the specified index of a `call_indirect`
1128
- // expression, moving all subsequent operands one index down. Returns the
1129
- // operand expression.
1130
- BINARYEN_API BinaryenExpressionRef BinaryenCallIndirectRemoveOperandAt(
1131
- BinaryenExpressionRef expr, BinaryenIndex index);
1132
- // Gets whether the specified `call_indirect` expression is a tail call.
1133
- BINARYEN_API bool BinaryenCallIndirectIsReturn(BinaryenExpressionRef expr);
1134
- // Sets whether the specified `call_indirect` expression is a tail call.
1135
- BINARYEN_API void BinaryenCallIndirectSetReturn(BinaryenExpressionRef expr,
1136
- bool isReturn);
1137
- // Gets the parameter types of the specified `call_indirect` expression.
1138
- BINARYEN_API BinaryenType
1139
- BinaryenCallIndirectGetParams(BinaryenExpressionRef expr);
1140
- // Sets the parameter types of the specified `call_indirect` expression.
1141
- BINARYEN_API void BinaryenCallIndirectSetParams(BinaryenExpressionRef expr,
1142
- BinaryenType params);
1143
- // Gets the result types of the specified `call_indirect` expression.
1144
- BINARYEN_API BinaryenType
1145
- BinaryenCallIndirectGetResults(BinaryenExpressionRef expr);
1146
- // Sets the result types of the specified `call_indirect` expression.
1147
- BINARYEN_API void BinaryenCallIndirectSetResults(BinaryenExpressionRef expr,
1148
- BinaryenType params);
1149
-
1150
- // LocalGet
1151
-
1152
- // Gets the local index of a `local.get` expression.
1153
- BINARYEN_API BinaryenIndex BinaryenLocalGetGetIndex(BinaryenExpressionRef expr);
1154
- // Sets the local index of a `local.get` expression.
1155
- BINARYEN_API void BinaryenLocalGetSetIndex(BinaryenExpressionRef expr,
1156
- BinaryenIndex index);
1157
-
1158
- // LocalSet
1159
-
1160
- // Gets whether a `local.set` tees its value (is a `local.tee`). True if the
1161
- // expression has a type other than `none`.
1162
- BINARYEN_API bool BinaryenLocalSetIsTee(BinaryenExpressionRef expr);
1163
- // Gets the local index of a `local.set` or `local.tee` expression.
1164
- BINARYEN_API BinaryenIndex BinaryenLocalSetGetIndex(BinaryenExpressionRef expr);
1165
- // Sets the local index of a `local.set` or `local.tee` expression.
1166
- BINARYEN_API void BinaryenLocalSetSetIndex(BinaryenExpressionRef expr,
1167
- BinaryenIndex index);
1168
- // Gets the value expression of a `local.set` or `local.tee` expression.
1169
- BINARYEN_API BinaryenExpressionRef
1170
- BinaryenLocalSetGetValue(BinaryenExpressionRef expr);
1171
- // Sets the value expression of a `local.set` or `local.tee` expression.
1172
- BINARYEN_API void BinaryenLocalSetSetValue(BinaryenExpressionRef expr,
1173
- BinaryenExpressionRef valueExpr);
1174
-
1175
- // GlobalGet
1176
-
1177
- // Gets the name of the global being accessed by a `global.get` expression.
1178
- BINARYEN_API const char* BinaryenGlobalGetGetName(BinaryenExpressionRef expr);
1179
- // Sets the name of the global being accessed by a `global.get` expression.
1180
- BINARYEN_API void BinaryenGlobalGetSetName(BinaryenExpressionRef expr,
1181
- const char* name);
1182
-
1183
- // GlobalSet
1184
-
1185
- // Gets the name of the global being accessed by a `global.set` expression.
1186
- BINARYEN_API const char* BinaryenGlobalSetGetName(BinaryenExpressionRef expr);
1187
- // Sets the name of the global being accessed by a `global.set` expression.
1188
- BINARYEN_API void BinaryenGlobalSetSetName(BinaryenExpressionRef expr,
1189
- const char* name);
1190
- // Gets the value expression of a `global.set` expression.
1191
- BINARYEN_API BinaryenExpressionRef
1192
- BinaryenGlobalSetGetValue(BinaryenExpressionRef expr);
1193
- // Sets the value expression of a `global.set` expression.
1194
- BINARYEN_API void BinaryenGlobalSetSetValue(BinaryenExpressionRef expr,
1195
- BinaryenExpressionRef valueExpr);
1196
-
1197
- // MemoryGrow
1198
-
1199
- // Gets the delta of a `memory.grow` expression.
1200
- BINARYEN_API BinaryenExpressionRef
1201
- BinaryenMemoryGrowGetDelta(BinaryenExpressionRef expr);
1202
- // Sets the delta of a `memory.grow` expression.
1203
- BINARYEN_API void BinaryenMemoryGrowSetDelta(BinaryenExpressionRef expr,
1204
- BinaryenExpressionRef delta);
1205
-
1206
- // Load
1207
-
1208
- // Gets whether a `load` expression is atomic (is an `atomic.load`).
1209
- BINARYEN_API bool BinaryenLoadIsAtomic(BinaryenExpressionRef expr);
1210
- // Sets whether a `load` expression is atomic (is an `atomic.load`).
1211
- BINARYEN_API void BinaryenLoadSetAtomic(BinaryenExpressionRef expr,
1212
- bool isAtomic);
1213
- // Gets whether a `load` expression operates on a signed value (`_s`).
1214
- BINARYEN_API bool BinaryenLoadIsSigned(BinaryenExpressionRef expr);
1215
- // Sets whether a `load` expression operates on a signed value (`_s`).
1216
- BINARYEN_API void BinaryenLoadSetSigned(BinaryenExpressionRef expr,
1217
- bool isSigned);
1218
- // Gets the constant offset of a `load` expression.
1219
- BINARYEN_API uint32_t BinaryenLoadGetOffset(BinaryenExpressionRef expr);
1220
- // Sets the constant offset of a `load` expression.
1221
- BINARYEN_API void BinaryenLoadSetOffset(BinaryenExpressionRef expr,
1222
- uint32_t offset);
1223
- // Gets the number of bytes loaded by a `load` expression.
1224
- BINARYEN_API uint32_t BinaryenLoadGetBytes(BinaryenExpressionRef expr);
1225
- // Sets the number of bytes loaded by a `load` expression.
1226
- BINARYEN_API void BinaryenLoadSetBytes(BinaryenExpressionRef expr,
1227
- uint32_t bytes);
1228
- // Gets the byte alignment of a `load` expression.
1229
- BINARYEN_API uint32_t BinaryenLoadGetAlign(BinaryenExpressionRef expr);
1230
- // Sets the byte alignment of a `load` expression.
1231
- BINARYEN_API void BinaryenLoadSetAlign(BinaryenExpressionRef expr,
1232
- uint32_t align);
1233
- // Gets the pointer expression of a `load` expression.
1234
- BINARYEN_API BinaryenExpressionRef
1235
- BinaryenLoadGetPtr(BinaryenExpressionRef expr);
1236
- // Sets the pointer expression of a `load` expression.
1237
- BINARYEN_API void BinaryenLoadSetPtr(BinaryenExpressionRef expr,
1238
- BinaryenExpressionRef ptrExpr);
1239
-
1240
- // Store
1241
-
1242
- // Gets whether a `store` expression is atomic (is an `atomic.store`).
1243
- BINARYEN_API bool BinaryenStoreIsAtomic(BinaryenExpressionRef expr);
1244
- // Sets whether a `store` expression is atomic (is an `atomic.store`).
1245
- BINARYEN_API void BinaryenStoreSetAtomic(BinaryenExpressionRef expr,
1246
- bool isAtomic);
1247
- // Gets the number of bytes stored by a `store` expression.
1248
- BINARYEN_API uint32_t BinaryenStoreGetBytes(BinaryenExpressionRef expr);
1249
- // Sets the number of bytes stored by a `store` expression.
1250
- BINARYEN_API void BinaryenStoreSetBytes(BinaryenExpressionRef expr,
1251
- uint32_t bytes);
1252
- // Gets the constant offset of a `store` expression.
1253
- BINARYEN_API uint32_t BinaryenStoreGetOffset(BinaryenExpressionRef expr);
1254
- // Sets the constant offset of a `store` expression.
1255
- BINARYEN_API void BinaryenStoreSetOffset(BinaryenExpressionRef expr,
1256
- uint32_t offset);
1257
- // Gets the byte alignment of a `store` expression.
1258
- BINARYEN_API uint32_t BinaryenStoreGetAlign(BinaryenExpressionRef expr);
1259
- // Sets the byte alignment of a `store` expression.
1260
- BINARYEN_API void BinaryenStoreSetAlign(BinaryenExpressionRef expr,
1261
- uint32_t align);
1262
- // Gets the pointer expression of a `store` expression.
1263
- BINARYEN_API BinaryenExpressionRef
1264
- BinaryenStoreGetPtr(BinaryenExpressionRef expr);
1265
- // Sets the pointer expression of a `store` expression.
1266
- BINARYEN_API void BinaryenStoreSetPtr(BinaryenExpressionRef expr,
1267
- BinaryenExpressionRef ptrExpr);
1268
- // Gets the value expression of a `store` expression.
1269
- BINARYEN_API BinaryenExpressionRef
1270
- BinaryenStoreGetValue(BinaryenExpressionRef expr);
1271
- // Sets the value expression of a `store` expression.
1272
- BINARYEN_API void BinaryenStoreSetValue(BinaryenExpressionRef expr,
1273
- BinaryenExpressionRef valueExpr);
1274
- // Gets the value type of a `store` expression.
1275
- BINARYEN_API BinaryenType BinaryenStoreGetValueType(BinaryenExpressionRef expr);
1276
- // Sets the value type of a `store` expression.
1277
- BINARYEN_API void BinaryenStoreSetValueType(BinaryenExpressionRef expr,
1278
- BinaryenType valueType);
1279
-
1280
- // Const
1281
-
1282
- // Gets the 32-bit integer value of an `i32.const` expression.
1283
- BINARYEN_API int32_t BinaryenConstGetValueI32(BinaryenExpressionRef expr);
1284
- // Sets the 32-bit integer value of an `i32.const` expression.
1285
- BINARYEN_API void BinaryenConstSetValueI32(BinaryenExpressionRef expr,
1286
- int32_t value);
1287
- // Gets the 64-bit integer value of an `i64.const` expression.
1288
- BINARYEN_API int64_t BinaryenConstGetValueI64(BinaryenExpressionRef expr);
1289
- // Sets the 64-bit integer value of an `i64.const` expression.
1290
- BINARYEN_API void BinaryenConstSetValueI64(BinaryenExpressionRef expr,
1291
- int64_t value);
1292
- // Gets the low 32-bits of the 64-bit integer value of an `i64.const`
1293
- // expression.
1294
- BINARYEN_API int32_t BinaryenConstGetValueI64Low(BinaryenExpressionRef expr);
1295
- // Sets the low 32-bits of the 64-bit integer value of an `i64.const`
1296
- // expression.
1297
- BINARYEN_API void BinaryenConstSetValueI64Low(BinaryenExpressionRef expr,
1298
- int32_t valueLow);
1299
- // Gets the high 32-bits of the 64-bit integer value of an `i64.const`
1300
- // expression.
1301
- BINARYEN_API int32_t BinaryenConstGetValueI64High(BinaryenExpressionRef expr);
1302
- // Sets the high 32-bits of the 64-bit integer value of an `i64.const`
1303
- // expression.
1304
- BINARYEN_API void BinaryenConstSetValueI64High(BinaryenExpressionRef expr,
1305
- int32_t valueHigh);
1306
- // Gets the 32-bit float value of a `f32.const` expression.
1307
- BINARYEN_API float BinaryenConstGetValueF32(BinaryenExpressionRef expr);
1308
- // Sets the 32-bit float value of a `f32.const` expression.
1309
- BINARYEN_API void BinaryenConstSetValueF32(BinaryenExpressionRef expr,
1310
- float value);
1311
- // Gets the 64-bit float (double) value of a `f64.const` expression.
1312
- BINARYEN_API double BinaryenConstGetValueF64(BinaryenExpressionRef expr);
1313
- // Sets the 64-bit float (double) value of a `f64.const` expression.
1314
- BINARYEN_API void BinaryenConstSetValueF64(BinaryenExpressionRef expr,
1315
- double value);
1316
- // Reads the 128-bit vector value of a `v128.const` expression.
1317
- BINARYEN_API void BinaryenConstGetValueV128(BinaryenExpressionRef expr,
1318
- uint8_t* out);
1319
- // Sets the 128-bit vector value of a `v128.const` expression.
1320
- BINARYEN_API void BinaryenConstSetValueV128(BinaryenExpressionRef expr,
1321
- const uint8_t value[16]);
1322
-
1323
- // Unary
1324
-
1325
- // Gets the operation being performed by a unary expression.
1326
- BINARYEN_API BinaryenOp BinaryenUnaryGetOp(BinaryenExpressionRef expr);
1327
- // Sets the operation being performed by a unary expression.
1328
- BINARYEN_API void BinaryenUnarySetOp(BinaryenExpressionRef expr, BinaryenOp op);
1329
- // Gets the value expression of a unary expression.
1330
- BINARYEN_API BinaryenExpressionRef
1331
- BinaryenUnaryGetValue(BinaryenExpressionRef expr);
1332
- // Sets the value expression of a unary expression.
1333
- BINARYEN_API void BinaryenUnarySetValue(BinaryenExpressionRef expr,
1334
- BinaryenExpressionRef valueExpr);
1335
-
1336
- // Binary
1337
-
1338
- // Gets the operation being performed by a binary expression.
1339
- BINARYEN_API BinaryenOp BinaryenBinaryGetOp(BinaryenExpressionRef expr);
1340
- // Sets the operation being performed by a binary expression.
1341
- BINARYEN_API void BinaryenBinarySetOp(BinaryenExpressionRef expr,
1342
- BinaryenOp op);
1343
- // Gets the left expression of a binary expression.
1344
- BINARYEN_API BinaryenExpressionRef
1345
- BinaryenBinaryGetLeft(BinaryenExpressionRef expr);
1346
- // Sets the left expression of a binary expression.
1347
- BINARYEN_API void BinaryenBinarySetLeft(BinaryenExpressionRef expr,
1348
- BinaryenExpressionRef leftExpr);
1349
- // Gets the right expression of a binary expression.
1350
- BINARYEN_API BinaryenExpressionRef
1351
- BinaryenBinaryGetRight(BinaryenExpressionRef expr);
1352
- // Sets the right expression of a binary expression.
1353
- BINARYEN_API void BinaryenBinarySetRight(BinaryenExpressionRef expr,
1354
- BinaryenExpressionRef rightExpr);
1355
-
1356
- // Select
1357
-
1358
- // Gets the expression becoming selected by a `select` expression if the
1359
- // condition turns out true.
1360
- BINARYEN_API BinaryenExpressionRef
1361
- BinaryenSelectGetIfTrue(BinaryenExpressionRef expr);
1362
- // Sets the expression becoming selected by a `select` expression if the
1363
- // condition turns out true.
1364
- BINARYEN_API void BinaryenSelectSetIfTrue(BinaryenExpressionRef expr,
1365
- BinaryenExpressionRef ifTrueExpr);
1366
- // Gets the expression becoming selected by a `select` expression if the
1367
- // condition turns out false.
1368
- BINARYEN_API BinaryenExpressionRef
1369
- BinaryenSelectGetIfFalse(BinaryenExpressionRef expr);
1370
- // Sets the expression becoming selected by a `select` expression if the
1371
- // condition turns out false.
1372
- BINARYEN_API void BinaryenSelectSetIfFalse(BinaryenExpressionRef expr,
1373
- BinaryenExpressionRef ifFalseExpr);
1374
- // Gets the condition expression of a `select` expression.
1375
- BINARYEN_API BinaryenExpressionRef
1376
- BinaryenSelectGetCondition(BinaryenExpressionRef expr);
1377
- // Sets the condition expression of a `select` expression.
1378
- BINARYEN_API void BinaryenSelectSetCondition(BinaryenExpressionRef expr,
1379
- BinaryenExpressionRef condExpr);
1380
-
1381
- // Drop
1382
-
1383
- // Gets the value expression being dropped by a `drop` expression.
1384
- BINARYEN_API BinaryenExpressionRef
1385
- BinaryenDropGetValue(BinaryenExpressionRef expr);
1386
- // Sets the value expression being dropped by a `drop` expression.
1387
- BINARYEN_API void BinaryenDropSetValue(BinaryenExpressionRef expr,
1388
- BinaryenExpressionRef valueExpr);
1389
-
1390
- // Return
1391
-
1392
- // Gets the value expression, if any, being returned by a `return` expression.
1393
- BINARYEN_API BinaryenExpressionRef
1394
- BinaryenReturnGetValue(BinaryenExpressionRef expr);
1395
- // Sets the value expression, if any, being returned by a `return` expression.
1396
- BINARYEN_API void BinaryenReturnSetValue(BinaryenExpressionRef expr,
1397
- BinaryenExpressionRef valueExpr);
1398
-
1399
- // AtomicRMW
1400
-
1401
- // Gets the operation being performed by an atomic read-modify-write expression.
1402
- BINARYEN_API BinaryenOp BinaryenAtomicRMWGetOp(BinaryenExpressionRef expr);
1403
- // Sets the operation being performed by an atomic read-modify-write expression.
1404
- BINARYEN_API void BinaryenAtomicRMWSetOp(BinaryenExpressionRef expr,
1405
- BinaryenOp op);
1406
- // Gets the number of bytes affected by an atomic read-modify-write expression.
1407
- BINARYEN_API uint32_t BinaryenAtomicRMWGetBytes(BinaryenExpressionRef expr);
1408
- // Sets the number of bytes affected by an atomic read-modify-write expression.
1409
- BINARYEN_API void BinaryenAtomicRMWSetBytes(BinaryenExpressionRef expr,
1410
- uint32_t bytes);
1411
- // Gets the constant offset of an atomic read-modify-write expression.
1412
- BINARYEN_API uint32_t BinaryenAtomicRMWGetOffset(BinaryenExpressionRef expr);
1413
- // Sets the constant offset of an atomic read-modify-write expression.
1414
- BINARYEN_API void BinaryenAtomicRMWSetOffset(BinaryenExpressionRef expr,
1415
- uint32_t offset);
1416
- // Gets the pointer expression of an atomic read-modify-write expression.
1417
- BINARYEN_API BinaryenExpressionRef
1418
- BinaryenAtomicRMWGetPtr(BinaryenExpressionRef expr);
1419
- // Sets the pointer expression of an atomic read-modify-write expression.
1420
- BINARYEN_API void BinaryenAtomicRMWSetPtr(BinaryenExpressionRef expr,
1421
- BinaryenExpressionRef ptrExpr);
1422
- // Gets the value expression of an atomic read-modify-write expression.
1423
- BINARYEN_API BinaryenExpressionRef
1424
- BinaryenAtomicRMWGetValue(BinaryenExpressionRef expr);
1425
- // Sets the value expression of an atomic read-modify-write expression.
1426
- BINARYEN_API void BinaryenAtomicRMWSetValue(BinaryenExpressionRef expr,
1427
- BinaryenExpressionRef valueExpr);
1428
-
1429
- // AtomicCmpxchg
1430
-
1431
- // Gets the number of bytes affected by an atomic compare and exchange
1432
- // expression.
1433
- BINARYEN_API uint32_t BinaryenAtomicCmpxchgGetBytes(BinaryenExpressionRef expr);
1434
- // Sets the number of bytes affected by an atomic compare and exchange
1435
- // expression.
1436
- BINARYEN_API void BinaryenAtomicCmpxchgSetBytes(BinaryenExpressionRef expr,
1437
- uint32_t bytes);
1438
- // Gets the constant offset of an atomic compare and exchange expression.
1439
- BINARYEN_API uint32_t
1440
- BinaryenAtomicCmpxchgGetOffset(BinaryenExpressionRef expr);
1441
- // Sets the constant offset of an atomic compare and exchange expression.
1442
- BINARYEN_API void BinaryenAtomicCmpxchgSetOffset(BinaryenExpressionRef expr,
1443
- uint32_t offset);
1444
- // Gets the pointer expression of an atomic compare and exchange expression.
1445
- BINARYEN_API BinaryenExpressionRef
1446
- BinaryenAtomicCmpxchgGetPtr(BinaryenExpressionRef expr);
1447
- // Sets the pointer expression of an atomic compare and exchange expression.
1448
- BINARYEN_API void BinaryenAtomicCmpxchgSetPtr(BinaryenExpressionRef expr,
1449
- BinaryenExpressionRef ptrExpr);
1450
- // Gets the expression representing the expected value of an atomic compare and
1451
- // exchange expression.
1452
- BINARYEN_API BinaryenExpressionRef
1453
- BinaryenAtomicCmpxchgGetExpected(BinaryenExpressionRef expr);
1454
- // Sets the expression representing the expected value of an atomic compare and
1455
- // exchange expression.
1456
- BINARYEN_API void
1457
- BinaryenAtomicCmpxchgSetExpected(BinaryenExpressionRef expr,
1458
- BinaryenExpressionRef expectedExpr);
1459
- // Gets the replacement expression of an atomic compare and exchange expression.
1460
- BINARYEN_API BinaryenExpressionRef
1461
- BinaryenAtomicCmpxchgGetReplacement(BinaryenExpressionRef expr);
1462
- // Sets the replacement expression of an atomic compare and exchange expression.
1463
- BINARYEN_API void
1464
- BinaryenAtomicCmpxchgSetReplacement(BinaryenExpressionRef expr,
1465
- BinaryenExpressionRef replacementExpr);
1466
-
1467
- // AtomicWait
1468
-
1469
- // Gets the pointer expression of an `memory.atomic.wait` expression.
1470
- BINARYEN_API BinaryenExpressionRef
1471
- BinaryenAtomicWaitGetPtr(BinaryenExpressionRef expr);
1472
- // Sets the pointer expression of an `memory.atomic.wait` expression.
1473
- BINARYEN_API void BinaryenAtomicWaitSetPtr(BinaryenExpressionRef expr,
1474
- BinaryenExpressionRef ptrExpr);
1475
- // Gets the expression representing the expected value of an
1476
- // `memory.atomic.wait` expression.
1477
- BINARYEN_API BinaryenExpressionRef
1478
- BinaryenAtomicWaitGetExpected(BinaryenExpressionRef expr);
1479
- // Sets the expression representing the expected value of an
1480
- // `memory.atomic.wait` expression.
1481
- BINARYEN_API void
1482
- BinaryenAtomicWaitSetExpected(BinaryenExpressionRef expr,
1483
- BinaryenExpressionRef expectedExpr);
1484
- // Gets the timeout expression of an `memory.atomic.wait` expression.
1485
- BINARYEN_API BinaryenExpressionRef
1486
- BinaryenAtomicWaitGetTimeout(BinaryenExpressionRef expr);
1487
- // Sets the timeout expression of an `memory.atomic.wait` expression.
1488
- BINARYEN_API void
1489
- BinaryenAtomicWaitSetTimeout(BinaryenExpressionRef expr,
1490
- BinaryenExpressionRef timeoutExpr);
1491
- // Gets the expected type of an `memory.atomic.wait` expression.
1492
- BINARYEN_API BinaryenType
1493
- BinaryenAtomicWaitGetExpectedType(BinaryenExpressionRef expr);
1494
- // Sets the expected type of an `memory.atomic.wait` expression.
1495
- BINARYEN_API void BinaryenAtomicWaitSetExpectedType(BinaryenExpressionRef expr,
1496
- BinaryenType expectedType);
1497
-
1498
- // AtomicNotify
1499
-
1500
- // Gets the pointer expression of an `memory.atomic.notify` expression.
1501
- BINARYEN_API BinaryenExpressionRef
1502
- BinaryenAtomicNotifyGetPtr(BinaryenExpressionRef expr);
1503
- // Sets the pointer expression of an `memory.atomic.notify` expression.
1504
- BINARYEN_API void BinaryenAtomicNotifySetPtr(BinaryenExpressionRef expr,
1505
- BinaryenExpressionRef ptrExpr);
1506
- // Gets the notify count expression of an `memory.atomic.notify` expression.
1507
- BINARYEN_API BinaryenExpressionRef
1508
- BinaryenAtomicNotifyGetNotifyCount(BinaryenExpressionRef expr);
1509
- // Sets the notify count expression of an `memory.atomic.notify` expression.
1510
- BINARYEN_API void
1511
- BinaryenAtomicNotifySetNotifyCount(BinaryenExpressionRef expr,
1512
- BinaryenExpressionRef notifyCountExpr);
1513
-
1514
- // AtomicFence
1515
-
1516
- // Gets the order of an `atomic.fence` expression.
1517
- BINARYEN_API uint8_t BinaryenAtomicFenceGetOrder(BinaryenExpressionRef expr);
1518
- // Sets the order of an `atomic.fence` expression.
1519
- BINARYEN_API void BinaryenAtomicFenceSetOrder(BinaryenExpressionRef expr,
1520
- uint8_t order);
1521
-
1522
- // SIMDExtract
1523
-
1524
- // Gets the operation being performed by a SIMD extract expression.
1525
- BINARYEN_API BinaryenOp BinaryenSIMDExtractGetOp(BinaryenExpressionRef expr);
1526
- // Sets the operation being performed by a SIMD extract expression.
1527
- BINARYEN_API void BinaryenSIMDExtractSetOp(BinaryenExpressionRef expr,
1528
- BinaryenOp op);
1529
- // Gets the vector expression a SIMD extract expression extracts from.
1530
- BINARYEN_API BinaryenExpressionRef
1531
- BinaryenSIMDExtractGetVec(BinaryenExpressionRef expr);
1532
- // Sets the vector expression a SIMD extract expression extracts from.
1533
- BINARYEN_API void BinaryenSIMDExtractSetVec(BinaryenExpressionRef expr,
1534
- BinaryenExpressionRef vecExpr);
1535
- // Gets the index of the extracted lane of a SIMD extract expression.
1536
- BINARYEN_API uint8_t BinaryenSIMDExtractGetIndex(BinaryenExpressionRef expr);
1537
- // Sets the index of the extracted lane of a SIMD extract expression.
1538
- BINARYEN_API void BinaryenSIMDExtractSetIndex(BinaryenExpressionRef expr,
1539
- uint8_t index);
1540
-
1541
- // SIMDReplace
1542
-
1543
- // Gets the operation being performed by a SIMD replace expression.
1544
- BINARYEN_API BinaryenOp BinaryenSIMDReplaceGetOp(BinaryenExpressionRef expr);
1545
- // Sets the operation being performed by a SIMD replace expression.
1546
- BINARYEN_API void BinaryenSIMDReplaceSetOp(BinaryenExpressionRef expr,
1547
- BinaryenOp op);
1548
- // Gets the vector expression a SIMD replace expression replaces in.
1549
- BINARYEN_API BinaryenExpressionRef
1550
- BinaryenSIMDReplaceGetVec(BinaryenExpressionRef expr);
1551
- // Sets the vector expression a SIMD replace expression replaces in.
1552
- BINARYEN_API void BinaryenSIMDReplaceSetVec(BinaryenExpressionRef expr,
1553
- BinaryenExpressionRef vecExpr);
1554
- // Gets the index of the replaced lane of a SIMD replace expression.
1555
- BINARYEN_API uint8_t BinaryenSIMDReplaceGetIndex(BinaryenExpressionRef expr);
1556
- // Sets the index of the replaced lane of a SIMD replace expression.
1557
- BINARYEN_API void BinaryenSIMDReplaceSetIndex(BinaryenExpressionRef expr,
1558
- uint8_t index);
1559
- // Gets the value expression a SIMD replace expression replaces with.
1560
- BINARYEN_API BinaryenExpressionRef
1561
- BinaryenSIMDReplaceGetValue(BinaryenExpressionRef expr);
1562
- // Sets the value expression a SIMD replace expression replaces with.
1563
- BINARYEN_API void BinaryenSIMDReplaceSetValue(BinaryenExpressionRef expr,
1564
- BinaryenExpressionRef valueExpr);
1565
-
1566
- // SIMDShuffle
1567
-
1568
- // Gets the left expression of a SIMD shuffle expression.
1569
- BINARYEN_API BinaryenExpressionRef
1570
- BinaryenSIMDShuffleGetLeft(BinaryenExpressionRef expr);
1571
- // Sets the left expression of a SIMD shuffle expression.
1572
- BINARYEN_API void BinaryenSIMDShuffleSetLeft(BinaryenExpressionRef expr,
1573
- BinaryenExpressionRef leftExpr);
1574
- // Gets the right expression of a SIMD shuffle expression.
1575
- BINARYEN_API BinaryenExpressionRef
1576
- BinaryenSIMDShuffleGetRight(BinaryenExpressionRef expr);
1577
- // Sets the right expression of a SIMD shuffle expression.
1578
- BINARYEN_API void BinaryenSIMDShuffleSetRight(BinaryenExpressionRef expr,
1579
- BinaryenExpressionRef rightExpr);
1580
- // Gets the 128-bit mask of a SIMD shuffle expression.
1581
- BINARYEN_API void BinaryenSIMDShuffleGetMask(BinaryenExpressionRef expr,
1582
- uint8_t* mask);
1583
- // Sets the 128-bit mask of a SIMD shuffle expression.
1584
- BINARYEN_API void BinaryenSIMDShuffleSetMask(BinaryenExpressionRef expr,
1585
- const uint8_t mask[16]);
1586
-
1587
- // SIMDTernary
1588
-
1589
- // Gets the operation being performed by a SIMD ternary expression.
1590
- BINARYEN_API BinaryenOp BinaryenSIMDTernaryGetOp(BinaryenExpressionRef expr);
1591
- // Sets the operation being performed by a SIMD ternary expression.
1592
- BINARYEN_API void BinaryenSIMDTernarySetOp(BinaryenExpressionRef expr,
1593
- BinaryenOp op);
1594
- // Gets the first operand expression of a SIMD ternary expression.
1595
- BINARYEN_API BinaryenExpressionRef
1596
- BinaryenSIMDTernaryGetA(BinaryenExpressionRef expr);
1597
- // Sets the first operand expression of a SIMD ternary expression.
1598
- BINARYEN_API void BinaryenSIMDTernarySetA(BinaryenExpressionRef expr,
1599
- BinaryenExpressionRef aExpr);
1600
- // Gets the second operand expression of a SIMD ternary expression.
1601
- BINARYEN_API BinaryenExpressionRef
1602
- BinaryenSIMDTernaryGetB(BinaryenExpressionRef expr);
1603
- // Sets the second operand expression of a SIMD ternary expression.
1604
- BINARYEN_API void BinaryenSIMDTernarySetB(BinaryenExpressionRef expr,
1605
- BinaryenExpressionRef bExpr);
1606
- // Gets the third operand expression of a SIMD ternary expression.
1607
- BINARYEN_API BinaryenExpressionRef
1608
- BinaryenSIMDTernaryGetC(BinaryenExpressionRef expr);
1609
- // Sets the third operand expression of a SIMD ternary expression.
1610
- BINARYEN_API void BinaryenSIMDTernarySetC(BinaryenExpressionRef expr,
1611
- BinaryenExpressionRef cExpr);
1612
-
1613
- // SIMDShift
1614
-
1615
- // Gets the operation being performed by a SIMD shift expression.
1616
- BINARYEN_API BinaryenOp BinaryenSIMDShiftGetOp(BinaryenExpressionRef expr);
1617
- // Sets the operation being performed by a SIMD shift expression.
1618
- BINARYEN_API void BinaryenSIMDShiftSetOp(BinaryenExpressionRef expr,
1619
- BinaryenOp op);
1620
- // Gets the expression being shifted by a SIMD shift expression.
1621
- BINARYEN_API BinaryenExpressionRef
1622
- BinaryenSIMDShiftGetVec(BinaryenExpressionRef expr);
1623
- // Sets the expression being shifted by a SIMD shift expression.
1624
- BINARYEN_API void BinaryenSIMDShiftSetVec(BinaryenExpressionRef expr,
1625
- BinaryenExpressionRef vecExpr);
1626
- // Gets the expression representing the shift of a SIMD shift expression.
1627
- BINARYEN_API BinaryenExpressionRef
1628
- BinaryenSIMDShiftGetShift(BinaryenExpressionRef expr);
1629
- // Sets the expression representing the shift of a SIMD shift expression.
1630
- BINARYEN_API void BinaryenSIMDShiftSetShift(BinaryenExpressionRef expr,
1631
- BinaryenExpressionRef shiftExpr);
1632
-
1633
- // SIMDLoad
1634
-
1635
- // Gets the operation being performed by a SIMD load expression.
1636
- BINARYEN_API BinaryenOp BinaryenSIMDLoadGetOp(BinaryenExpressionRef expr);
1637
- // Sets the operation being performed by a SIMD load expression.
1638
- BINARYEN_API void BinaryenSIMDLoadSetOp(BinaryenExpressionRef expr,
1639
- BinaryenOp op);
1640
- // Gets the constant offset of a SIMD load expression.
1641
- BINARYEN_API uint32_t BinaryenSIMDLoadGetOffset(BinaryenExpressionRef expr);
1642
- // Sets the constant offset of a SIMD load expression.
1643
- BINARYEN_API void BinaryenSIMDLoadSetOffset(BinaryenExpressionRef expr,
1644
- uint32_t offset);
1645
- // Gets the byte alignment of a SIMD load expression.
1646
- BINARYEN_API uint32_t BinaryenSIMDLoadGetAlign(BinaryenExpressionRef expr);
1647
- // Sets the byte alignment of a SIMD load expression.
1648
- BINARYEN_API void BinaryenSIMDLoadSetAlign(BinaryenExpressionRef expr,
1649
- uint32_t align);
1650
- // Gets the pointer expression of a SIMD load expression.
1651
- BINARYEN_API BinaryenExpressionRef
1652
- BinaryenSIMDLoadGetPtr(BinaryenExpressionRef expr);
1653
- // Sets the pointer expression of a SIMD load expression.
1654
- BINARYEN_API void BinaryenSIMDLoadSetPtr(BinaryenExpressionRef expr,
1655
- BinaryenExpressionRef ptrExpr);
1656
-
1657
- // MemoryInit
1658
-
1659
- // Gets the index of the segment being initialized by a `memory.init`
1660
- // expression.
1661
- BINARYEN_API uint32_t BinaryenMemoryInitGetSegment(BinaryenExpressionRef expr);
1662
- // Sets the index of the segment being initialized by a `memory.init`
1663
- // expression.
1664
- BINARYEN_API void BinaryenMemoryInitSetSegment(BinaryenExpressionRef expr,
1665
- uint32_t segmentIndex);
1666
- // Gets the destination expression of a `memory.init` expression.
1667
- BINARYEN_API BinaryenExpressionRef
1668
- BinaryenMemoryInitGetDest(BinaryenExpressionRef expr);
1669
- // Sets the destination expression of a `memory.init` expression.
1670
- BINARYEN_API void BinaryenMemoryInitSetDest(BinaryenExpressionRef expr,
1671
- BinaryenExpressionRef destExpr);
1672
- // Gets the offset expression of a `memory.init` expression.
1673
- BINARYEN_API BinaryenExpressionRef
1674
- BinaryenMemoryInitGetOffset(BinaryenExpressionRef expr);
1675
- // Sets the offset expression of a `memory.init` expression.
1676
- BINARYEN_API void BinaryenMemoryInitSetOffset(BinaryenExpressionRef expr,
1677
- BinaryenExpressionRef offsetExpr);
1678
- // Gets the size expression of a `memory.init` expression.
1679
- BINARYEN_API BinaryenExpressionRef
1680
- BinaryenMemoryInitGetSize(BinaryenExpressionRef expr);
1681
- // Sets the size expression of a `memory.init` expression.
1682
- BINARYEN_API void BinaryenMemoryInitSetSize(BinaryenExpressionRef expr,
1683
- BinaryenExpressionRef sizeExpr);
1684
-
1685
- // DataDrop
1686
-
1687
- // Gets the index of the segment being dropped by a `data.drop` expression.
1688
- BINARYEN_API uint32_t BinaryenDataDropGetSegment(BinaryenExpressionRef expr);
1689
- // Sets the index of the segment being dropped by a `data.drop` expression.
1690
- BINARYEN_API void BinaryenDataDropSetSegment(BinaryenExpressionRef expr,
1691
- uint32_t segmentIndex);
1692
-
1693
- // MemoryCopy
1694
-
1695
- // Gets the destination expression of a `memory.copy` expression.
1696
- BINARYEN_API BinaryenExpressionRef
1697
- BinaryenMemoryCopyGetDest(BinaryenExpressionRef expr);
1698
- // Sets the destination expression of a `memory.copy` expression.
1699
- BINARYEN_API void BinaryenMemoryCopySetDest(BinaryenExpressionRef expr,
1700
- BinaryenExpressionRef destExpr);
1701
- // Gets the source expression of a `memory.copy` expression.
1702
- BINARYEN_API BinaryenExpressionRef
1703
- BinaryenMemoryCopyGetSource(BinaryenExpressionRef expr);
1704
- // Sets the source expression of a `memory.copy` expression.
1705
- BINARYEN_API void BinaryenMemoryCopySetSource(BinaryenExpressionRef expr,
1706
- BinaryenExpressionRef sourceExpr);
1707
- // Gets the size expression (number of bytes copied) of a `memory.copy`
1708
- // expression.
1709
- BINARYEN_API BinaryenExpressionRef
1710
- BinaryenMemoryCopyGetSize(BinaryenExpressionRef expr);
1711
- // Sets the size expression (number of bytes copied) of a `memory.copy`
1712
- // expression.
1713
- BINARYEN_API void BinaryenMemoryCopySetSize(BinaryenExpressionRef expr,
1714
- BinaryenExpressionRef sizeExpr);
1715
-
1716
- // MemoryFill
1717
-
1718
- // Gets the destination expression of a `memory.fill` expression.
1719
- BINARYEN_API BinaryenExpressionRef
1720
- BinaryenMemoryFillGetDest(BinaryenExpressionRef expr);
1721
- // Sets the destination expression of a `memory.fill` expression.
1722
- BINARYEN_API void BinaryenMemoryFillSetDest(BinaryenExpressionRef expr,
1723
- BinaryenExpressionRef destExpr);
1724
- // Gets the value expression of a `memory.fill` expression.
1725
- BINARYEN_API BinaryenExpressionRef
1726
- BinaryenMemoryFillGetValue(BinaryenExpressionRef expr);
1727
- // Sets the value expression of a `memory.fill` expression.
1728
- BINARYEN_API void BinaryenMemoryFillSetValue(BinaryenExpressionRef expr,
1729
- BinaryenExpressionRef valueExpr);
1730
- // Gets the size expression (number of bytes filled) of a `memory.fill`
1731
- // expression.
1732
- BINARYEN_API BinaryenExpressionRef
1733
- BinaryenMemoryFillGetSize(BinaryenExpressionRef expr);
1734
- // Sets the size expression (number of bytes filled) of a `memory.fill`
1735
- // expression.
1736
- BINARYEN_API void BinaryenMemoryFillSetSize(BinaryenExpressionRef expr,
1737
- BinaryenExpressionRef sizeExpr);
1738
-
1739
- // RefIs
1740
-
1741
- // Gets the operation performed by a `ref.is_*` expression.
1742
- BINARYEN_API BinaryenOp BinaryenRefIsGetOp(BinaryenExpressionRef expr);
1743
- // Sets the operation performed by a `ref.is_*` expression.
1744
- BINARYEN_API void BinaryenRefIsSetOp(BinaryenExpressionRef expr, BinaryenOp op);
1745
- // Gets the value expression tested by a `ref.is_*` expression.
1746
- BINARYEN_API BinaryenExpressionRef
1747
- BinaryenRefIsGetValue(BinaryenExpressionRef expr);
1748
- // Sets the value expression tested by a `ref.is_*` expression.
1749
- BINARYEN_API void BinaryenRefIsSetValue(BinaryenExpressionRef expr,
1750
- BinaryenExpressionRef valueExpr);
1751
-
1752
- // RefAs
1753
-
1754
- // Gets the operation performed by a `ref.as_*` expression.
1755
- BINARYEN_API BinaryenOp BinaryenRefAsGetOp(BinaryenExpressionRef expr);
1756
- // Sets the operation performed by a `ref.as_*` expression.
1757
- BINARYEN_API void BinaryenRefAsSetOp(BinaryenExpressionRef expr, BinaryenOp op);
1758
- // Gets the value expression tested by a `ref.as_*` expression.
1759
- BINARYEN_API BinaryenExpressionRef
1760
- BinaryenRefAsGetValue(BinaryenExpressionRef expr);
1761
- // Sets the value expression tested by a `ref.as_*` expression.
1762
- BINARYEN_API void BinaryenRefAsSetValue(BinaryenExpressionRef expr,
1763
- BinaryenExpressionRef valueExpr);
1764
-
1765
- // RefFunc
1766
-
1767
- // Gets the name of the function being wrapped by a `ref.func` expression.
1768
- BINARYEN_API const char* BinaryenRefFuncGetFunc(BinaryenExpressionRef expr);
1769
- // Sets the name of the function being wrapped by a `ref.func` expression.
1770
- BINARYEN_API void BinaryenRefFuncSetFunc(BinaryenExpressionRef expr,
1771
- const char* funcName);
1772
-
1773
- // RefEq
1774
-
1775
- // Gets the left expression of a `ref.eq` expression.
1776
- BINARYEN_API BinaryenExpressionRef
1777
- BinaryenRefEqGetLeft(BinaryenExpressionRef expr);
1778
- // Sets the left expression of a `ref.eq` expression.
1779
- BINARYEN_API void BinaryenRefEqSetLeft(BinaryenExpressionRef expr,
1780
- BinaryenExpressionRef left);
1781
- // Gets the right expression of a `ref.eq` expression.
1782
- BINARYEN_API BinaryenExpressionRef
1783
- BinaryenRefEqGetRight(BinaryenExpressionRef expr);
1784
- // Sets the right expression of a `ref.eq` expression.
1785
- BINARYEN_API void BinaryenRefEqSetRight(BinaryenExpressionRef expr,
1786
- BinaryenExpressionRef right);
1787
-
1788
- // Try
1789
-
1790
- // Gets the name (label) of a `try` expression.
1791
- BINARYEN_API const char* BinaryenTryGetName(BinaryenExpressionRef expr);
1792
- // Sets the name (label) of a `try` expression.
1793
- BINARYEN_API void BinaryenTrySetName(BinaryenExpressionRef expr,
1794
- const char* name);
1795
- // Gets the body expression of a `try` expression.
1796
- BINARYEN_API BinaryenExpressionRef
1797
- BinaryenTryGetBody(BinaryenExpressionRef expr);
1798
- // Sets the body expression of a `try` expression.
1799
- BINARYEN_API void BinaryenTrySetBody(BinaryenExpressionRef expr,
1800
- BinaryenExpressionRef bodyExpr);
1801
- // Gets the number of catch blocks (= the number of catch events) of a `try`
1802
- // expression.
1803
- BINARYEN_API BinaryenIndex
1804
- BinaryenTryGetNumCatchEvents(BinaryenExpressionRef expr);
1805
- // Gets the number of catch/catch_all blocks of a `try` expression.
1806
- BINARYEN_API BinaryenIndex
1807
- BinaryenTryGetNumCatchBodies(BinaryenExpressionRef expr);
1808
- // Gets the catch event at the specified index of a `try` expression.
1809
- BINARYEN_API const char* BinaryenTryGetCatchEventAt(BinaryenExpressionRef expr,
1810
- BinaryenIndex index);
1811
- // Sets the catch event at the specified index of a `try` expression.
1812
- BINARYEN_API void BinaryenTrySetCatchEventAt(BinaryenExpressionRef expr,
1813
- BinaryenIndex index,
1814
- const char* catchEvent);
1815
- // Appends a catch event to a `try` expression, returning its insertion index.
1816
- BINARYEN_API BinaryenIndex
1817
- BinaryenTryAppendCatchEvent(BinaryenExpressionRef expr, const char* catchEvent);
1818
- // Inserts a catch event at the specified index of a `try` expression, moving
1819
- // existing catch events including the one previously at that index one index
1820
- // up.
1821
- BINARYEN_API void BinaryenTryInsertCatchEventAt(BinaryenExpressionRef expr,
1822
- BinaryenIndex index,
1823
- const char* catchEvent);
1824
- // Removes the catch event at the specified index of a `try` expression, moving
1825
- // all subsequent catch events one index down. Returns the event.
1826
- BINARYEN_API const char*
1827
- BinaryenTryRemoveCatchEventAt(BinaryenExpressionRef expr, BinaryenIndex index);
1828
- // Gets the catch body expression at the specified index of a `try` expression.
1829
- BINARYEN_API BinaryenExpressionRef
1830
- BinaryenTryGetCatchBodyAt(BinaryenExpressionRef expr, BinaryenIndex index);
1831
- // Sets the catch body expression at the specified index of a `try` expression.
1832
- BINARYEN_API void BinaryenTrySetCatchBodyAt(BinaryenExpressionRef expr,
1833
- BinaryenIndex index,
1834
- BinaryenExpressionRef catchExpr);
1835
- // Appends a catch expression to a `try` expression, returning its insertion
1836
- // index.
1837
- BINARYEN_API BinaryenIndex BinaryenTryAppendCatchBody(
1838
- BinaryenExpressionRef expr, BinaryenExpressionRef catchExpr);
1839
- // Inserts a catch expression at the specified index of a `try` expression,
1840
- // moving existing catch bodies including the one previously at that index one
1841
- // index up.
1842
- BINARYEN_API void BinaryenTryInsertCatchBodyAt(BinaryenExpressionRef expr,
1843
- BinaryenIndex index,
1844
- BinaryenExpressionRef catchExpr);
1845
- // Removes the catch expression at the specified index of a `try` expression,
1846
- // moving all subsequent catch bodies one index down. Returns the catch
1847
- // expression.
1848
- BINARYEN_API BinaryenExpressionRef
1849
- BinaryenTryRemoveCatchBodyAt(BinaryenExpressionRef expr, BinaryenIndex index);
1850
- // Gets whether a `try` expression has a catch_all clause.
1851
- BINARYEN_API bool BinaryenTryHasCatchAll(BinaryenExpressionRef expr);
1852
- // Gets the target label of a `delegate`.
1853
- BINARYEN_API const char*
1854
- BinaryenTryGetDelegateTarget(BinaryenExpressionRef expr);
1855
- // Sets the target label of a `delegate`.
1856
- BINARYEN_API void BinaryenTrySetDelegateTarget(BinaryenExpressionRef expr,
1857
- const char* delegateTarget);
1858
- // Gets whether a `try` expression is a try-delegate.
1859
- BINARYEN_API bool BinaryenTryIsDelegate(BinaryenExpressionRef expr);
1860
-
1861
- // Throw
1862
-
1863
- // Gets the name of the event being thrown by a `throw` expression.
1864
- BINARYEN_API const char* BinaryenThrowGetEvent(BinaryenExpressionRef expr);
1865
- // Sets the name of the event being thrown by a `throw` expression.
1866
- BINARYEN_API void BinaryenThrowSetEvent(BinaryenExpressionRef expr,
1867
- const char* eventName);
1868
- // Gets the number of operands of a `throw` expression.
1869
- BINARYEN_API BinaryenIndex
1870
- BinaryenThrowGetNumOperands(BinaryenExpressionRef expr);
1871
- // Gets the operand at the specified index of a `throw` expression.
1872
- BINARYEN_API BinaryenExpressionRef
1873
- BinaryenThrowGetOperandAt(BinaryenExpressionRef expr, BinaryenIndex index);
1874
- // Sets the operand at the specified index of a `throw` expression.
1875
- BINARYEN_API void BinaryenThrowSetOperandAt(BinaryenExpressionRef expr,
1876
- BinaryenIndex index,
1877
- BinaryenExpressionRef operandExpr);
1878
- // Appends an operand expression to a `throw` expression, returning its
1879
- // insertion index.
1880
- BINARYEN_API BinaryenIndex BinaryenThrowAppendOperand(
1881
- BinaryenExpressionRef expr, BinaryenExpressionRef operandExpr);
1882
- // Inserts an operand expression at the specified index of a `throw` expression,
1883
- // moving existing operands including the one previously at that index one index
1884
- // up.
1885
- BINARYEN_API void
1886
- BinaryenThrowInsertOperandAt(BinaryenExpressionRef expr,
1887
- BinaryenIndex index,
1888
- BinaryenExpressionRef operandExpr);
1889
- // Removes the operand expression at the specified index of a `throw`
1890
- // expression, moving all subsequent operands one index down. Returns the
1891
- // operand expression.
1892
- BINARYEN_API BinaryenExpressionRef
1893
- BinaryenThrowRemoveOperandAt(BinaryenExpressionRef expr, BinaryenIndex index);
1894
-
1895
- // Rethrow
1896
-
1897
- // Gets the target catch's corresponding try label of a `rethrow` expression.
1898
- BINARYEN_API const char* BinaryenRethrowGetTarget(BinaryenExpressionRef expr);
1899
- // Sets the target catch's corresponding try label of a `rethrow` expression.
1900
- BINARYEN_API void BinaryenRethrowSetTarget(BinaryenExpressionRef expr,
1901
- const char* target);
1902
-
1903
- // TupleMake
1904
-
1905
- // Gets the number of operands of a `tuple.make` expression.
1906
- BINARYEN_API BinaryenIndex
1907
- BinaryenTupleMakeGetNumOperands(BinaryenExpressionRef expr);
1908
- // Gets the operand at the specified index of a `tuple.make` expression.
1909
- BINARYEN_API BinaryenExpressionRef
1910
- BinaryenTupleMakeGetOperandAt(BinaryenExpressionRef expr, BinaryenIndex index);
1911
- // Sets the operand at the specified index of a `tuple.make` expression.
1912
- BINARYEN_API void
1913
- BinaryenTupleMakeSetOperandAt(BinaryenExpressionRef expr,
1914
- BinaryenIndex index,
1915
- BinaryenExpressionRef operandExpr);
1916
- // Appends an operand expression to a `tuple.make` expression, returning its
1917
- // insertion index.
1918
- BINARYEN_API BinaryenIndex BinaryenTupleMakeAppendOperand(
1919
- BinaryenExpressionRef expr, BinaryenExpressionRef operandExpr);
1920
- // Inserts an operand expression at the specified index of a `tuple.make`
1921
- // expression, moving existing operands including the one previously at that
1922
- // index one index up.
1923
- BINARYEN_API void
1924
- BinaryenTupleMakeInsertOperandAt(BinaryenExpressionRef expr,
1925
- BinaryenIndex index,
1926
- BinaryenExpressionRef operandExpr);
1927
- // Removes the operand expression at the specified index of a `tuple.make`
1928
- // expression, moving all subsequent operands one index down. Returns the
1929
- // operand expression.
1930
- BINARYEN_API BinaryenExpressionRef BinaryenTupleMakeRemoveOperandAt(
1931
- BinaryenExpressionRef expr, BinaryenIndex index);
1932
-
1933
- // TupleExtract
1934
-
1935
- // Gets the tuple extracted from of a `tuple.extract` expression.
1936
- BINARYEN_API BinaryenExpressionRef
1937
- BinaryenTupleExtractGetTuple(BinaryenExpressionRef expr);
1938
- // Sets the tuple extracted from of a `tuple.extract` expression.
1939
- BINARYEN_API void BinaryenTupleExtractSetTuple(BinaryenExpressionRef expr,
1940
- BinaryenExpressionRef tupleExpr);
1941
- // Gets the index extracted at of a `tuple.extract` expression.
1942
- BINARYEN_API BinaryenIndex
1943
- BinaryenTupleExtractGetIndex(BinaryenExpressionRef expr);
1944
- // Sets the index extracted at of a `tuple.extract` expression.
1945
- BINARYEN_API void BinaryenTupleExtractSetIndex(BinaryenExpressionRef expr,
1946
- BinaryenIndex index);
1947
-
1948
- // I31New
1949
-
1950
- // Gets the value expression of an `i31.new` expression.
1951
- BINARYEN_API BinaryenExpressionRef
1952
- BinaryenI31NewGetValue(BinaryenExpressionRef expr);
1953
- // Sets the value expression of an `i31.new` expression.
1954
- BINARYEN_API void BinaryenI31NewSetValue(BinaryenExpressionRef expr,
1955
- BinaryenExpressionRef valueExpr);
1956
-
1957
- // I31Get
1958
-
1959
- // Gets the i31 expression of an `i31.get` expression.
1960
- BINARYEN_API BinaryenExpressionRef
1961
- BinaryenI31GetGetI31(BinaryenExpressionRef expr);
1962
- // Sets the i31 expression of an `i31.get` expression.
1963
- BINARYEN_API void BinaryenI31GetSetI31(BinaryenExpressionRef expr,
1964
- BinaryenExpressionRef i31Expr);
1965
- // Gets whether an `i31.get` expression returns a signed value (`_s`).
1966
- BINARYEN_API bool BinaryenI31GetIsSigned(BinaryenExpressionRef expr);
1967
- // Sets whether an `i31.get` expression returns a signed value (`_s`).
1968
- BINARYEN_API void BinaryenI31GetSetSigned(BinaryenExpressionRef expr,
1969
- bool signed_);
1970
-
1971
- // Functions
1972
-
1973
- BINARYEN_REF(Function);
1974
-
1975
- // Adds a function to the module. This is thread-safe.
1976
- // @varTypes: the types of variables. In WebAssembly, vars share
1977
- // an index space with params. In other words, params come from
1978
- // the function type, and vars are provided in this call, and
1979
- // together they are all the locals. The order is first params
1980
- // and then vars, so if you have one param it will be at index
1981
- // 0 (and written $0), and if you also have 2 vars they will be
1982
- // at indexes 1 and 2, etc., that is, they share an index space.
1983
- BINARYEN_API BinaryenFunctionRef
1984
- BinaryenAddFunction(BinaryenModuleRef module,
1985
- const char* name,
1986
- BinaryenType params,
1987
- BinaryenType results,
1988
- BinaryenType* varTypes,
1989
- BinaryenIndex numVarTypes,
1990
- BinaryenExpressionRef body);
1991
- // Gets a function reference by name. Returns NULL if the function does not
1992
- // exist.
1993
- BINARYEN_API BinaryenFunctionRef BinaryenGetFunction(BinaryenModuleRef module,
1994
- const char* name);
1995
- // Removes a function by name.
1996
- BINARYEN_API void BinaryenRemoveFunction(BinaryenModuleRef module,
1997
- const char* name);
1998
-
1999
- // Gets the number of functions in the module.
2000
- BINARYEN_API BinaryenIndex BinaryenGetNumFunctions(BinaryenModuleRef module);
2001
- // Gets the function at the specified index.
2002
- BINARYEN_API BinaryenFunctionRef
2003
- BinaryenGetFunctionByIndex(BinaryenModuleRef module, BinaryenIndex index);
2004
-
2005
- // Imports
2006
-
2007
- BINARYEN_API void BinaryenAddFunctionImport(BinaryenModuleRef module,
2008
- const char* internalName,
2009
- const char* externalModuleName,
2010
- const char* externalBaseName,
2011
- BinaryenType params,
2012
- BinaryenType results);
2013
- BINARYEN_API void BinaryenAddTableImport(BinaryenModuleRef module,
2014
- const char* internalName,
2015
- const char* externalModuleName,
2016
- const char* externalBaseName);
2017
- BINARYEN_API void BinaryenAddMemoryImport(BinaryenModuleRef module,
2018
- const char* internalName,
2019
- const char* externalModuleName,
2020
- const char* externalBaseName,
2021
- uint8_t shared);
2022
- BINARYEN_API void BinaryenAddGlobalImport(BinaryenModuleRef module,
2023
- const char* internalName,
2024
- const char* externalModuleName,
2025
- const char* externalBaseName,
2026
- BinaryenType globalType,
2027
- bool mutable_);
2028
- BINARYEN_API void BinaryenAddEventImport(BinaryenModuleRef module,
2029
- const char* internalName,
2030
- const char* externalModuleName,
2031
- const char* externalBaseName,
2032
- uint32_t attribute,
2033
- BinaryenType params,
2034
- BinaryenType results);
2035
-
2036
- // Exports
2037
-
2038
- BINARYEN_REF(Export);
2039
-
2040
- WASM_DEPRECATED BinaryenExportRef BinaryenAddExport(BinaryenModuleRef module,
2041
- const char* internalName,
2042
- const char* externalName);
2043
- // Adds a function export to the module.
2044
- BINARYEN_API BinaryenExportRef BinaryenAddFunctionExport(
2045
- BinaryenModuleRef module, const char* internalName, const char* externalName);
2046
- // Adds a table export to the module.
2047
- BINARYEN_API BinaryenExportRef BinaryenAddTableExport(BinaryenModuleRef module,
2048
- const char* internalName,
2049
- const char* externalName);
2050
- // Adds a memory export to the module.
2051
- BINARYEN_API BinaryenExportRef BinaryenAddMemoryExport(
2052
- BinaryenModuleRef module, const char* internalName, const char* externalName);
2053
- // Adds a global export to the module.
2054
- BINARYEN_API BinaryenExportRef BinaryenAddGlobalExport(
2055
- BinaryenModuleRef module, const char* internalName, const char* externalName);
2056
- // Adds an event export to the module.
2057
- BINARYEN_API BinaryenExportRef BinaryenAddEventExport(BinaryenModuleRef module,
2058
- const char* internalName,
2059
- const char* externalName);
2060
- // Gets an export reference by external name. Returns NULL if the export does
2061
- // not exist.
2062
- BINARYEN_API BinaryenExportRef BinaryenGetExport(BinaryenModuleRef module,
2063
- const char* externalName);
2064
- // Removes an export by external name.
2065
- BINARYEN_API void BinaryenRemoveExport(BinaryenModuleRef module,
2066
- const char* externalName);
2067
- // Gets the number of exports in the module.
2068
- BINARYEN_API BinaryenIndex BinaryenGetNumExports(BinaryenModuleRef module);
2069
- // Gets the export at the specified index.
2070
- BINARYEN_API BinaryenExportRef
2071
- BinaryenGetExportByIndex(BinaryenModuleRef module, BinaryenIndex index);
2072
-
2073
- // Globals
2074
-
2075
- BINARYEN_REF(Global);
2076
-
2077
- // Adds a global to the module.
2078
- BINARYEN_API BinaryenGlobalRef BinaryenAddGlobal(BinaryenModuleRef module,
2079
- const char* name,
2080
- BinaryenType type,
2081
- bool mutable_,
2082
- BinaryenExpressionRef init);
2083
- // Gets a global reference by name. Returns NULL if the global does not exist.
2084
- BINARYEN_API BinaryenGlobalRef BinaryenGetGlobal(BinaryenModuleRef module,
2085
- const char* name);
2086
- // Removes a global by name.
2087
- BINARYEN_API void BinaryenRemoveGlobal(BinaryenModuleRef module,
2088
- const char* name);
2089
- // Gets the number of globals in the module.
2090
- BINARYEN_API BinaryenIndex BinaryenGetNumGlobals(BinaryenModuleRef module);
2091
- // Gets the global at the specified index.
2092
- BINARYEN_API BinaryenGlobalRef
2093
- BinaryenGetGlobalByIndex(BinaryenModuleRef module, BinaryenIndex index);
2094
-
2095
- // Events
2096
-
2097
- BINARYEN_REF(Event);
2098
-
2099
- // Adds an event to the module.
2100
- BINARYEN_API BinaryenEventRef BinaryenAddEvent(BinaryenModuleRef module,
2101
- const char* name,
2102
- uint32_t attribute,
2103
- BinaryenType params,
2104
- BinaryenType results);
2105
- // Gets an event reference by name. Returns NULL if the event does not exist.
2106
- BINARYEN_API BinaryenEventRef BinaryenGetEvent(BinaryenModuleRef module,
2107
- const char* name);
2108
- // Removes an event by name.
2109
- BINARYEN_API void BinaryenRemoveEvent(BinaryenModuleRef module,
2110
- const char* name);
2111
-
2112
- // Tables
2113
-
2114
- BINARYEN_REF(Table);
2115
-
2116
- BINARYEN_API BinaryenTableRef BinaryenAddTable(BinaryenModuleRef module,
2117
- const char* table,
2118
- BinaryenIndex initial,
2119
- BinaryenIndex maximum);
2120
- BINARYEN_API void BinaryenRemoveTable(BinaryenModuleRef module,
2121
- const char* table);
2122
- BINARYEN_API BinaryenIndex BinaryenGetNumTables(BinaryenModuleRef module);
2123
- BINARYEN_API BinaryenTableRef BinaryenGetTable(BinaryenModuleRef module,
2124
- const char* name);
2125
- BINARYEN_API BinaryenTableRef BinaryenGetTableByIndex(BinaryenModuleRef module,
2126
- BinaryenIndex index);
2127
-
2128
- // Elem segments
2129
-
2130
- BINARYEN_REF(ElementSegment);
2131
-
2132
- BINARYEN_API BinaryenElementSegmentRef
2133
- BinaryenAddActiveElementSegment(BinaryenModuleRef module,
2134
- const char* table,
2135
- const char* name,
2136
- const char** funcNames,
2137
- BinaryenIndex numFuncNames,
2138
- BinaryenExpressionRef offset);
2139
- BINARYEN_API BinaryenElementSegmentRef
2140
- BinaryenAddPassiveElementSegment(BinaryenModuleRef module,
2141
- const char* name,
2142
- const char** funcNames,
2143
- BinaryenIndex numFuncNames);
2144
- BINARYEN_API void BinaryenRemoveElementSegment(BinaryenModuleRef module,
2145
- const char* name);
2146
- BINARYEN_API BinaryenIndex
2147
- BinaryenGetNumElementSegments(BinaryenModuleRef module);
2148
- BINARYEN_API BinaryenElementSegmentRef
2149
- BinaryenGetElementSegment(BinaryenModuleRef module, const char* name);
2150
- BINARYEN_API BinaryenElementSegmentRef
2151
- BinaryenGetElementSegmentByIndex(BinaryenModuleRef module, BinaryenIndex index);
2152
-
2153
- // Memory. One per module
2154
-
2155
- // Each memory has data in segments, a start offset in segmentOffsets, and a
2156
- // size in segmentSizes. exportName can be NULL
2157
- BINARYEN_API void BinaryenSetMemory(BinaryenModuleRef module,
2158
- BinaryenIndex initial,
2159
- BinaryenIndex maximum,
2160
- const char* exportName,
2161
- const char** segments,
2162
- bool* segmentPassive,
2163
- BinaryenExpressionRef* segmentOffsets,
2164
- BinaryenIndex* segmentSizes,
2165
- BinaryenIndex numSegments,
2166
- bool shared);
2167
-
2168
- // Memory segments. Query utilities.
2169
-
2170
- BINARYEN_API uint32_t BinaryenGetNumMemorySegments(BinaryenModuleRef module);
2171
- BINARYEN_API uint32_t
2172
- BinaryenGetMemorySegmentByteOffset(BinaryenModuleRef module, BinaryenIndex id);
2173
- BINARYEN_API size_t BinaryenGetMemorySegmentByteLength(BinaryenModuleRef module,
2174
- BinaryenIndex id);
2175
- BINARYEN_API bool BinaryenGetMemorySegmentPassive(BinaryenModuleRef module,
2176
- BinaryenIndex id);
2177
- BINARYEN_API void BinaryenCopyMemorySegmentData(BinaryenModuleRef module,
2178
- BinaryenIndex id,
2179
- char* buffer);
2180
-
2181
- // Start function. One per module
2182
-
2183
- BINARYEN_API void BinaryenSetStart(BinaryenModuleRef module,
2184
- BinaryenFunctionRef start);
2185
-
2186
- // Features
2187
-
2188
- // These control what features are allowed when validation and in passes.
2189
- BINARYEN_API BinaryenFeatures
2190
- BinaryenModuleGetFeatures(BinaryenModuleRef module);
2191
- BINARYEN_API void BinaryenModuleSetFeatures(BinaryenModuleRef module,
2192
- BinaryenFeatures features);
2193
-
2194
- //
2195
- // ========== Module Operations ==========
2196
- //
2197
-
2198
- // Parse a module in s-expression text format
2199
- BINARYEN_API BinaryenModuleRef BinaryenModuleParse(const char* text);
2200
-
2201
- // Print a module to stdout in s-expression text format. Useful for debugging.
2202
- BINARYEN_API void BinaryenModulePrint(BinaryenModuleRef module);
2203
-
2204
- // Print a module to stdout in asm.js syntax.
2205
- BINARYEN_API void BinaryenModulePrintAsmjs(BinaryenModuleRef module);
2206
-
2207
- // Validate a module, showing errors on problems.
2208
- // @return 0 if an error occurred, 1 if validated succesfully
2209
- BINARYEN_API bool BinaryenModuleValidate(BinaryenModuleRef module);
2210
-
2211
- // Runs the standard optimization passes on the module. Uses the currently set
2212
- // global optimize and shrink level.
2213
- BINARYEN_API void BinaryenModuleOptimize(BinaryenModuleRef module);
2214
-
2215
- // Gets the currently set optimize level. Applies to all modules, globally.
2216
- // 0, 1, 2 correspond to -O0, -O1, -O2 (default), etc.
2217
- BINARYEN_API int BinaryenGetOptimizeLevel(void);
2218
-
2219
- // Sets the optimization level to use. Applies to all modules, globally.
2220
- // 0, 1, 2 correspond to -O0, -O1, -O2 (default), etc.
2221
- BINARYEN_API void BinaryenSetOptimizeLevel(int level);
2222
-
2223
- // Gets the currently set shrink level. Applies to all modules, globally.
2224
- // 0, 1, 2 correspond to -O0, -Os (default), -Oz.
2225
- BINARYEN_API int BinaryenGetShrinkLevel(void);
2226
-
2227
- // Sets the shrink level to use. Applies to all modules, globally.
2228
- // 0, 1, 2 correspond to -O0, -Os (default), -Oz.
2229
- BINARYEN_API void BinaryenSetShrinkLevel(int level);
2230
-
2231
- // Gets whether generating debug information is currently enabled or not.
2232
- // Applies to all modules, globally.
2233
- BINARYEN_API bool BinaryenGetDebugInfo(void);
2234
-
2235
- // Enables or disables debug information in emitted binaries.
2236
- // Applies to all modules, globally.
2237
- BINARYEN_API void BinaryenSetDebugInfo(bool on);
2238
-
2239
- // Gets whether the low 1K of memory can be considered unused when optimizing.
2240
- // Applies to all modules, globally.
2241
- BINARYEN_API bool BinaryenGetLowMemoryUnused(void);
2242
-
2243
- // Enables or disables whether the low 1K of memory can be considered unused
2244
- // when optimizing. Applies to all modules, globally.
2245
- BINARYEN_API void BinaryenSetLowMemoryUnused(bool on);
2246
-
2247
- // Gets whether fast math optimizations are enabled, ignoring for example
2248
- // corner cases of floating-point math like NaN changes.
2249
- // Applies to all modules, globally.
2250
- BINARYEN_API bool BinaryenGetFastMath(void);
2251
-
2252
- // Enables or disables fast math optimizations, ignoring for example
2253
- // corner cases of floating-point math like NaN changes.
2254
- // Applies to all modules, globally.
2255
- BINARYEN_API void BinaryenSetFastMath(bool value);
2256
-
2257
- // Gets the value of the specified arbitrary pass argument.
2258
- // Applies to all modules, globally.
2259
- BINARYEN_API const char* BinaryenGetPassArgument(const char* name);
2260
-
2261
- // Sets the value of the specified arbitrary pass argument. Removes the
2262
- // respective argument if `value` is NULL. Applies to all modules, globally.
2263
- BINARYEN_API void BinaryenSetPassArgument(const char* name, const char* value);
2264
-
2265
- // Clears all arbitrary pass arguments.
2266
- // Applies to all modules, globally.
2267
- BINARYEN_API void BinaryenClearPassArguments();
2268
-
2269
- // Gets the function size at which we always inline.
2270
- // Applies to all modules, globally.
2271
- BINARYEN_API BinaryenIndex BinaryenGetAlwaysInlineMaxSize(void);
2272
-
2273
- // Sets the function size at which we always inline.
2274
- // Applies to all modules, globally.
2275
- BINARYEN_API void BinaryenSetAlwaysInlineMaxSize(BinaryenIndex size);
2276
-
2277
- // Gets the function size which we inline when functions are lightweight.
2278
- // Applies to all modules, globally.
2279
- BINARYEN_API BinaryenIndex BinaryenGetFlexibleInlineMaxSize(void);
2280
-
2281
- // Sets the function size which we inline when functions are lightweight.
2282
- // Applies to all modules, globally.
2283
- BINARYEN_API void BinaryenSetFlexibleInlineMaxSize(BinaryenIndex size);
2284
-
2285
- // Gets the function size which we inline when there is only one caller.
2286
- // Applies to all modules, globally.
2287
- BINARYEN_API BinaryenIndex BinaryenGetOneCallerInlineMaxSize(void);
2288
-
2289
- // Sets the function size which we inline when there is only one caller.
2290
- // Applies to all modules, globally.
2291
- BINARYEN_API void BinaryenSetOneCallerInlineMaxSize(BinaryenIndex size);
2292
-
2293
- // Gets whether functions with loops are allowed to be inlined.
2294
- // Applies to all modules, globally.
2295
- BINARYEN_API bool BinaryenGetAllowInliningFunctionsWithLoops(void);
2296
-
2297
- // Sets whether functions with loops are allowed to be inlined.
2298
- // Applies to all modules, globally.
2299
- BINARYEN_API void BinaryenSetAllowInliningFunctionsWithLoops(bool enabled);
2300
-
2301
- // Runs the specified passes on the module. Uses the currently set global
2302
- // optimize and shrink level.
2303
- BINARYEN_API void BinaryenModuleRunPasses(BinaryenModuleRef module,
2304
- const char** passes,
2305
- BinaryenIndex numPasses);
2306
-
2307
- // Auto-generate drop() operations where needed. This lets you generate code
2308
- // without worrying about where they are needed. (It is more efficient to do it
2309
- // yourself, but simpler to use autodrop).
2310
- BINARYEN_API void BinaryenModuleAutoDrop(BinaryenModuleRef module);
2311
-
2312
- // Serialize a module into binary form. Uses the currently set global debugInfo
2313
- // option.
2314
- // @return how many bytes were written. This will be less than or equal to
2315
- // outputSize
2316
- size_t BINARYEN_API BinaryenModuleWrite(BinaryenModuleRef module,
2317
- char* output,
2318
- size_t outputSize);
2319
-
2320
- // Serialize a module in s-expression text format.
2321
- // @return how many bytes were written. This will be less than or equal to
2322
- // outputSize
2323
- BINARYEN_API size_t BinaryenModuleWriteText(BinaryenModuleRef module,
2324
- char* output,
2325
- size_t outputSize);
2326
-
2327
- typedef struct BinaryenBufferSizes {
2328
- size_t outputBytes;
2329
- size_t sourceMapBytes;
2330
- } BinaryenBufferSizes;
2331
-
2332
- // Serialize a module into binary form including its source map. Uses the
2333
- // currently set global debugInfo option.
2334
- // @returns how many bytes were written. This will be less than or equal to
2335
- // outputSize
2336
- BINARYEN_API BinaryenBufferSizes
2337
- BinaryenModuleWriteWithSourceMap(BinaryenModuleRef module,
2338
- const char* url,
2339
- char* output,
2340
- size_t outputSize,
2341
- char* sourceMap,
2342
- size_t sourceMapSize);
2343
-
2344
- // Result structure of BinaryenModuleAllocateAndWrite. Contained buffers have
2345
- // been allocated using malloc() and the user is expected to free() them
2346
- // manually once not needed anymore.
2347
- typedef struct BinaryenModuleAllocateAndWriteResult {
2348
- void* binary;
2349
- size_t binaryBytes;
2350
- char* sourceMap;
2351
- } BinaryenModuleAllocateAndWriteResult;
2352
-
2353
- // Serializes a module into binary form, optionally including its source map if
2354
- // sourceMapUrl has been specified. Uses the currently set global debugInfo
2355
- // option. Differs from BinaryenModuleWrite in that it implicitly allocates
2356
- // appropriate buffers using malloc(), and expects the user to free() them
2357
- // manually once not needed anymore.
2358
- BINARYEN_API BinaryenModuleAllocateAndWriteResult
2359
- BinaryenModuleAllocateAndWrite(BinaryenModuleRef module,
2360
- const char* sourceMapUrl);
2361
-
2362
- // Serialize a module in s-expression form. Implicity allocates the returned
2363
- // char* with malloc(), and expects the user to free() them manually
2364
- // once not needed anymore.
2365
- BINARYEN_API char* BinaryenModuleAllocateAndWriteText(BinaryenModuleRef module);
2366
-
2367
- // Deserialize a module from binary form.
2368
- BINARYEN_API BinaryenModuleRef BinaryenModuleRead(char* input,
2369
- size_t inputSize);
2370
-
2371
- // Execute a module in the Binaryen interpreter. This will create an instance of
2372
- // the module, run it in the interpreter - which means running the start method
2373
- // - and then destroying the instance.
2374
- BINARYEN_API void BinaryenModuleInterpret(BinaryenModuleRef module);
2375
-
2376
- // Adds a debug info file name to the module and returns its index.
2377
- BINARYEN_API BinaryenIndex BinaryenModuleAddDebugInfoFileName(
2378
- BinaryenModuleRef module, const char* filename);
2379
-
2380
- // Gets the name of the debug info file at the specified index. Returns `NULL`
2381
- // if it does not exist.
2382
- BINARYEN_API const char*
2383
- BinaryenModuleGetDebugInfoFileName(BinaryenModuleRef module,
2384
- BinaryenIndex index);
2385
-
2386
- //
2387
- // ========== Function Operations ==========
2388
- //
2389
-
2390
- // Gets the name of the specified `Function`.
2391
- BINARYEN_API const char* BinaryenFunctionGetName(BinaryenFunctionRef func);
2392
- // Gets the type of the parameter at the specified index of the specified
2393
- // `Function`.
2394
- BINARYEN_API BinaryenType BinaryenFunctionGetParams(BinaryenFunctionRef func);
2395
- // Gets the result type of the specified `Function`.
2396
- BINARYEN_API BinaryenType BinaryenFunctionGetResults(BinaryenFunctionRef func);
2397
- // Gets the number of additional locals within the specified `Function`.
2398
- BINARYEN_API BinaryenIndex BinaryenFunctionGetNumVars(BinaryenFunctionRef func);
2399
- // Gets the type of the additional local at the specified index within the
2400
- // specified `Function`.
2401
- BINARYEN_API BinaryenType BinaryenFunctionGetVar(BinaryenFunctionRef func,
2402
- BinaryenIndex index);
2403
- // Gets the number of locals within the specified function. Includes parameters.
2404
- BINARYEN_API BinaryenIndex
2405
- BinaryenFunctionGetNumLocals(BinaryenFunctionRef func);
2406
- // Tests if the local at the specified index has a name.
2407
- BINARYEN_API bool BinaryenFunctionHasLocalName(BinaryenFunctionRef func,
2408
- BinaryenIndex index);
2409
- // Gets the name of the local at the specified index.
2410
- BINARYEN_API const char* BinaryenFunctionGetLocalName(BinaryenFunctionRef func,
2411
- BinaryenIndex index);
2412
- // Sets the name of the local at the specified index.
2413
- BINARYEN_API void BinaryenFunctionSetLocalName(BinaryenFunctionRef func,
2414
- BinaryenIndex index,
2415
- const char* name);
2416
- // Gets the body of the specified `Function`.
2417
- BINARYEN_API BinaryenExpressionRef
2418
- BinaryenFunctionGetBody(BinaryenFunctionRef func);
2419
- // Sets the body of the specified `Function`.
2420
- BINARYEN_API void BinaryenFunctionSetBody(BinaryenFunctionRef func,
2421
- BinaryenExpressionRef body);
2422
-
2423
- // Runs the standard optimization passes on the function. Uses the currently set
2424
- // global optimize and shrink level.
2425
- BINARYEN_API void BinaryenFunctionOptimize(BinaryenFunctionRef func,
2426
- BinaryenModuleRef module);
2427
-
2428
- // Runs the specified passes on the function. Uses the currently set global
2429
- // optimize and shrink level.
2430
- BINARYEN_API void BinaryenFunctionRunPasses(BinaryenFunctionRef func,
2431
- BinaryenModuleRef module,
2432
- const char** passes,
2433
- BinaryenIndex numPasses);
2434
-
2435
- // Sets the debug location of the specified `Expression` within the specified
2436
- // `Function`.
2437
- BINARYEN_API void BinaryenFunctionSetDebugLocation(BinaryenFunctionRef func,
2438
- BinaryenExpressionRef expr,
2439
- BinaryenIndex fileIndex,
2440
- BinaryenIndex lineNumber,
2441
- BinaryenIndex columnNumber);
2442
-
2443
- //
2444
- // ========== Table Operations ==========
2445
- //
2446
-
2447
- // Gets the name of the specified `Table`.
2448
- BINARYEN_API const char* BinaryenTableGetName(BinaryenTableRef table);
2449
- // Sets the name of the specified `Table`.
2450
- BINARYEN_API void BinaryenTableSetName(BinaryenTableRef table,
2451
- const char* name);
2452
- // Gets the initial number of pages of the specified `Table`.
2453
- BINARYEN_API BinaryenIndex BinaryenTableGetInitial(BinaryenTableRef table);
2454
- // Sets the initial number of pages of the specified `Table`.
2455
- BINARYEN_API void BinaryenTableSetInitial(BinaryenTableRef table,
2456
- BinaryenIndex initial);
2457
- // Tests whether the specified `Table` has a maximum number of pages.
2458
- BINARYEN_API bool BinaryenTableHasMax(BinaryenTableRef table);
2459
- // Gets the maximum number of pages of the specified `Table`.
2460
- BINARYEN_API BinaryenIndex BinaryenTableGetMax(BinaryenTableRef table);
2461
- // Sets the maximum number of pages of the specified `Table`.
2462
- BINARYEN_API void BinaryenTableSetMax(BinaryenTableRef table,
2463
- BinaryenIndex max);
2464
-
2465
- //
2466
- // ========== Elem Segment Operations ==========
2467
- //
2468
-
2469
- // Gets the name of the specified `ElementSegment`.
2470
- BINARYEN_API const char*
2471
- BinaryenElementSegmentGetName(BinaryenElementSegmentRef elem);
2472
- // Sets the name of the specified `ElementSegment`.
2473
- BINARYEN_API void BinaryenElementSegmentSetName(BinaryenElementSegmentRef elem,
2474
- const char* name);
2475
- // Gets the table name of the specified `ElementSegment`.
2476
- BINARYEN_API const char*
2477
- BinaryenElementSegmentGetTable(BinaryenElementSegmentRef elem);
2478
- // Sets the table name of the specified `ElementSegment`.
2479
- BINARYEN_API void BinaryenElementSegmentSetTable(BinaryenElementSegmentRef elem,
2480
- const char* table);
2481
- // Gets the segment offset in case of active segments
2482
- BINARYEN_API BinaryenExpressionRef
2483
- BinaryenElementSegmentGetOffset(BinaryenElementSegmentRef elem);
2484
- // Gets the length of items in the segment
2485
- BINARYEN_API BinaryenIndex
2486
- BinaryenElementSegmentGetLength(BinaryenElementSegmentRef elem);
2487
- // Gets the item at the specified index
2488
- BINARYEN_API const char*
2489
- BinaryenElementSegmentGetData(BinaryenElementSegmentRef elem,
2490
- BinaryenIndex dataId);
2491
- // Returns true if the specified elem segment is passive
2492
- BINARYEN_API bool
2493
- BinayenElementSegmentIsPassive(BinaryenElementSegmentRef elem);
2494
-
2495
- //
2496
- // ========== Global Operations ==========
2497
- //
2498
-
2499
- // Gets the name of the specified `Global`.
2500
- BINARYEN_API const char* BinaryenGlobalGetName(BinaryenGlobalRef global);
2501
- // Gets the name of the `GlobalType` associated with the specified `Global`. May
2502
- // be `NULL` if the signature is implicit.
2503
- BINARYEN_API BinaryenType BinaryenGlobalGetType(BinaryenGlobalRef global);
2504
- // Returns true if the specified `Global` is mutable.
2505
- BINARYEN_API bool BinaryenGlobalIsMutable(BinaryenGlobalRef global);
2506
- // Gets the initialization expression of the specified `Global`.
2507
- BINARYEN_API BinaryenExpressionRef
2508
- BinaryenGlobalGetInitExpr(BinaryenGlobalRef global);
2509
-
2510
- //
2511
- // ========== Event Operations ==========
2512
- //
2513
-
2514
- // Gets the name of the specified `Event`.
2515
- BINARYEN_API const char* BinaryenEventGetName(BinaryenEventRef event);
2516
- // Gets the attribute of the specified `Event`.
2517
- BINARYEN_API uint32_t BinaryenEventGetAttribute(BinaryenEventRef event);
2518
- // Gets the parameters type of the specified `Event`.
2519
- BINARYEN_API BinaryenType BinaryenEventGetParams(BinaryenEventRef event);
2520
- // Gets the results type of the specified `Event`.
2521
- BINARYEN_API BinaryenType BinaryenEventGetResults(BinaryenEventRef event);
2522
-
2523
- //
2524
- // ========== Import Operations ==========
2525
- //
2526
-
2527
- // Gets the external module name of the specified import.
2528
- BINARYEN_API const char*
2529
- BinaryenFunctionImportGetModule(BinaryenFunctionRef import);
2530
- BINARYEN_API const char* BinaryenTableImportGetModule(BinaryenTableRef import);
2531
- BINARYEN_API const char*
2532
- BinaryenGlobalImportGetModule(BinaryenGlobalRef import);
2533
- BINARYEN_API const char* BinaryenEventImportGetModule(BinaryenEventRef import);
2534
- // Gets the external base name of the specified import.
2535
- BINARYEN_API const char*
2536
- BinaryenFunctionImportGetBase(BinaryenFunctionRef import);
2537
- BINARYEN_API const char* BinaryenTableImportGetBase(BinaryenTableRef import);
2538
- BINARYEN_API const char* BinaryenGlobalImportGetBase(BinaryenGlobalRef import);
2539
- BINARYEN_API const char* BinaryenEventImportGetBase(BinaryenEventRef import);
2540
-
2541
- //
2542
- // ========== Export Operations ==========
2543
- //
2544
-
2545
- // Gets the external kind of the specified export.
2546
- BINARYEN_API BinaryenExternalKind
2547
- BinaryenExportGetKind(BinaryenExportRef export_);
2548
- // Gets the external name of the specified export.
2549
- BINARYEN_API const char* BinaryenExportGetName(BinaryenExportRef export_);
2550
- // Gets the internal name of the specified export.
2551
- BINARYEN_API const char* BinaryenExportGetValue(BinaryenExportRef export_);
2552
-
2553
- //
2554
- // ========= Custom sections =========
2555
- //
2556
-
2557
- BINARYEN_API void BinaryenAddCustomSection(BinaryenModuleRef module,
2558
- const char* name,
2559
- const char* contents,
2560
- BinaryenIndex contentsSize);
2561
-
2562
- //
2563
- // ========= Effect analyzer =========
2564
- //
2565
-
2566
- typedef uint32_t BinaryenSideEffects;
2567
-
2568
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectNone(void);
2569
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectBranches(void);
2570
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectCalls(void);
2571
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectReadsLocal(void);
2572
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectWritesLocal(void);
2573
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectReadsGlobal(void);
2574
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectWritesGlobal(void);
2575
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectReadsMemory(void);
2576
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectWritesMemory(void);
2577
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectImplicitTrap(void);
2578
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectIsAtomic(void);
2579
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectThrows(void);
2580
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectDanglingPop(void);
2581
- BINARYEN_API BinaryenSideEffects BinaryenSideEffectAny(void);
2582
-
2583
- BINARYEN_API BinaryenSideEffects BinaryenExpressionGetSideEffects(
2584
- BinaryenExpressionRef expr, BinaryenFeatures features);
2585
-
2586
- //
2587
- // ========== CFG / Relooper ==========
2588
- //
2589
- // General usage is (1) create a relooper, (2) create blocks, (3) add
2590
- // branches between them, (4) render the output.
2591
- //
2592
- // For more details, see src/cfg/Relooper.h and
2593
- // https://github.com/WebAssembly/binaryen/wiki/Compiling-to-WebAssembly-with-Binaryen#cfg-api
2594
-
2595
- #ifdef __cplusplus
2596
- namespace CFG {
2597
- struct Relooper;
2598
- struct Block;
2599
- } // namespace CFG
2600
- typedef struct CFG::Relooper* RelooperRef;
2601
- typedef struct CFG::Block* RelooperBlockRef;
2602
- #else
2603
- typedef struct Relooper* RelooperRef;
2604
- typedef struct RelooperBlock* RelooperBlockRef;
2605
- #endif
2606
-
2607
- // Create a relooper instance
2608
- BINARYEN_API RelooperRef RelooperCreate(BinaryenModuleRef module);
2609
-
2610
- // Create a basic block that ends with nothing, or with some simple branching
2611
- BINARYEN_API RelooperBlockRef RelooperAddBlock(RelooperRef relooper,
2612
- BinaryenExpressionRef code);
2613
-
2614
- // Create a branch to another basic block
2615
- // The branch can have code on it, that is executed as the branch happens. this
2616
- // is useful for phis. otherwise, code can be NULL
2617
- BINARYEN_API void RelooperAddBranch(RelooperBlockRef from,
2618
- RelooperBlockRef to,
2619
- BinaryenExpressionRef condition,
2620
- BinaryenExpressionRef code);
2621
-
2622
- // Create a basic block that ends a switch on a condition
2623
- BINARYEN_API RelooperBlockRef
2624
- RelooperAddBlockWithSwitch(RelooperRef relooper,
2625
- BinaryenExpressionRef code,
2626
- BinaryenExpressionRef condition);
2627
-
2628
- // Create a switch-style branch to another basic block. The block's switch table
2629
- // will have these indexes going to that target
2630
- BINARYEN_API void RelooperAddBranchForSwitch(RelooperBlockRef from,
2631
- RelooperBlockRef to,
2632
- BinaryenIndex* indexes,
2633
- BinaryenIndex numIndexes,
2634
- BinaryenExpressionRef code);
2635
-
2636
- // Generate structed wasm control flow from the CFG of blocks and branches that
2637
- // were created on this relooper instance. This returns the rendered output, and
2638
- // also disposes of the relooper and its blocks and branches, as they are no
2639
- // longer needed.
2640
- // @param labelHelper To render irreducible control flow, we may need a helper
2641
- // variable to guide us to the right target label. This value should be
2642
- // an index of an i32 local variable that is free for us to use.
2643
- BINARYEN_API BinaryenExpressionRef RelooperRenderAndDispose(
2644
- RelooperRef relooper, RelooperBlockRef entry, BinaryenIndex labelHelper);
2645
-
2646
- //
2647
- // ========= ExpressionRunner ==========
2648
- //
2649
-
2650
- #ifdef __cplusplus
2651
- namespace wasm {
2652
- class CExpressionRunner;
2653
- } // namespace wasm
2654
- typedef class wasm::CExpressionRunner* ExpressionRunnerRef;
2655
- #else
2656
- typedef struct CExpressionRunner* ExpressionRunnerRef;
2657
- #endif
2658
-
2659
- typedef uint32_t ExpressionRunnerFlags;
2660
-
2661
- // By default, just evaluate the expression, i.e. all we want to know is whether
2662
- // it computes down to a concrete value, where it is not necessary to preserve
2663
- // side effects like those of a `local.tee`.
2664
- BINARYEN_API ExpressionRunnerFlags ExpressionRunnerFlagsDefault();
2665
-
2666
- // Be very careful to preserve any side effects. For example, if we are
2667
- // intending to replace the expression with a constant afterwards, even if we
2668
- // can technically evaluate down to a constant, we still cannot replace the
2669
- // expression if it also sets a local, which must be preserved in this scenario
2670
- // so subsequent code keeps functioning.
2671
- BINARYEN_API ExpressionRunnerFlags ExpressionRunnerFlagsPreserveSideeffects();
2672
-
2673
- // Traverse through function calls, attempting to compute their concrete value.
2674
- // Must not be used in function-parallel scenarios, where the called function
2675
- // might be concurrently modified, leading to undefined behavior. Traversing
2676
- // another function reuses all of this runner's flags.
2677
- BINARYEN_API ExpressionRunnerFlags ExpressionRunnerFlagsTraverseCalls();
2678
-
2679
- // Creates an ExpressionRunner instance
2680
- BINARYEN_API ExpressionRunnerRef
2681
- ExpressionRunnerCreate(BinaryenModuleRef module,
2682
- ExpressionRunnerFlags flags,
2683
- BinaryenIndex maxDepth,
2684
- BinaryenIndex maxLoopIterations);
2685
-
2686
- // Sets a known local value to use. Order matters if expressions have side
2687
- // effects. For example, if the expression also sets a local, this side effect
2688
- // will also happen (not affected by any flags). Returns `true` if the
2689
- // expression actually evaluates to a constant.
2690
- BINARYEN_API bool ExpressionRunnerSetLocalValue(ExpressionRunnerRef runner,
2691
- BinaryenIndex index,
2692
- BinaryenExpressionRef value);
2693
-
2694
- // Sets a known global value to use. Order matters if expressions have side
2695
- // effects. For example, if the expression also sets a local, this side effect
2696
- // will also happen (not affected by any flags). Returns `true` if the
2697
- // expression actually evaluates to a constant.
2698
- BINARYEN_API bool ExpressionRunnerSetGlobalValue(ExpressionRunnerRef runner,
2699
- const char* name,
2700
- BinaryenExpressionRef value);
2701
-
2702
- // Runs the expression and returns the constant value expression it evaluates
2703
- // to, if any. Otherwise returns `NULL`. Also disposes the runner.
2704
- BINARYEN_API BinaryenExpressionRef ExpressionRunnerRunAndDispose(
2705
- ExpressionRunnerRef runner, BinaryenExpressionRef expr);
2706
-
2707
- //
2708
- // ========= Utilities =========
2709
- //
2710
-
2711
- // Enable or disable coloring for the Wasm printer
2712
- BINARYEN_API void BinaryenSetColorsEnabled(bool enabled);
2713
-
2714
- // Query whether color is enable for the Wasm printer
2715
- BINARYEN_API bool BinaryenAreColorsEnabled();
2716
- #ifdef __cplusplus
2717
- } // extern "C"
2718
- #endif
2719
-
2720
- #endif // wasm_binaryen_c_h