summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-17 12:59:52 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-17 12:59:52 -0400
commit31b2c3d5e8740967ead001b40ca25f3ca3628da7 (patch)
treef53372fb289df90aba3485f6471596c6d861ec81 /src/compiler.sml
parentd4639a7ab7971b2eea4951ec26062471bfec88d9 (diff)
MonoReduce
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 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"