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 )
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,15 +439,16 @@ 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
......
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