changeset 340:5ccb1c6412e4

Push writes inside lets
author Adam Chlipala <adamc@hcoop.net>
date Sun, 14 Sep 2008 15:20:53 -0400
parents 075b36dbb1a4
children 389399d65331
files src/mono_opt.sml
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/mono_opt.sml	Sun Sep 14 15:10:04 2008 -0400
+++ b/src/mono_opt.sml	Sun Sep 14 15:20:53 2008 -0400
@@ -301,6 +301,9 @@
                 initial = (ERecord [], loc),
                 body = (optExp (EWrite e', loc), loc)}
 
+      | EWrite (ELet (x, t, e1, e2), loc) =>
+        optExp (ELet (x, t, e1, (EWrite e2, loc)), loc)
+
       | _ => e
 
 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e)