diff options
author | Adam Chlipala <adam@chlipala.net> | 2014-01-19 13:08:01 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2014-01-19 13:08:01 -0500 |
commit | a0dd36d3721acc580461be8c968f6bdafc83827b (patch) | |
tree | 2892a610e83d5eb8212bf62f191746f807b4e2fa /src/compiler.sml | |
parent | 6787b686afe5fd3e65b3d377d4c363b4cd086dad (diff) |
New compiler option: -stop
Diffstat (limited to 'src/compiler.sml')
-rw-r--r-- | src/compiler.sml | 7 |
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)) |