aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2012-01-12 20:37:39 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2012-01-12 20:37:39 -0500
commita3f5a3a95ee01e9d27933ca5c1c755ceb9dac1af (patch)
tree4345b88e3ae93a675e27dffbe3a5b9a44499a74b /src/compiler.sml
parent7f9f5b2409507d7b84f15737be1f4ce185e4cda6 (diff)
-dumpSource flag; Especialize tweak: may specialize any argument sequence ending in a value of function-containing type
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 57c3e1ff..8ee86947 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -1,4 +1,4 @@
-(* Copyright (c) 2008-2011, Adam Chlipala
+(* Copyright (c) 2008-2012, Adam Chlipala
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -79,8 +79,11 @@ type ('src, 'dst) transform = {
}
val debug = ref false
+val dumpSource = ref false
val doIflow = ref false
+val doDumpSource = ref (fn () => ())
+
fun transform (ph : ('src, 'dst) phase) name = {
func = fn input => let
val () = if !debug then
@@ -94,9 +97,15 @@ fun transform (ph : ('src, 'dst) phase) name = {
else
();
if ErrorMsg.anyErrors () then
- NONE
+ (!doDumpSource ();
+ doDumpSource := (fn () => ());
+ NONE)
else
- SOME v
+ (if !dumpSource then
+ doDumpSource := (fn () => Print.eprint (#print ph v))
+ else
+ ();
+ SOME v)
end,
print = #print ph,
time = fn (input, pmap) => let