From 7317813ad5b1554ba4a0f139ff9d70dd6a4c8ab0 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Sat, 7 Jul 2007 19:21:02 +0000 Subject: [PATCH] FIX #1472 (also #249, which was not completely fixed previously): -caf-all bugs --- compiler/profiling/SCCfinal.lhs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/compiler/profiling/SCCfinal.lhs b/compiler/profiling/SCCfinal.lhs index 601aff4..256984a 100644 --- a/compiler/profiling/SCCfinal.lhs +++ b/compiler/profiling/SCCfinal.lhs @@ -136,7 +136,7 @@ stgMassageForProfiling this_pkg mod_name us stg_binds modl | Just m <- nameModule_maybe (idName binder) = m | otherwise = mod_name in - collectCC cc `thenMM_` + collectNewCC cc `thenMM_` collectCCS ccs `thenMM_` returnMM ccs else @@ -417,6 +417,14 @@ collectCC cc mod_name scope_cc us ids (local_ccs, extern_ccs, ccss) else -- must declare it "extern" ((local_ccs, cc : extern_ccs, ccss), ()) +-- Version of collectCC used when we definitely want to declare this +-- CC as local, even if its module name is not the same as the current +-- module name (eg. the special :Main module) see bug #249, #1472, +-- test prof001,prof002. +collectNewCC :: CostCentre -> MassageM () +collectNewCC cc mod_name scope_cc us ids (local_ccs, extern_ccs, ccss) + = ((cc : local_ccs, extern_ccs, ccss), ()) + collectCCS :: CostCentreStack -> MassageM () collectCCS ccs mod_name scope_cc us ids (local_ccs, extern_ccs, ccss) -- 1.7.10.4