- let
- arg_kinds = map idPrimRep all_args
- (arg_regs, _) = assignRegs [{-nothing live-}] arg_kinds
- (reg_args, stk_args) = splitAtList arg_regs all_args
-
- (sp_stk_args, stk_offsets, stk_tags)
- = mkTaggedVirtStkOffsets sp idPrimRep stk_args
- in
-
- -- Bind args to appropriate regs/stk locns
- bindArgsToRegs reg_args arg_regs `thenC`
- mapCs bindNewToStack stk_offsets `thenC`
- setRealAndVirtualSp sp_stk_args `thenC`
-
- -- free up the stack slots containing tags, and the slot
- -- containing the return address (really frame header).
- -- c.f. CgCase.cgUnboxedTupleAlt.
- freeStackSlots (sp : map fst stk_tags) `thenC`
+ -- restore the saved cost centre. BUT: we must not free the stack slot
+ -- containing the cost centre, because it might be needed for a
+ -- recursive call to this let-no-escape.
+ restoreCurrentCostCentre cc_slot False{-don't free-} `thenC`