summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToLlvm
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-02-03 17:57:29 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-02-20 21:18:48 -0500
commit6880d6aa1e6e96579bbff89712efd813489cc828 (patch)
treef2156d5a5c168bf28ee569a62a74b51adf74dac9 /compiler/GHC/CmmToLlvm
parent74ad75e87317196c600dfabc61aee1b87d95c214 (diff)
downloadhaskell-6880d6aa1e6e96579bbff89712efd813489cc828.tar.gz
Disentangle DynFlags and SDoc
Remove several uses of `sdocWithDynFlags`. The remaining ones are mostly CodeGen related (e.g. depend on target platform constants) and will be fixed separately. Metric Decrease: T12425 T9961 WWRec T1969 T14683
Diffstat (limited to 'compiler/GHC/CmmToLlvm')
-rw-r--r--compiler/GHC/CmmToLlvm/Base.hs8
-rw-r--r--compiler/GHC/CmmToLlvm/CodeGen.hs2
2 files changed, 6 insertions, 4 deletions
diff --git a/compiler/GHC/CmmToLlvm/Base.hs b/compiler/GHC/CmmToLlvm/Base.hs
index c0bd742840..5cfef04029 100644
--- a/compiler/GHC/CmmToLlvm/Base.hs
+++ b/compiler/GHC/CmmToLlvm/Base.hs
@@ -506,7 +506,9 @@ strCLabel_llvm :: CLabel -> LlvmM LMString
strCLabel_llvm lbl = do
dflags <- getDynFlags
let sdoc = pprCLabel dflags lbl
- str = Outp.renderWithStyle dflags sdoc (Outp.mkCodeStyle Outp.CStyle)
+ str = Outp.renderWithStyle
+ (initSDocContext dflags (Outp.mkCodeStyle Outp.CStyle))
+ sdoc
return (fsLit str)
strDisplayName_llvm :: CLabel -> LlvmM LMString
@@ -515,7 +517,7 @@ strDisplayName_llvm lbl = do
let sdoc = pprCLabel dflags lbl
depth = Outp.PartWay 1
style = Outp.mkUserStyle dflags Outp.reallyAlwaysQualify depth
- str = Outp.renderWithStyle dflags sdoc style
+ str = Outp.renderWithStyle (initSDocContext dflags style) sdoc
return (fsLit (dropInfoSuffix str))
dropInfoSuffix :: String -> String
@@ -532,7 +534,7 @@ strProcedureName_llvm lbl = do
let sdoc = pprCLabel dflags lbl
depth = Outp.PartWay 1
style = Outp.mkUserStyle dflags Outp.neverQualify depth
- str = Outp.renderWithStyle dflags sdoc style
+ str = Outp.renderWithStyle (initSDocContext dflags style) sdoc
return (fsLit str)
-- ----------------------------------------------------------------------------
diff --git a/compiler/GHC/CmmToLlvm/CodeGen.hs b/compiler/GHC/CmmToLlvm/CodeGen.hs
index 33dd82c418..947ba31f35 100644
--- a/compiler/GHC/CmmToLlvm/CodeGen.hs
+++ b/compiler/GHC/CmmToLlvm/CodeGen.hs
@@ -1505,7 +1505,7 @@ genMachOp_slow opt op [x, y] = case op of
-- Error. Continue anyway so we can debug the generated ll file.
dflags <- getDynFlags
let style = mkCodeStyle CStyle
- toString doc = renderWithStyle dflags doc style
+ toString doc = renderWithStyle (initSDocContext dflags style) doc
cmmToStr = (lines . toString . PprCmm.pprExpr)
statement $ Comment $ map fsLit $ cmmToStr x
statement $ Comment $ map fsLit $ cmmToStr y