summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToLlvm
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-16 15:17:49 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-21 06:39:32 -0400
commit35e43d48a9a3ab22da90c4c2ea2c805fe762b9c5 (patch)
tree3cd08ed7ce20790f9fd522936b2d5e737f41c7f4 /compiler/GHC/CmmToLlvm
parent70be0fbcefa07ff164437476bf2809ea7c3ff495 (diff)
downloadhaskell-35e43d48a9a3ab22da90c4c2ea2c805fe762b9c5.tar.gz
Avoid DynFlags in Ppr code (#17957)
* replace `DynFlags` parameters with `SDocContext` parameters for a few Ppr related functions: `bufLeftRenderSDoc`, `printSDoc`, `printSDocLn`, `showSDocOneLine`. * remove the use of `pprCols :: DynFlags -> Int` in Outputable. We already have the information via `sdocLineLength :: SDocContext -> Int`
Diffstat (limited to 'compiler/GHC/CmmToLlvm')
-rw-r--r--compiler/GHC/CmmToLlvm/Base.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/CmmToLlvm/Base.hs b/compiler/GHC/CmmToLlvm/Base.hs
index 981535e993..b36b4814f1 100644
--- a/compiler/GHC/CmmToLlvm/Base.hs
+++ b/compiler/GHC/CmmToLlvm/Base.hs
@@ -447,8 +447,8 @@ renderLlvm sdoc = do
-- Write to output
dflags <- getDynFlags
out <- getEnv envOutput
- liftIO $ Outp.bufLeftRenderSDoc dflags out
- (Outp.mkCodeStyle Outp.CStyle) sdoc
+ let ctx = initSDocContext dflags (Outp.mkCodeStyle Outp.CStyle)
+ liftIO $ Outp.bufLeftRenderSDoc ctx out sdoc
-- Dump, if requested
dumpIfSetLlvm Opt_D_dump_llvm "LLVM Code" FormatLLVM sdoc