X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fprofiling%2FSCCfinal.lhs;h=256984ad91b0cecf9ac76ab6d87a3bdbed548960;hb=f83010b119096699d1efef2f7bb45460719c48f9;hp=601aff4cd1cc3789cca2cefe8901f3ad22ec7ea6;hpb=b1ab4b8a607addc4d097588db5761313c996a41f;p=ghc-hetmet.git 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)