summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/CodeOutput.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2021-06-02 15:04:51 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-22 02:33:38 -0400
commit14956cb89d8548e531c99821ad504b4f35b5509a (patch)
tree175622c7f73df41c1e836be30a27c83914374ed6 /compiler/GHC/Driver/CodeOutput.hs
parent65bad0de6fd1431f0670002d68974adce3e9fc4a (diff)
downloadhaskell-14956cb89d8548e531c99821ad504b4f35b5509a.tar.gz
Put tracing functions into their own module
Now that Outputable is independent of DynFlags, we can put tracing functions using SDocs into their own module that doesn't transitively depend on any GHC.Driver.* module. A few modules needed to be moved to avoid loops in DEBUG mode.
Diffstat (limited to 'compiler/GHC/Driver/CodeOutput.hs')
-rw-r--r--compiler/GHC/Driver/CodeOutput.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/GHC/Driver/CodeOutput.hs b/compiler/GHC/Driver/CodeOutput.hs
index 7c9c08e4c1..e0b8879fd9 100644
--- a/compiler/GHC/Driver/CodeOutput.hs
+++ b/compiler/GHC/Driver/CodeOutput.hs
@@ -43,6 +43,7 @@ import GHC.Utils.Outputable
import GHC.Utils.Panic
import GHC.Utils.Logger
import GHC.Utils.Exception (bracket)
+import GHC.Utils.Ppr (Mode(..))
import GHC.Unit
import GHC.Unit.State
@@ -148,7 +149,8 @@ outputC logger dflags filenm cmm_stream packages =
"C backend output"
FormatC
doc
- printForC dflags h doc
+ let ctx = initSDocContext dflags (PprCode CStyle)
+ printSDocLn ctx LeftMode h doc
Stream.consume cmm_stream id writeC
{-