From a0dd36d3721acc580461be8c968f6bdafc83827b Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 19 Jan 2014 13:08:01 -0500 Subject: New compiler option: -stop --- src/compiler.sml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/compiler.sml') 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)) -- cgit v1.2.3