Commit eb7d1ef7 authored by simonmar's avatar simonmar
Browse files

[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).
parent a551a3bb
...@@ -49,7 +49,7 @@ import Maybes ( maybeToBool, catMaybes ) ...@@ -49,7 +49,7 @@ import Maybes ( maybeToBool, catMaybes )
import PrimOp ( primOpNeedsWrapper ) import PrimOp ( primOpNeedsWrapper )
import MachOp ( MachOp(..) ) import MachOp ( MachOp(..) )
import ForeignCall ( ForeignCall(..) ) import ForeignCall ( ForeignCall(..) )
import PrimRep ( isFloatingRep, PrimRep(..), getPrimRepSize, getPrimRepArrayElemSize ) import PrimRep ( isFloatingRep, PrimRep(..), getPrimRepSize )
import SMRep ( pprSMRep ) import SMRep ( pprSMRep )
import Unique ( pprUnique, Unique{-instance NamedThing-} ) import Unique ( pprUnique, Unique{-instance NamedThing-} )
import UniqSet ( emptyUniqSet, elementOfUniqSet, import UniqSet ( emptyUniqSet, elementOfUniqSet,
...@@ -439,17 +439,18 @@ pprAbsC stmt@(CStaticClosure cl_info cost_centre amodes) _ ...@@ -439,17 +439,18 @@ pprAbsC stmt@(CStaticClosure cl_info cost_centre amodes) _
info_lbl = infoTableLabelFromCI cl_info info_lbl = infoTableLabelFromCI cl_info
ppr_payload [] = empty ppr_payload [] = empty
ppr_payload ls = comma <+> ppr_payload ls =
braces (hsep (punctuate comma (map ((text "(L_)" <>).ppr_item) ls))) comma <+>
(braces $ hsep $ punctuate comma $
ppr_item item map (text "(L_)" <>) (foldr ppr_item [] ls))
| rep == VoidRep = text "0" -- might not even need this...
| rep == FloatRep = ppr_amode (floatToWord item) ppr_item item rest
| rep == DoubleRep = hcat (punctuate (text ", (L_)") | rep == VoidRep = rest
(map ppr_amode (doubleToWords item))) | rep == FloatRep = ppr_amode (floatToWord item) : rest
| otherwise = ppr_amode item | rep == DoubleRep = map ppr_amode (doubleToWords item) ++ rest
| otherwise = ppr_amode item : rest
where where
rep = getAmodeRep item rep = getAmodeRep item
pprAbsC stmt@(CClosureInfoAndCode cl_info slow maybe_fast cl_descr) _ pprAbsC stmt@(CClosureInfoAndCode cl_info slow maybe_fast cl_descr) _
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment