summaryrefslogtreecommitdiff
path: root/compiler/main/ErrUtils.lhs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-06-05 14:09:53 +0100
committerIan Lynagh <igloo@earth.li>2011-06-05 17:32:06 +0100
commit86add45dbfb6f962b65e371143dd467ae783f9e7 (patch)
tree56c30ccd064c4090a4197e7d9bd798b70f6b2ffe /compiler/main/ErrUtils.lhs
parenta853ec4c2033826e6e94817d6cdf9564dc17fb3e (diff)
downloadhaskell-86add45dbfb6f962b65e371143dd467ae783f9e7.tar.gz
Make dumpIfSet_dyn_or use dumpSDoc
This means that for example ghc -ddump-simpl -ddump-to-file ... now puts the simpl output in a file, rather htan sending it to stdout.
Diffstat (limited to 'compiler/main/ErrUtils.lhs')
-rw-r--r--compiler/main/ErrUtils.lhs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/main/ErrUtils.lhs b/compiler/main/ErrUtils.lhs
index 1c7a389f35..a0a9f0e3b3 100644
--- a/compiler/main/ErrUtils.lhs
+++ b/compiler/main/ErrUtils.lhs
@@ -190,11 +190,11 @@ dumpIfSet_dyn dflags flag hdr doc
= return ()
dumpIfSet_dyn_or :: DynFlags -> [DynFlag] -> String -> SDoc -> IO ()
-dumpIfSet_dyn_or dflags flags hdr doc
- | or [dopt flag dflags | flag <- flags]
- || verbosity dflags >= 4
- = printDump (mkDumpDoc hdr doc)
- | otherwise = return ()
+dumpIfSet_dyn_or _ [] _ _ = return ()
+dumpIfSet_dyn_or dflags (flag : flags) hdr doc
+ = if dopt flag dflags || verbosity dflags >= 4
+ then dumpSDoc dflags flag hdr doc
+ else dumpIfSet_dyn_or dflags flags hdr doc
mkDumpDoc :: String -> SDoc -> SDoc
mkDumpDoc hdr doc