summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2012-06-11 21:35:41 +0100
committerIan Lynagh <igloo@earth.li>2012-06-11 21:35:41 +0100
commit9d246714d9f3646030b2788030b503664707c46c (patch)
tree92934454880e00681743ae5a5b97b24990187e9a /compiler
parent310ded12b731e5700b4af739a080c3e23904b41e (diff)
downloadhaskell-9d246714d9f3646030b2788030b503664707c46c.tar.gz
Pass DynFlags down to hPrintDump
Diffstat (limited to 'compiler')
-rw-r--r--compiler/main/DynFlags.hs2
-rw-r--r--compiler/main/DynFlags.hs-boot4
-rw-r--r--compiler/main/ErrUtils.lhs2
-rw-r--r--compiler/utils/Outputable.lhs5
4 files changed, 9 insertions, 4 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index ccd0a75297..52982c1185 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -976,7 +976,7 @@ defaultLogAction :: LogAction
defaultLogAction dflags severity srcSpan style msg
= case severity of
SevOutput -> printSDoc msg style
- SevDump -> hPrintDump stdout msg
+ SevDump -> hPrintDump dflags stdout msg
SevInfo -> printErrs msg style
SevFatal -> printErrs msg style
_ -> do hPutChar stderr '\n'
diff --git a/compiler/main/DynFlags.hs-boot b/compiler/main/DynFlags.hs-boot
new file mode 100644
index 0000000000..f7d17f496b
--- /dev/null
+++ b/compiler/main/DynFlags.hs-boot
@@ -0,0 +1,4 @@
+
+module DynFlags where
+
+data DynFlags
diff --git a/compiler/main/ErrUtils.lhs b/compiler/main/ErrUtils.lhs
index eeb5e91c8a..c97ab2aef2 100644
--- a/compiler/main/ErrUtils.lhs
+++ b/compiler/main/ErrUtils.lhs
@@ -247,7 +247,7 @@ dumpSDoc dflags dflag hdr doc
writeIORef gdref (Set.insert fileName gd)
createDirectoryIfMissing True (takeDirectory fileName)
handle <- openFile fileName mode
- hPrintDump handle doc
+ hPrintDump dflags handle doc
hClose handle
-- write the dump to stdout
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs
index 5f4b1ff493..738b835537 100644
--- a/compiler/utils/Outputable.lhs
+++ b/compiler/utils/Outputable.lhs
@@ -71,6 +71,7 @@ module Outputable (
pprDebugAndThen,
) where
+import {-# SOURCE #-} DynFlags( DynFlags )
import {-# SOURCE #-} Module( Module, ModuleName, moduleName )
import {-# SOURCE #-} Name( Name, nameModule )
@@ -319,8 +320,8 @@ ifPprDebug d = SDoc $ \ctx ->
\end{code}
\begin{code}
-hPrintDump :: Handle -> SDoc -> IO ()
-hPrintDump h doc = do
+hPrintDump :: DynFlags -> Handle -> SDoc -> IO ()
+hPrintDump _ h doc = do
Pretty.printDoc PageMode h
(runSDoc better_doc (initSDocContext defaultDumpStyle))
hFlush h