Commit ee369db7 authored by Mário Pereira's avatar Mário Pereira

Extraction: avoid using ignore around a unit expression

parent 55ec50de
......@@ -266,7 +266,7 @@ module Translate = struct
| Elet (LDvar (pv, e1), e2)
when pv.pv_ghost || not (Mpv.mem pv e2.e_effect.eff_reads) ->
if eff_pure e1.e_effect then expr info svar mask e2
else let e1 = ML.e_ignore (expr info svar MaskGhost e1) in
else let e1 = ML.e_ignore e1.e_ity (expr info svar MaskGhost e1) in
ML.e_seq e1 (expr info svar mask e2) (ML.I e.e_ity) mask eff lbl
| Elet (LDvar (pv, e1), e2) ->
Debug.dprintf debug_compile "compiling local definition of %s@."
......
......@@ -308,11 +308,10 @@ let e_app rs pvl =
let e_fun args e = mk_expr (Efun (args, e))
let e_ignore e =
let e_ignore e_ity e =
(* TODO : avoid ignore around a unit type expresson *)
(* if is_unit e.e_ity then begin Format.eprintf "hit!@."; e end
* else *)
mk_expr (Eignore e) ity_unit MaskVisible e.e_effect e.e_label
if ity_equal e_ity Ity.ity_unit then e
else mk_expr (Eignore e) ity_unit MaskVisible e.e_effect e.e_label
let e_if e1 e2 e3 =
mk_expr (Eif (e1, e2, e3)) e2.e_ity
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment