summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToC.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-31 18:49:01 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-04-03 06:26:54 -0400
commitcc2918a0407e1581e824ebd90a1fcbb0637d5744 (patch)
tree42cdc286b9b2557252f59db47373305c1cfc9c36 /compiler/GHC/CmmToC.hs
parenta485c3c4049fff09e989bfd7d2ba47035c92a69b (diff)
downloadhaskell-cc2918a0407e1581e824ebd90a1fcbb0637d5744.tar.gz
Refactor CmmStatics
In !2959 we noticed that there was some redundant code (in GHC.Cmm.Utils and GHC.Cmm.StgToCmm.Utils) used to deal with `CmmStatics` datatype (before SRT generation) and `RawCmmStatics` datatype (after SRT generation). This patch removes this redundant code by using a single GADT for (Raw)CmmStatics.
Diffstat (limited to 'compiler/GHC/CmmToC.hs')
-rw-r--r--compiler/GHC/CmmToC.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs
index c630fbb305..3eddd87785 100644
--- a/compiler/GHC/CmmToC.hs
+++ b/compiler/GHC/CmmToC.hs
@@ -88,7 +88,7 @@ pprTop dflags = \case
(CmmProc infos clbl _in_live_regs graph) ->
(case mapLookup (g_entry graph) infos of
Nothing -> empty
- Just (RawCmmStatics info_clbl info_dat) ->
+ Just (CmmStaticsRaw info_clbl info_dat) ->
pprDataExterns platform info_dat $$
pprWordArray dflags info_is_in_rodata info_clbl info_dat) $$
(vcat [
@@ -111,21 +111,21 @@ pprTop dflags = \case
-- We only handle (a) arrays of word-sized things and (b) strings.
- (CmmData section (RawCmmStatics lbl [CmmString str])) ->
+ (CmmData section (CmmStaticsRaw lbl [CmmString str])) ->
pprExternDecl platform lbl $$
hcat [
pprLocalness lbl, pprConstness (isSecConstant section), text "char ", ppr lbl,
text "[] = ", pprStringInCStyle str, semi
]
- (CmmData section (RawCmmStatics lbl [CmmUninitialised size])) ->
+ (CmmData section (CmmStaticsRaw lbl [CmmUninitialised size])) ->
pprExternDecl platform lbl $$
hcat [
pprLocalness lbl, pprConstness (isSecConstant section), text "char ", ppr lbl,
brackets (int size), semi
]
- (CmmData section (RawCmmStatics lbl lits)) ->
+ (CmmData section (CmmStaticsRaw lbl lits)) ->
pprDataExterns platform lits $$
pprWordArray dflags (isSecConstant section) lbl lits
where