summaryrefslogtreecommitdiff
path: root/src/bytecode_util.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytecode_util.ml')
-rw-r--r--src/bytecode_util.ml27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/bytecode_util.ml b/src/bytecode_util.ml
index 139763b1..5f2ec7ae 100644
--- a/src/bytecode_util.ml
+++ b/src/bytecode_util.ml
@@ -82,9 +82,6 @@ let iextern ?loc:(l=Parse_ast.Unknown) clexp id cvals ctyp =
let icopy ?loc:(l=Parse_ast.Unknown) clexp cval =
I_aux (I_copy (clexp, cval), (instr_number (), l))
-let iconvert ?loc:(l=Parse_ast.Unknown) clexp ctyp1 id ctyp2 =
- I_aux (I_convert (clexp, ctyp1, id, ctyp2), (instr_number (), l))
-
let iclear ?loc:(l=Parse_ast.Unknown) ctyp id =
I_aux (I_clear (ctyp, id), (instr_number (), l))
@@ -203,11 +200,11 @@ let pp_cval (frag, ctyp) =
string (string_of_fragment ~zencode:false frag) ^^ string " : " ^^ pp_ctyp ctyp
let rec pp_clexp = function
- | CL_id id -> pp_id id
- | CL_field (id, field) -> pp_id id ^^ string "." ^^ string field
- | CL_addr id -> string "*" ^^ pp_id id
- | CL_addr_field (id, field) -> pp_id id ^^ string "->" ^^ string field
- | CL_current_exception -> string "current_exception"
+ | CL_id (id, ctyp) -> pp_id id ^^ string " : " ^^ pp_ctyp ctyp
+ | CL_field (id, field, ctyp) -> pp_id id ^^ string "." ^^ string field ^^ string " : " ^^ pp_ctyp ctyp
+ | CL_addr (id, ctyp) -> string "*" ^^ pp_id id ^^ string " : " ^^ pp_ctyp ctyp
+ | CL_addr_field (id, field, ctyp) -> pp_id id ^^ string "->" ^^ string field ^^ string " : " ^^ pp_ctyp ctyp
+ | CL_current_exception _ -> string "current_exception"
| CL_have_exception -> string "have_exception"
let rec pp_instr ?short:(short=false) (I_aux (instr, aux)) =
@@ -242,9 +239,6 @@ let rec pp_instr ?short:(short=false) (I_aux (instr, aux)) =
separate space [ pp_clexp x; string "=";
string (string_of_id f |> Util.green |> Util.clear) ^^ parens (separate_map (string ", ") pp_cval args);
string ":"; pp_ctyp ctyp2 ]
- | I_convert (x, ctyp1, y, ctyp2) ->
- separate space [ pp_clexp x; colon; pp_ctyp ctyp1; string "=";
- pp_keyword "convert" ^^ pp_id y; colon; pp_ctyp ctyp2 ]
| I_copy (clexp, cval) ->
separate space [pp_clexp clexp; string "="; pp_cval cval]
| I_clear (ctyp, id) ->
@@ -355,12 +349,12 @@ let rec fragment_deps = function
let cval_deps = function (frag, _) -> fragment_deps frag
let rec clexp_deps = function
- | CL_id id -> NS.singleton (G_id id)
- | CL_field (id, _) -> NS.singleton (G_id id)
- | CL_addr id -> NS.singleton (G_id id)
- | CL_addr_field (id, _) -> NS.singleton (G_id id)
+ | CL_id (id, _) -> NS.singleton (G_id id)
+ | CL_field (id, _, _) -> NS.singleton (G_id id)
+ | CL_addr (id, _) -> NS.singleton (G_id id)
+ | CL_addr_field (id, _, _) -> NS.singleton (G_id id)
| CL_have_exception -> NS.empty
- | CL_current_exception -> NS.empty
+ | CL_current_exception _ -> NS.empty
(** Return the direct, non program-order dependencies of a single
instruction **)
@@ -371,7 +365,6 @@ let instr_deps = function
| I_if (cval, _, _, _) -> cval_deps cval, NS.empty
| I_jump (cval, label) -> cval_deps cval, NS.singleton (G_label label)
| I_funcall (clexp, _, _, cvals, _) -> List.fold_left NS.union NS.empty (List.map cval_deps cvals), clexp_deps clexp
- | I_convert (clexp, _, id, _) -> NS.singleton (G_id id), clexp_deps clexp
| I_copy (clexp, cval) -> cval_deps cval, clexp_deps clexp
| I_clear (_, id) -> NS.singleton (G_id id), NS.singleton (G_id id)
| I_throw cval | I_return cval -> cval_deps cval, NS.empty