Generate a per-module static placeholder CCS for cafs instead of a global one.
Summary
Currently we have one global CCS_DONT_CARE cost centre. This is fine but means functions like whoCreated
return no useful information.
It might be worth to create one CCS we use for statics top level bindings per module. This way we could get at least module-level information for these objects.
Steps to reproduce
A.hs:
module A where
a = Just (42 ::Int)
Main.hs:
module Main where
import GHC.Stack (whoCreated)
import A
data T = MkA | MkB
some_list = MkA : MkB : []
main = do
s <- whoCreated some_list
print s
s <- whoCreated a
print s
Compile with ghc test.hs -O -prof
and run. You will see something like:
./test
["MAIN.DONT_CARE (<built-in>)"]
["MAIN.DONT_CARE (<built-in>)"]
Personally I find this worse than useful, after all at least a
is not from the Main module. If we had one default ccs per module we would instead see:`
Expected behavior
It shouldn't be terrible hard to have this give us
["Module<Main>.DONT_CARE (<built-in>)"]
["Module<A>.DONT_CARE (<built-in>)"]
Environment
- GHC version used:
Optional:
- Operating System:
- System Architecture: