diff options
Diffstat (limited to 'src/compiler.sml')
-rw-r--r-- | src/compiler.sml | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/compiler.sml b/src/compiler.sml index e8d07f1c..fb4c8f02 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -250,13 +250,22 @@ fun untangle job = else SOME (Untangle.untangle file) -fun mono_opt job = +fun mono_reduce job = case untangle job of NONE => NONE | SOME file => if ErrorMsg.anyErrors () then NONE else + SOME (MonoReduce.reduce file) + +fun mono_opt job = + case mono_reduce job of + NONE => NONE + | SOME file => + if ErrorMsg.anyErrors () then + NONE + else SOME (MonoOpt.optimize file) fun cjrize job = @@ -366,6 +375,15 @@ fun testUntangle job = handle MonoEnv.UnboundNamed n => print ("Unbound named " ^ Int.toString n ^ "\n") +fun testMono_reduce job = + (case mono_reduce job of + NONE => print "Failed\n" + | SOME file => + (Print.print (MonoPrint.p_file MonoEnv.empty file); + print "\n")) + handle MonoEnv.UnboundNamed n => + print ("Unbound named " ^ Int.toString n ^ "\n") + fun testMono_opt job = (case mono_opt job of NONE => print "Failed\n" |