diff --git a/wasm/emit_wat.ml b/wasm/emit_wat.ml index 97ba38cea..b85044a89 100644 --- a/wasm/emit_wat.ml +++ b/wasm/emit_wat.ml @@ -2320,7 +2320,6 @@ module ToWasm = struct body in let _, typs = List.split body in - let exprs = [ C.tuple_make exprs ] in (exprs, List.map C.result typs) end | No_value body -> (conv_no_value body, []) diff --git a/wasm/wat.ml b/wasm/wat.ml index 74eb481c1..6415cb725 100644 --- a/wasm/wat.ml +++ b/wasm/wat.ml @@ -243,7 +243,7 @@ module C = struct let declare_func f = node "elem" [ atom "declare"; atom "func"; !$(Func_id.name f) ] - let rec type_atom (t : Type.atom) = + let type_atom (t : Type.atom) = match t with | I8 -> atom "i8" | I16 -> atom "i16" @@ -251,14 +251,6 @@ module C = struct | I64 -> atom "i64" | F64 -> atom "f64" | Rvar v -> reft v - | Tuple l -> node "tuple" (List.map type_atom l) - - let tuple_make fields = - match fields with - | [] -> assert false - | [ field ] -> field - | fields -> - node "tuple.make" (Atom (List.length fields |> string_of_int) :: fields ) let local l t = node "local" [ !$(Expr.Local.var_name l); type_atom t ] @@ -317,15 +309,12 @@ module C = struct nodehv "loop" [ !$(Block_id.name id); results result ] body let br id args = - match args with - | [] -> node "br" [ !$(Block_id.name id)] - | [arg] -> node "br" [ !$(Block_id.name id); arg ] - | _ -> node "br" [ !$(Block_id.name id); tuple_make args ] + node "br" ((!$(Block_id.name id)) :: args) let br' id = node "br" [ !$(Block_id.name id) ] let return args = - node "return" [ tuple_make args ] + node "return" args let br_on_cast id typ arg = node "br_on_cast" [ !$(Block_id.name id); type_name typ; arg ] @@ -357,8 +346,6 @@ module C = struct | None -> node "sub" [ descr ] | Some name -> node "sub" [ type_name name; descr ] - let opt_tuple fields = - [ tuple_make fields ] let rec_ l = node "rec" l diff --git a/wasm/wexpr.ml b/wasm/wexpr.ml index 408830269..db9ceb36b 100644 --- a/wasm/wexpr.ml +++ b/wasm/wexpr.ml @@ -339,20 +339,20 @@ let required_locals body = acc | exception Not_found -> Local.Map.add var typ acc in - let let_cont_reqs acc ~cont ~params = + let let_cont_reqs acc ~cont:_ ~params = let acc = List.fold_left (fun acc (var, typ) -> match var with None -> acc | Some var -> add var typ acc ) acc params in - let acc = - match ( params) with - | _ :: _ :: _ -> - let var = Local.Block_result cont in - add var (Type.Tuple (List.map snd params)) acc - | _ -> acc - in + (* let acc = *) + (* match ( params) with *) + (* | _ :: _ :: _ -> *) + (* let var = Local.Block_result cont in *) + (* add var (Type.Tuple (List.map snd params)) acc *) + (* | _ -> acc *) + (* in *) acc in let rec loop acc = function diff --git a/wasm/wtype.ml b/wasm/wtype.ml index e172b3d61..574d91368 100644 --- a/wasm/wtype.ml +++ b/wasm/wtype.ml @@ -92,7 +92,6 @@ type atom = | I64 | F64 | Rvar of Var.t - | Tuple of atom list type descr = | Struct of @@ -108,11 +107,10 @@ type descr = ; results : atom list } -let rec print_atom ppf = function +let print_atom ppf = function | I8 -> Format.fprintf ppf "i8" | I16 -> Format.fprintf ppf "i16" | I32 -> Format.fprintf ppf "i32" | I64 -> Format.fprintf ppf "i64" | F64 -> Format.fprintf ppf "f64" | Rvar v -> Format.fprintf ppf "ref_%a" Var.print v - | Tuple l -> Format.fprintf ppf "Tuple (%a)" (print_list print_atom " ") l