summaryrefslogtreecommitdiff
path: root/compiler/profiling/SCCfinal.lhs
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-07-07 19:21:02 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-07-07 19:21:02 +0000
commit7317813ad5b1554ba4a0f139ff9d70dd6a4c8ab0 (patch)
tree271334deb7a887f13e2b47e41a4b02673948b718 /compiler/profiling/SCCfinal.lhs
parent8a2809c29de9f23eba7ca682b48390033a9d40f6 (diff)
downloadhaskell-7317813ad5b1554ba4a0f139ff9d70dd6a4c8ab0.tar.gz
FIX #1472 (also #249, which was not completely fixed previously): -caf-all bugs
Diffstat (limited to 'compiler/profiling/SCCfinal.lhs')
-rw-r--r--compiler/profiling/SCCfinal.lhs10
1 files changed, 9 insertions, 1 deletions
diff --git a/compiler/profiling/SCCfinal.lhs b/compiler/profiling/SCCfinal.lhs
index 601aff4cd1..256984ad91 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)