Skip to content

feat!: Upgrade to Binaryen v121 #207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: oscar/120
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion esy.lock/index.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions src/expression.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,13 @@ caml_binaryen_binary(value _module, value _op, value _p1, value _p2) {
}

CAMLprim value
caml_binaryen_select(value _module, value _cond, value _tru, value _fals, value _ty) {
CAMLparam5(_module, _cond, _tru, _fals, _ty);
caml_binaryen_select(value _module, value _cond, value _tru, value _fals) {
CAMLparam4(_module, _cond, _tru, _fals);
BinaryenModuleRef module = BinaryenModuleRef_val(_module);
BinaryenExpressionRef cond = BinaryenExpressionRef_val(_cond);
BinaryenExpressionRef tru = BinaryenExpressionRef_val(_tru);
BinaryenExpressionRef fals = BinaryenExpressionRef_val(_fals);
BinaryenType ty = BinaryenType_val(_ty);
BinaryenExpressionRef exp = BinaryenSelect(module, cond, tru, fals, ty);
BinaryenExpressionRef exp = BinaryenSelect(module, cond, tru, fals);
CAMLreturn(alloc_BinaryenExpressionRef(exp));
}

Expand Down
4 changes: 2 additions & 2 deletions src/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@ function caml_binaryen_binary(wasm_mod, op, p1, p2) {
}

//Provides: caml_binaryen_select
function caml_binaryen_select(wasm_mod, cond, if_true, if_false, typ) {
return wasm_mod.select(cond, if_true, if_false, typ);
function caml_binaryen_select(wasm_mod, cond, if_true, if_false) {
return wasm_mod.select(cond, if_true, if_false);
}

//Provides: caml_binaryen_drop
Expand Down
4 changes: 2 additions & 2 deletions src/expression.ml
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,11 @@ module Binary = struct
end

module Select = struct
external make : Module.t -> t -> t -> t -> Type.t -> t
external make : Module.t -> t -> t -> t -> t
= "caml_binaryen_select"

(** Module, condition, true branch, false branch. *)
let make wasm_mod cond tru fals = make wasm_mod cond tru fals Type.auto
let make wasm_mod cond tru fals = make wasm_mod cond tru fals

external get_if_true : t -> t = "caml_binaryen_select_get_if_true"
external set_if_true : t -> t -> unit = "caml_binaryen_select_set_if_true"
Expand Down
8 changes: 0 additions & 8 deletions src/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ caml_binaryen_module_run_passes(value _module, value _passes) {
CAMLreturn(Val_unit);
}

CAMLprim value
caml_binaryen_module_auto_drop(value _module) {
CAMLparam1(_module);
BinaryenModuleRef module = BinaryenModuleRef_val(_module);
BinaryenModuleAutoDrop(module);
CAMLreturn(Val_unit);
}

CAMLprim value
caml_binaryen_module_write(value _module, value _sourceMapUrl) {
CAMLparam2(_module, _sourceMapUrl);
Expand Down
5 changes: 0 additions & 5 deletions src/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ function caml_binaryen_module_run_passes(wasm_mod, passes) {
);
}

//Provides: caml_binaryen_module_auto_drop
function caml_binaryen_module_auto_drop(wasm_mod) {
return wasm_mod.autoDrop();
}

//Provides: caml_binaryen_module_write
//Requires: to_option
//Requires: caml_jsstring_of_string, caml_string_of_jsstring, caml_bytes_of_array
Expand Down
2 changes: 0 additions & 2 deletions src/module.ml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,6 @@ let set_features wasm_mod features =
external run_passes : t -> Passes.t list -> unit
= "caml_binaryen_module_run_passes"

external auto_drop : t -> unit = "caml_binaryen_module_auto_drop"

external write : t -> string option -> bytes * string option
= "caml_binaryen_module_write"

Expand Down
1 change: 0 additions & 1 deletion src/module.mli
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ val optimize : t -> unit
val get_features : t -> Feature.t list
val set_features : t -> Feature.t list -> unit
val run_passes : t -> Passes.t list -> unit
val auto_drop : t -> unit
val write : t -> string option -> bytes * string option
val write_text : t -> string
val write_stack_ir : t -> string
Expand Down
Loading