import Literal ( Literal(..) )
import TyCon ( tyConDataCons )
import Name ( NamedThing(..) )
-import DataCon ( DataCon{-instance NamedThing-}, dataConWrapId )
+import DataCon ( dataConWrapId )
import Maybes ( maybeToBool, catMaybes )
import PrimOp ( primOpNeedsWrapper, pprPrimOp, pprCCallOp,
PrimOp(..), CCall(..), CCallTarget(..), isDynamicTarget )
import StgSyn ( SRT(..) )
import BitSet ( intBS )
import Outputable
+import GlaExts
import Util ( nOfThem )
import ST
-import MutableArray
infixr 9 `thenTE`
\end{code}
where
rep = getAmodeRep item
- padding_wds =
- if not (closureUpdReqd cl_info) then
- []
- else
- case max 0 (mIN_UPD_SIZE - length amodes) of { still_needed ->
- nOfThem still_needed (mkIntCLit 0) } -- a bunch of 0s
+ upd_reqd = closureUpdReqd cl_info
+ padding_wds
+ | not upd_reqd = []
+ | otherwise = case max 0 (mIN_UPD_SIZE - length amodes) of { still_needed ->
+ nOfThem still_needed (mkIntCLit 0) } -- a bunch of 0s
+
+ -- always have a static link field, it's used to save the closure's
+ -- info pointer when we're reverting CAFs (see comment in Storage.c)
static_link_field
- | staticClosureNeedsLink cl_info = [mkIntCLit 0]
- | otherwise = []
+ | upd_reqd || staticClosureNeedsLink cl_info = [mkIntCLit 0]
+ | otherwise = []
pprAbsC stmt@(CClosureInfoAndCode cl_info slow maybe_fast cl_descr) _
= vcat [
\end{code}
\begin{code}
-has_srt (_, NoSRT) = False
-has_srt _ = True
-
pp_srt_info srt =
case srt of
(lbl, NoSRT) ->
pprMagicId (VanillaReg pk n)
= hcat [ pprVanillaReg n, char '.',
pprUnionTag pk ]
-pprMagicId (FloatReg n) = (<>) (ptext SLIT("F")) (int IBOX(n))
-pprMagicId (DoubleReg n) = (<>) (ptext SLIT("D")) (int IBOX(n))
-pprMagicId (LongReg _ n) = (<>) (ptext SLIT("L")) (int IBOX(n))
+pprMagicId (FloatReg n) = ptext SLIT("F") <> int (I# n)
+pprMagicId (DoubleReg n) = ptext SLIT("D") <> int (I# n)
+pprMagicId (LongReg _ n) = ptext SLIT("L") <> int (I# n)
pprMagicId Sp = ptext SLIT("Sp")
pprMagicId Su = ptext SLIT("Su")
pprMagicId SpLim = ptext SLIT("SpLim")
pprMagicId CurCostCentre = ptext SLIT("CCCS")
pprMagicId VoidReg = panic "pprMagicId:VoidReg!"
-pprVanillaReg :: FastInt -> SDoc
-pprVanillaReg n = (<>) (char 'R') (int IBOX(n))
+pprVanillaReg :: Int# -> SDoc
+pprVanillaReg n = char 'R' <> int (I# n)
pprUnionTag :: PrimRep -> SDoc