summaryrefslogtreecommitdiff
path: root/compiler/GHC/Stg
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/Stg
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/Stg')
-rw-r--r--compiler/GHC/Stg/Pipeline.hs3
-rw-r--r--compiler/GHC/Stg/Subst.hs3
2 files changed, 2 insertions, 4 deletions
diff --git a/compiler/GHC/Stg/Pipeline.hs b/compiler/GHC/Stg/Pipeline.hs
index 5754b23baa..57996cbffa 100644
--- a/compiler/GHC/Stg/Pipeline.hs
+++ b/compiler/GHC/Stg/Pipeline.hs
@@ -28,7 +28,6 @@ import GHC.Driver.Session
import GHC.Utils.Error
import GHC.Types.Unique.Supply
import GHC.Utils.Outputable
-import GHC.Utils.Panic
import GHC.Utils.Logger
import Control.Monad
import Control.Monad.IO.Class
@@ -86,7 +85,7 @@ stg2stg logger dflags ictxt this_mod binds
return binds
StgStats ->
- trace (showStgStats binds) (return binds)
+ logTraceMsg logger "STG stats" (text (showStgStats binds)) (return binds)
StgCSE -> do
let binds' = {-# SCC "StgCse" #-} stgCse binds
diff --git a/compiler/GHC/Stg/Subst.hs b/compiler/GHC/Stg/Subst.hs
index d47107bb35..487b8b8adc 100644
--- a/compiler/GHC/Stg/Subst.hs
+++ b/compiler/GHC/Stg/Subst.hs
@@ -11,8 +11,7 @@ import GHC.Utils.Monad.State.Strict
import GHC.Utils.Outputable
import GHC.Utils.Misc
import GHC.Utils.Panic
-
-import GHC.Driver.Ppr
+import GHC.Utils.Trace
-- | A renaming substitution from 'Id's to 'Id's. Like 'RnEnv2', but not
-- maintaining pairs of substitutions. Like 'GHC.Core.Subst.Subst', but