summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler.sml b/src/compiler.sml
index 0ffab01c..21ae903f 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -86,6 +86,9 @@ val doIflow = ref false
val doDumpSource = ref (fn () => ())
+val stop = ref (NONE : string option)
+fun setStop s = stop := SOME s
+
fun transform (ph : ('src, 'dst) phase) name = {
func = fn input => let
val () = if !debug then
@@ -102,6 +105,10 @@ fun transform (ph : ('src, 'dst) phase) name = {
(!doDumpSource ();
doDumpSource := (fn () => ());
NONE)
+ else if !stop = SOME name then
+ (Print.eprint (#print ph v);
+ ErrorMsg.error ("Stopped compilation after phase " ^ name);
+ NONE)
else
(if !dumpSource then
doDumpSource := (fn () => Print.eprint (#print ph v))