comparison 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
comparison
equal deleted inserted replaced
339:075b36dbb1a4 340:5ccb1c6412e4
299 EQuery {exps = exps, tables = tables, query = query, 299 EQuery {exps = exps, tables = tables, query = query,
300 state = (TRecord [], loc), 300 state = (TRecord [], loc),
301 initial = (ERecord [], loc), 301 initial = (ERecord [], loc),
302 body = (optExp (EWrite e', loc), loc)} 302 body = (optExp (EWrite e', loc), loc)}
303 303
304 | EWrite (ELet (x, t, e1, e2), loc) =>
305 optExp (ELet (x, t, e1, (EWrite e2, loc)), loc)
306
304 | _ => e 307 | _ => e
305 308
306 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e) 309 and optExp e = #1 (U.Exp.map {typ = typ, exp = exp} e)
307 310
308 val optimize = U.File.map {typ = typ, exp = exp, decl = decl} 311 val optimize = U.File.map {typ = typ, exp = exp, decl = decl}