Mercurial > urweb
comparison src/compiler.sml @ 96:82aaa1c406d3
Mono optimizations (start with string concat and space eating)
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 03 Jul 2008 18:06:52 -0400 |
parents | d3cc191cb25f |
children | 5f04adf47f48 |
comparison
equal
deleted
inserted
replaced
95:274116d1a4cd | 96:82aaa1c406d3 |
---|---|
213 if ErrorMsg.anyErrors () then | 213 if ErrorMsg.anyErrors () then |
214 NONE | 214 NONE |
215 else | 215 else |
216 SOME (Monoize.monoize CoreEnv.empty file) | 216 SOME (Monoize.monoize CoreEnv.empty file) |
217 | 217 |
218 fun mono_opt job = | |
219 case monoize job of | |
220 NONE => NONE | |
221 | SOME file => | |
222 if ErrorMsg.anyErrors () then | |
223 NONE | |
224 else | |
225 SOME (MonoOpt.optimize file) | |
226 | |
218 fun cloconv job = | 227 fun cloconv job = |
219 case monoize job of | 228 case mono_opt job of |
220 NONE => NONE | 229 NONE => NONE |
221 | SOME file => | 230 | SOME file => |
222 if ErrorMsg.anyErrors () then | 231 if ErrorMsg.anyErrors () then |
223 NONE | 232 NONE |
224 else | 233 else |
295 handle CoreEnv.UnboundNamed n => | 304 handle CoreEnv.UnboundNamed n => |
296 print ("Unbound named " ^ Int.toString n ^ "\n") | 305 print ("Unbound named " ^ Int.toString n ^ "\n") |
297 | 306 |
298 fun testMonoize job = | 307 fun testMonoize job = |
299 (case monoize job of | 308 (case monoize job of |
309 NONE => print "Failed\n" | |
310 | SOME file => | |
311 (Print.print (MonoPrint.p_file MonoEnv.empty file); | |
312 print "\n")) | |
313 handle MonoEnv.UnboundNamed n => | |
314 print ("Unbound named " ^ Int.toString n ^ "\n") | |
315 | |
316 fun testMono_opt job = | |
317 (case mono_opt job of | |
300 NONE => print "Failed\n" | 318 NONE => print "Failed\n" |
301 | SOME file => | 319 | SOME file => |
302 (Print.print (MonoPrint.p_file MonoEnv.empty file); | 320 (Print.print (MonoPrint.p_file MonoEnv.empty file); |
303 print "\n")) | 321 print "\n")) |
304 handle MonoEnv.UnboundNamed n => | 322 handle MonoEnv.UnboundNamed n => |