diff src/mono_opt.sml @ 340:5ccb1c6412e4

Push writes inside lets
author Adam Chlipala <adamc@hcoop.net>
date Sun, 14 Sep 2008 15:20:53 -0400
parents 9601c717d2f3
children 024478c34f4d
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)