diff 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
line wrap: on
line diff
--- a/src/compiler.sml	Thu Jul 03 17:53:28 2008 -0400
+++ b/src/compiler.sml	Thu Jul 03 18:06:52 2008 -0400
@@ -215,8 +215,17 @@
         else
             SOME (Monoize.monoize CoreEnv.empty file)
 
+fun mono_opt job =
+    case monoize job of
+        NONE => NONE
+      | SOME file =>
+        if ErrorMsg.anyErrors () then
+            NONE
+        else
+            SOME (MonoOpt.optimize file)
+
 fun cloconv job =
-    case monoize job of
+    case mono_opt job of
         NONE => NONE
       | SOME file =>
         if ErrorMsg.anyErrors () then
@@ -304,6 +313,15 @@
     handle MonoEnv.UnboundNamed n =>
            print ("Unbound named " ^ Int.toString n ^ "\n")
 
+fun testMono_opt job =
+    (case mono_opt 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 testCloconv job =
     (case cloconv job of
          NONE => print "Failed\n"