diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2020-06-01 12:18:56 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-07-21 06:39:33 -0400 |
commit | 30caeee75193ea961c55ee847a3156e23116e84e (patch) | |
tree | 3f6e0a8238c1fb631f476b15b29c0a3cef4ca9ba /compiler/GHC/Stg/Pipeline.hs | |
parent | 0dd405529f0f17cd9a5b299e7ae5539a885b4b5a (diff) | |
download | haskell-30caeee75193ea961c55ee847a3156e23116e84e.tar.gz |
DynFlags: remove use of sdocWithDynFlags from GHC.Stg.* (#17957)
* add StgPprOpts datatype
* remove Outputable instances for types that need `StgPprOpts` to be
pretty-printed and explicitly call type specific ppr functions
* add default `panicStgPprOpts` for panic messages (when it's not
convenient to thread StgPprOpts or DynFlags down to the ppr function
call)
Diffstat (limited to 'compiler/GHC/Stg/Pipeline.hs')
-rw-r--r-- | compiler/GHC/Stg/Pipeline.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Stg/Pipeline.hs b/compiler/GHC/Stg/Pipeline.hs index 8359788b92..64c7e74979 100644 --- a/compiler/GHC/Stg/Pipeline.hs +++ b/compiler/GHC/Stg/Pipeline.hs @@ -103,13 +103,14 @@ stg2stg dflags this_mod binds liftIO (stg_linter True "Unarise" binds') return binds' + opts = initStgPprOpts dflags dump_when flag header binds - = dumpIfSet_dyn dflags flag header FormatSTG (pprStgTopBindings binds) + = dumpIfSet_dyn dflags flag header FormatSTG (pprStgTopBindings opts binds) end_pass what binds2 = liftIO $ do -- report verbosely, if required dumpIfSet_dyn dflags Opt_D_verbose_stg2stg what - FormatSTG (vcat (map ppr binds2)) + FormatSTG (vcat (map (pprStgTopBinding opts) binds2)) stg_linter False what binds2 return binds2 |