summaryrefslogtreecommitdiff
path: root/compiler/nativeGen/X86
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/nativeGen/X86
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/nativeGen/X86')
-rw-r--r--compiler/nativeGen/X86/Ppr.hs19
1 files changed, 12 insertions, 7 deletions
diff --git a/compiler/nativeGen/X86/Ppr.hs b/compiler/nativeGen/X86/Ppr.hs
index 8b73cdffc1..4df7287b5a 100644
--- a/compiler/nativeGen/X86/Ppr.hs
+++ b/compiler/nativeGen/X86/Ppr.hs
@@ -120,15 +120,17 @@ pprSizeDecl lbl
pprBasicBlock :: LabelMap RawCmmStatics -> NatBasicBlock Instr -> SDoc
pprBasicBlock info_env (BasicBlock blockid instrs)
- = sdocWithDynFlags $ \dflags ->
- maybe_infotable dflags $
+ = maybe_infotable $
pprLabel asmLbl $$
vcat (map pprInstr instrs) $$
- (if debugLevel dflags > 0
- then ppr (mkAsmTempEndLabel asmLbl) <> char ':' else empty)
+ (sdocOption sdocDebugLevel $ \level ->
+ if level > 0
+ then ppr (mkAsmTempEndLabel asmLbl) <> char ':'
+ else empty
+ )
where
asmLbl = blockLbl blockid
- maybe_infotable dflags c = case mapLookup blockid info_env of
+ maybe_infotable c = case mapLookup blockid info_env of
Nothing -> c
Just (RawCmmStatics infoLbl info) ->
pprAlignForSection Text $$
@@ -136,8 +138,11 @@ pprBasicBlock info_env (BasicBlock blockid instrs)
vcat (map pprData info) $$
pprLabel infoLbl $$
c $$
- (if debugLevel dflags > 0
- then ppr (mkAsmTempEndLabel infoLbl) <> char ':' else empty)
+ (sdocOption sdocDebugLevel $ \level ->
+ if level > 0
+ then ppr (mkAsmTempEndLabel infoLbl) <> char ':'
+ else empty
+ )
-- Make sure the info table has the right .loc for the block
-- coming right after it. See [Note: Info Offset]
infoTableLoc = case instrs of