summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-17 12:19:44 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-17 12:19:44 -0400
commit1527e77c3c2c99fbb9fb832250a6cc00c06d70b0 (patch)
treefd4a0b102dcd522d169c716f72d4f16971ddeada /src/compiler.sml
parentd5fd0e7403767670197f0422c99ba62176323624 (diff)
Untangle
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 7ef8b646..77c8d202 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -232,13 +232,22 @@ fun monoize job =
else
SOME (Monoize.monoize CoreEnv.empty file)
-fun mono_opt job =
+fun untangle job =
case monoize job of
NONE => NONE
| SOME file =>
if ErrorMsg.anyErrors () then
NONE
else
+ SOME (Untangle.untangle file)
+
+fun mono_opt job =
+ case untangle job of
+ NONE => NONE
+ | SOME file =>
+ if ErrorMsg.anyErrors () then
+ NONE
+ else
SOME (MonoOpt.optimize file)
fun cjrize job =
@@ -304,7 +313,7 @@ fun testTag job =
print ("Unbound named " ^ Int.toString n ^ "\n")
fun testReduce job =
- (case reduce job of
+ (case tag job of
NONE => print "Failed\n"
| SOME file =>
(Print.print (CorePrint.p_file CoreEnv.empty file);
@@ -330,6 +339,15 @@ fun testMonoize job =
handle MonoEnv.UnboundNamed n =>
print ("Unbound named " ^ Int.toString n ^ "\n")
+fun testUntangle job =
+ (case untangle 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"