comparison src/compiler.sml @ 132:25b28625d4df

Proper topological sorting in untangle
author Adam Chlipala <adamc@hcoop.net>
date Thu, 17 Jul 2008 12:40:21 -0400
parents 5df655503288
children 55d8cfa4d024
comparison
equal deleted inserted replaced
131:5df655503288 132:25b28625d4df
230 if ErrorMsg.anyErrors () then 230 if ErrorMsg.anyErrors () then
231 NONE 231 NONE
232 else 232 else
233 SOME (Monoize.monoize CoreEnv.empty file) 233 SOME (Monoize.monoize CoreEnv.empty file)
234 234
235 fun mono_opt' job =
236 case monoize job of
237 NONE => NONE
238 | SOME file =>
239 if ErrorMsg.anyErrors () then
240 NONE
241 else
242 SOME (MonoOpt.optimize file)
243
235 fun untangle job = 244 fun untangle job =
236 case monoize job of 245 case mono_opt' job of
237 NONE => NONE 246 NONE => NONE
238 | SOME file => 247 | SOME file =>
239 if ErrorMsg.anyErrors () then 248 if ErrorMsg.anyErrors () then
240 NONE 249 NONE
241 else 250 else
330 handle CoreEnv.UnboundNamed n => 339 handle CoreEnv.UnboundNamed n =>
331 print ("Unbound named " ^ Int.toString n ^ "\n") 340 print ("Unbound named " ^ Int.toString n ^ "\n")
332 341
333 fun testMonoize job = 342 fun testMonoize job =
334 (case monoize job of 343 (case monoize job of
344 NONE => print "Failed\n"
345 | SOME file =>
346 (Print.print (MonoPrint.p_file MonoEnv.empty file);
347 print "\n"))
348 handle MonoEnv.UnboundNamed n =>
349 print ("Unbound named " ^ Int.toString n ^ "\n")
350
351 fun testMono_opt' job =
352 (case mono_opt' job of
335 NONE => print "Failed\n" 353 NONE => print "Failed\n"
336 | SOME file => 354 | SOME file =>
337 (Print.print (MonoPrint.p_file MonoEnv.empty file); 355 (Print.print (MonoPrint.p_file MonoEnv.empty file);
338 print "\n")) 356 print "\n"))
339 handle MonoEnv.UnboundNamed n => 357 handle MonoEnv.UnboundNamed n =>