summaryrefslogtreecommitdiff
path: root/compiler/GHC/StgToCmm/Bind.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/StgToCmm/Bind.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/StgToCmm/Bind.hs')
-rw-r--r--compiler/GHC/StgToCmm/Bind.hs26
1 files changed, 16 insertions, 10 deletions
diff --git a/compiler/GHC/StgToCmm/Bind.hs b/compiler/GHC/StgToCmm/Bind.hs
index 13b07c2dd2..7d89b71309 100644
--- a/compiler/GHC/StgToCmm/Bind.hs
+++ b/compiler/GHC/StgToCmm/Bind.hs
@@ -15,6 +15,14 @@ module GHC.StgToCmm.Bind (
import GHC.Prelude hiding ((<*>))
+import GHC.Driver.Session
+
+import GHC.Core ( AltCon(..) )
+import GHC.Runtime.Heap.Layout
+import GHC.Unit.Module
+
+import GHC.Stg.Syntax
+
import GHC.Platform
import GHC.Platform.Profile
@@ -32,29 +40,26 @@ import GHC.StgToCmm.Closure
import GHC.StgToCmm.Foreign (emitPrimCall)
import GHC.Cmm.Graph
-import GHC.Core ( AltCon(..) )
import GHC.Cmm.BlockId
-import GHC.Runtime.Heap.Layout
import GHC.Cmm
import GHC.Cmm.Info
import GHC.Cmm.Utils
import GHC.Cmm.CLabel
-import GHC.Stg.Syntax
+
import GHC.Types.CostCentre
import GHC.Types.Id
import GHC.Types.Id.Info
import GHC.Types.Name
-import GHC.Unit.Module
-import GHC.Data.List.SetOps
-import GHC.Utils.Misc
import GHC.Types.Var.Set
import GHC.Types.Basic
import GHC.Types.Tickish ( tickishIsCode )
+
+import GHC.Utils.Misc
import GHC.Utils.Outputable
import GHC.Utils.Panic
+
import GHC.Data.FastString
-import GHC.Driver.Session
-import GHC.Driver.Ppr
+import GHC.Data.List.SetOps
import Control.Monad
@@ -764,9 +769,10 @@ closureDescription
-- Not called for StgRhsCon which have global info tables built in
-- CgConTbls.hs with a description generated from the data constructor
closureDescription dflags mod_name name
- = showSDocDump (initSDocContext dflags defaultDumpStyle) (char '<' <>
+ = let ctx = initSDocContext dflags defaultDumpStyle
+ -- defaultDumpStyle, because we want to see the unique on the Name.
+ in renderWithContext ctx (char '<' <>
(if isExternalName name
then ppr name -- ppr will include the module name prefix
else pprModule mod_name <> char '.' <> ppr name) <>
char '>')
- -- showSDocDump, because we want to see the unique on the Name.