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
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-08-09 02:32:24 -0400
commite9dfd26a38182e9c284b7db16cb10fc889eedf9e (patch)
treef1f57a251deae310291f05c25dea7d16ed547868 /compiler/GHC/Cmm/CLabel.hs
parent681aa076259c05c626266cf516de7e7c5524eadb (diff)
downloadhaskell-e9dfd26a38182e9c284b7db16cb10fc889eedf9e.tar.gz
Cleanups around pretty-printing
* 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