Skip to content

Commit d9640c0

Browse files
committed
feat!: Upgrade to Binaryen v121
1 parent 4d69831 commit d9640c0

File tree

10 files changed

+15
-32
lines changed

10 files changed

+15
-32
lines changed

binaryen.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ depends: [
1616
"dune" {>= "3.0.0"}
1717
"dune-configurator" {>= "3.0.0"}
1818
"js_of_ocaml-compiler" {>= "6.0.0" < "7.0.0"}
19-
"libbinaryen" {> "120.0.0" < "121.0.0"}
19+
"libbinaryen" {> "121.0.0" < "122.0.0"}
2020
]
2121
x-maintenance-intent: ["0.(latest)"]

esy.lock/index.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "Apache-2.0",
77
"dependencies": {
88
"ocaml": ">= 4.13.0 < 5.4.0",
9-
"@grain/libbinaryen": "120.0.0-b",
9+
"@grain/libbinaryen": "121.0.0-b",
1010
"@opam/dune": ">= 3.0.0",
1111
"@opam/dune-configurator": ">= 3.0.0"
1212
},

src/expression.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,13 @@ caml_binaryen_binary(value _module, value _op, value _p1, value _p2) {
285285
}
286286

287287
CAMLprim value
288-
caml_binaryen_select(value _module, value _cond, value _tru, value _fals, value _ty) {
289-
CAMLparam5(_module, _cond, _tru, _fals, _ty);
288+
caml_binaryen_select(value _module, value _cond, value _tru, value _fals) {
289+
CAMLparam4(_module, _cond, _tru, _fals);
290290
BinaryenModuleRef module = BinaryenModuleRef_val(_module);
291291
BinaryenExpressionRef cond = BinaryenExpressionRef_val(_cond);
292292
BinaryenExpressionRef tru = BinaryenExpressionRef_val(_tru);
293293
BinaryenExpressionRef fals = BinaryenExpressionRef_val(_fals);
294-
BinaryenType ty = BinaryenType_val(_ty);
295-
BinaryenExpressionRef exp = BinaryenSelect(module, cond, tru, fals, ty);
294+
BinaryenExpressionRef exp = BinaryenSelect(module, cond, tru, fals);
296295
CAMLreturn(alloc_BinaryenExpressionRef(exp));
297296
}
298297

src/expression.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,8 @@ function caml_binaryen_binary(wasm_mod, op, p1, p2) {
403403
}
404404

405405
//Provides: caml_binaryen_select
406-
function caml_binaryen_select(wasm_mod, cond, if_true, if_false, typ) {
407-
return wasm_mod.select(cond, if_true, if_false, typ);
406+
function caml_binaryen_select(wasm_mod, cond, if_true, if_false) {
407+
return wasm_mod.select(cond, if_true, if_false);
408408
}
409409

410410
//Provides: caml_binaryen_drop

src/expression.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -662,11 +662,11 @@ module Binary = struct
662662
end
663663

664664
module Select = struct
665-
external make : Module.t -> t -> t -> t -> Type.t -> t
665+
external make : Module.t -> t -> t -> t -> t
666666
= "caml_binaryen_select"
667667

668668
(** Module, condition, true branch, false branch. *)
669-
let make wasm_mod cond tru fals = make wasm_mod cond tru fals Type.auto
669+
let make wasm_mod cond tru fals = make wasm_mod cond tru fals
670670

671671
external get_if_true : t -> t = "caml_binaryen_select_get_if_true"
672672
external set_if_true : t -> t -> unit = "caml_binaryen_select_set_if_true"

src/module.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,6 @@ caml_binaryen_module_run_passes(value _module, value _passes) {
7878
CAMLreturn(Val_unit);
7979
}
8080

81-
CAMLprim value
82-
caml_binaryen_module_auto_drop(value _module) {
83-
CAMLparam1(_module);
84-
BinaryenModuleRef module = BinaryenModuleRef_val(_module);
85-
BinaryenModuleAutoDrop(module);
86-
CAMLreturn(Val_unit);
87-
}
88-
8981
CAMLprim value
9082
caml_binaryen_module_write(value _module, value _sourceMapUrl) {
9183
CAMLparam2(_module, _sourceMapUrl);

src/module.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,6 @@ function caml_binaryen_module_run_passes(wasm_mod, passes) {
6767
);
6868
}
6969

70-
//Provides: caml_binaryen_module_auto_drop
71-
function caml_binaryen_module_auto_drop(wasm_mod) {
72-
return wasm_mod.autoDrop();
73-
}
74-
7570
//Provides: caml_binaryen_module_write
7671
//Requires: to_option
7772
//Requires: caml_jsstring_of_string, caml_string_of_jsstring, caml_bytes_of_array

src/module.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ let set_features wasm_mod features =
115115
external run_passes : t -> Passes.t list -> unit
116116
= "caml_binaryen_module_run_passes"
117117

118-
external auto_drop : t -> unit = "caml_binaryen_module_auto_drop"
119-
120118
external write : t -> string option -> bytes * string option
121119
= "caml_binaryen_module_write"
122120

src/module.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ val optimize : t -> unit
3535
val get_features : t -> Feature.t list
3636
val set_features : t -> Feature.t list -> unit
3737
val run_passes : t -> Passes.t list -> unit
38-
val auto_drop : t -> unit
3938
val write : t -> string option -> bytes * string option
4039
val write_text : t -> string
4140
val write_stack_ir : t -> string

0 commit comments

Comments
 (0)