summaryrefslogtreecommitdiff
path: root/compiler/GHC/Cmm/CLabel.hs
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2022-07-26 17:55:23 +0200
committerKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2022-08-08 20:54:35 +0200
commit0b2e0f20cb39fa62401b40b7b03434609de146d0 (patch)
tree854cec239e32e6951d70f76793e3da0c8e14613c /compiler/GHC/Cmm/CLabel.hs
parent78d04cfadfd728bb088b08b1e88905b43cc0360c (diff)
downloadhaskell-wip/cleanup-pp.tar.gz
Cleanups around pretty-printingwip/cleanup-pp
* Remove hack when printing OccNames. No longer needed since e3dcc0d5 * Remove unused `pprCmms` and `instance Outputable Instr` * Simplify `pprCLabel` (no need to pass platform) * Remove evil `Show`/`Eq` instances for `SDoc`. They were needed by ImmLit, but that can take just a String instead. * Remove instance `Outputable CLabel` - proper output of labels needs a platform, and is done by the `OutputableP` instance
Diffstat (limited to 'compiler/GHC/Cmm/CLabel.hs')
-rw-r--r--compiler/GHC/Cmm/CLabel.hs17
1 files changed, 7 insertions, 10 deletions
diff --git a/compiler/GHC/Cmm/CLabel.hs b/compiler/GHC/Cmm/CLabel.hs
index adb5150f1a..c12ecff5eb 100644
--- a/compiler/GHC/Cmm/CLabel.hs
+++ b/compiler/GHC/Cmm/CLabel.hs
@@ -294,9 +294,6 @@ data CLabel
instance Show CLabel where
show = showPprUnsafe . pprDebugCLabel genericPlatform
-instance Outputable CLabel where
- ppr = text . show
-
data ModuleLabelKind
= MLK_Initializer String
| MLK_InitializerArray
@@ -1412,19 +1409,19 @@ pprCLabel !platform !sty lbl = -- see Note [Bangs in CLabel]
AsmStyle | use_leading_underscores -> pp_cSEP <> doc
_ -> doc
- tempLabelPrefixOrUnderscore :: Platform -> SDoc
- tempLabelPrefixOrUnderscore platform = case sty of
+ tempLabelPrefixOrUnderscore :: SDoc
+ tempLabelPrefixOrUnderscore = case sty of
AsmStyle -> asmTempLabelPrefix platform
CStyle -> char '_'
in case lbl of
LocalBlockLabel u -> case sty of
- AsmStyle -> tempLabelPrefixOrUnderscore platform <> pprUniqueAlways u
- CStyle -> tempLabelPrefixOrUnderscore platform <> text "blk_" <> pprUniqueAlways u
+ AsmStyle -> tempLabelPrefixOrUnderscore <> pprUniqueAlways u
+ CStyle -> tempLabelPrefixOrUnderscore <> text "blk_" <> pprUniqueAlways u
AsmTempLabel u
- -> tempLabelPrefixOrUnderscore platform <> pprUniqueAlways u
+ -> tempLabelPrefixOrUnderscore <> pprUniqueAlways u
AsmTempDerivedLabel l suf
-> asmTempLabelPrefix platform
@@ -1474,7 +1471,7 @@ pprCLabel !platform !sty lbl = -- see Note [Bangs in CLabel]
CStyle -> ppr name <> ppIdFlavor flavor
SRTLabel u
- -> maybe_underscore $ tempLabelPrefixOrUnderscore platform <> pprUniqueAlways u <> pp_cSEP <> text "srt"
+ -> maybe_underscore $ tempLabelPrefixOrUnderscore <> pprUniqueAlways u <> pp_cSEP <> text "srt"
RtsLabel (RtsApFast (NonDetFastString str))
-> maybe_underscore $ ftext str <> text "_fast"
@@ -1514,7 +1511,7 @@ pprCLabel !platform !sty lbl = -- see Note [Bangs in CLabel]
-> maybe_underscore $ text "SLOW_CALL_fast_" <> text pat <> text "_ctr"
LargeBitmapLabel u
- -> maybe_underscore $ tempLabelPrefixOrUnderscore platform
+ -> maybe_underscore $ tempLabelPrefixOrUnderscore
<> char 'b' <> pprUniqueAlways u <> pp_cSEP <> text "btm"
-- Some bitmaps for tuple constructors have a numeric tag (e.g. '7')
-- until that gets resolved we'll just force them to start