diff options
author | Adam Chlipala <adam@chlipala.net> | 2012-01-12 20:37:39 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2012-01-12 20:37:39 -0500 |
commit | 82137590b9de8f10a6b0245cc881019baccd5340 (patch) | |
tree | 4345b88e3ae93a675e27dffbe3a5b9a44499a74b /src/compiler.sml | |
parent | 772ca6347af9fdc871524a0436c759d313e90ff7 (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.sml | 15 |
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 |