summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-07-03 18:06:52 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-07-03 18:06:52 -0400
commit8d4e252a0d4ac2c89805cd2785f79572cdfe7d82 (patch)
treeb40a8f79d41cd6fe1faebbca7aa44489fbaf0d42 /src/compiler.sml
parentb11edd2101e896dd0482715686712b67f00d3099 (diff)
Mono optimizations (start with string concat and space eating)
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 1b97e874..592191c8 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -215,13 +215,22 @@ fun monoize job =
else
SOME (Monoize.monoize CoreEnv.empty file)
-fun cloconv job =
+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 mono_opt job of
+ NONE => NONE
+ | SOME file =>
+ if ErrorMsg.anyErrors () then
+ NONE
+ else
SOME (Cloconv.cloconv file)
fun cjrize job =
@@ -304,6 +313,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 testCloconv job =
(case cloconv job of
NONE => print "Failed\n"