summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToAsm.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-09-18 11:44:44 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-09-23 20:43:48 -0400
commit667d63558a694e12974ace723b553950f6080365 (patch)
tree50167bdcff894b1ca9ca96a8ad73fe20a883d245 /compiler/GHC/CmmToAsm.hs
parentd7385f7077c6258c2a76ae51b4ea80f6fa9c7015 (diff)
downloadhaskell-667d63558a694e12974ace723b553950f6080365.tar.gz
Refactor CLabel pretty-printing
* Don't depend on the selected backend to know if we print Asm or C labels: we already have PprStyle to determine this. Moreover even when a native backend is used (NCG, LLVM) we may want to C headers containing pretty-printed labels, so it wasn't a good predicate anyway. * Make pretty-printing code clearer and avoid partiality
Diffstat (limited to 'compiler/GHC/CmmToAsm.hs')
-rw-r--r--compiler/GHC/CmmToAsm.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/CmmToAsm.hs b/compiler/GHC/CmmToAsm.hs
index 6c142ed9d8..18590a3ee8 100644
--- a/compiler/GHC/CmmToAsm.hs
+++ b/compiler/GHC/CmmToAsm.hs
@@ -803,7 +803,7 @@ makeImportsDoc dflags imports
doPpr lbl = (lbl, renderWithContext
(ncgAsmContext config)
- (pprCLabel_NCG platform lbl))
+ (pprCLabel platform AsmStyle lbl))
-- -----------------------------------------------------------------------------
-- Generate jump tables
@@ -1149,7 +1149,7 @@ cmmExprNative referenceKind expr = do
initNCGConfig :: DynFlags -> NCGConfig
initNCGConfig dflags = NCGConfig
{ ncgPlatform = targetPlatform dflags
- , ncgAsmContext = initSDocContext dflags (mkCodeStyle AsmStyle)
+ , ncgAsmContext = initSDocContext dflags (PprCode AsmStyle)
, ncgProcAlignment = cmmProcAlignment dflags
, ncgExternalDynamicRefs = gopt Opt_ExternalDynamicRefs dflags
, ncgPIC = positionIndependent dflags