summaryrefslogtreecommitdiff
path: root/compiler/cmm/PprC.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cmm/PprC.hs')
-rw-r--r--compiler/cmm/PprC.hs30
1 files changed, 9 insertions, 21 deletions
diff --git a/compiler/cmm/PprC.hs b/compiler/cmm/PprC.hs
index c405b650a6..b48d2de3c8 100644
--- a/compiler/cmm/PprC.hs
+++ b/compiler/cmm/PprC.hs
@@ -83,11 +83,11 @@ pprC (Cmm tops) = vcat $ intersperse blankLine $ map pprTop tops
-- top level procs
--
pprTop :: RawCmmTop -> SDoc
-pprTop (CmmProc info clbl (ListGraph blocks)) =
- (if not (null info)
- then pprDataExterns info $$
- pprWordArray (entryLblToInfoLbl clbl) info
- else empty) $$
+pprTop (CmmProc mb_info clbl (ListGraph blocks)) =
+ (case mb_info of
+ Nothing -> empty
+ Just (Statics info_clbl info_dat) -> pprDataExterns info_dat $$
+ pprWordArray info_clbl info_dat) $$
(vcat [
blankLine,
extern_decls,
@@ -112,31 +112,21 @@ pprTop (CmmProc info clbl (ListGraph blocks)) =
-- We only handle (a) arrays of word-sized things and (b) strings.
-pprTop (CmmData _section _ds@[CmmDataLabel lbl, CmmString str]) =
+pprTop (CmmData _section (Statics lbl [CmmString str])) =
hcat [
pprLocalness lbl, ptext (sLit "char "), pprCLabel lbl,
ptext (sLit "[] = "), pprStringInCStyle str, semi
]
-pprTop (CmmData _section _ds@[CmmDataLabel lbl, CmmUninitialised size]) =
+pprTop (CmmData _section (Statics lbl [CmmUninitialised size])) =
hcat [
pprLocalness lbl, ptext (sLit "char "), pprCLabel lbl,
brackets (int size), semi
]
-pprTop (CmmData _section (CmmDataLabel lbl : lits)) =
+pprTop (CmmData _section (Statics lbl lits)) =
pprDataExterns lits $$
- pprWordArray lbl lits
-
--- Floating info table for safe a foreign call.
-pprTop (CmmData _section d@(_ : _))
- | CmmDataLabel lbl : lits <- reverse d =
- let lits' = reverse lits
- in pprDataExterns lits' $$
- pprWordArray lbl lits'
-
--- these shouldn't appear?
-pprTop (CmmData _ _) = panic "PprC.pprTop: can't handle this data"
+ pprWordArray lbl lits
-- --------------------------------------------------------------------------
-- BasicBlocks are self-contained entities: they always end in a jump.
@@ -508,8 +498,6 @@ pprStatic :: CmmStatic -> SDoc
pprStatic s = case s of
CmmStaticLit lit -> nest 4 (pprLit lit)
- CmmAlign i -> nest 4 (ptext (sLit "/* align */") <+> int i)
- CmmDataLabel clbl -> pprCLabel clbl <> colon
CmmUninitialised i -> nest 4 (mkC_ <> brackets (int i))
-- these should be inlined, like the old .hc