From 84d44334d4eace006af802a19f866513b02d12b6 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 29 Jan 2001 17:25:54 +0000 Subject: [PATCH] [project @ 2001-01-29 17:25:54 by simonmar] a static link field is required for CAFs, now --- ghc/compiler/absCSyn/PprAbsC.lhs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ghc/compiler/absCSyn/PprAbsC.lhs b/ghc/compiler/absCSyn/PprAbsC.lhs index b8924ab..1bcc3b5 100644 --- a/ghc/compiler/absCSyn/PprAbsC.lhs +++ b/ghc/compiler/absCSyn/PprAbsC.lhs @@ -418,16 +418,18 @@ pprAbsC stmt@(CStaticClosure closure_lbl cl_info cost_centre amodes) _ 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 [ -- 1.7.10.4