summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 77c8d202..e8d07f1c 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -232,13 +232,22 @@ fun monoize job =
else
SOME (Monoize.monoize CoreEnv.empty file)
-fun untangle job =
+fun mono_opt' job =
case monoize job of
NONE => NONE
| SOME file =>
if ErrorMsg.anyErrors () then
NONE
else
+ SOME (MonoOpt.optimize file)
+
+fun untangle job =
+ case mono_opt' job of
+ NONE => NONE
+ | SOME file =>
+ if ErrorMsg.anyErrors () then
+ NONE
+ else
SOME (Untangle.untangle file)
fun mono_opt job =
@@ -339,6 +348,15 @@ fun testMonoize job =
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 testUntangle job =
(case untangle job of
NONE => print "Failed\n"