summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-17 12:40:21 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-17 12:40:21 -0400
commitd4639a7ab7971b2eea4951ec26062471bfec88d9 (patch)
treebf34083095099811f29010bde33b95fd1697b7ae /src/compiler.sml
parent1527e77c3c2c99fbb9fb832250a6cc00c06d70b0 (diff)
Proper topological sorting in untangle
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"