From: simonmar Date: Wed, 13 Mar 2002 13:48:04 +0000 (+0000) Subject: [project @ 2002-03-13 13:48:04 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~2273 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=eb7d1ef7fbbf0572a1d5fc0af6193d7f5b18da75;p=ghc-hetmet.git [project @ 2002-03-13 13:48:04 by simonmar] It *is* possible to get VoidRep fields in a constructor, but their representation should be empty (not a zero word). --- diff --git a/ghc/compiler/absCSyn/PprAbsC.lhs b/ghc/compiler/absCSyn/PprAbsC.lhs index dc072cc..df93726 100644 --- a/ghc/compiler/absCSyn/PprAbsC.lhs +++ b/ghc/compiler/absCSyn/PprAbsC.lhs @@ -49,7 +49,7 @@ import Maybes ( maybeToBool, catMaybes ) import PrimOp ( primOpNeedsWrapper ) import MachOp ( MachOp(..) ) import ForeignCall ( ForeignCall(..) ) -import PrimRep ( isFloatingRep, PrimRep(..), getPrimRepSize, getPrimRepArrayElemSize ) +import PrimRep ( isFloatingRep, PrimRep(..), getPrimRepSize ) import SMRep ( pprSMRep ) import Unique ( pprUnique, Unique{-instance NamedThing-} ) import UniqSet ( emptyUniqSet, elementOfUniqSet, @@ -439,17 +439,18 @@ pprAbsC stmt@(CStaticClosure cl_info cost_centre amodes) _ info_lbl = infoTableLabelFromCI cl_info ppr_payload [] = empty - ppr_payload ls = comma <+> - braces (hsep (punctuate comma (map ((text "(L_)" <>).ppr_item) ls))) - - ppr_item item - | rep == VoidRep = text "0" -- might not even need this... - | rep == FloatRep = ppr_amode (floatToWord item) - | rep == DoubleRep = hcat (punctuate (text ", (L_)") - (map ppr_amode (doubleToWords item))) - | otherwise = ppr_amode item + ppr_payload ls = + comma <+> + (braces $ hsep $ punctuate comma $ + map (text "(L_)" <>) (foldr ppr_item [] ls)) + + ppr_item item rest + | rep == VoidRep = rest + | rep == FloatRep = ppr_amode (floatToWord item) : rest + | rep == DoubleRep = map ppr_amode (doubleToWords item) ++ rest + | otherwise = ppr_amode item : rest where - rep = getAmodeRep item + rep = getAmodeRep item pprAbsC stmt@(CClosureInfoAndCode cl_info slow maybe_fast cl_descr) _