summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2021-12-22 16:09:38 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-12-23 10:55:36 -0500
commit13a6d85a74872f22c8762d04678f7499e7890a5f (patch)
tree089419e837bb6d7b9a73f5f6aad67be46d5cbc14
parent9552781abf3d199d01b01ed4b7d04abdc54b6b26 (diff)
downloadhaskell-13a6d85a74872f22c8762d04678f7499e7890a5f.tar.gz
Make callerCC profiling mode represent entry counter flag.
Fixes #20854
-rw-r--r--compiler/GHC/Core/Opt/CallerCC.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Core/Opt/CallerCC.hs b/compiler/GHC/Core/Opt/CallerCC.hs
index 3c47da66af..8808296126 100644
--- a/compiler/GHC/Core/Opt/CallerCC.hs
+++ b/compiler/GHC/Core/Opt/CallerCC.hs
@@ -79,12 +79,13 @@ doExpr env e@(Var v)
ccName :: CcName
ccName = mkFastString $ showSDoc (dflags env) nameDoc
ccIdx <- getCCIndex' ccName
- let span = case revParents env of
+ let count = gopt Opt_ProfCountEntries (dflags env)
+ span = case revParents env of
top:_ -> nameSrcSpan $ varName top
_ -> noSrcSpan
cc = NormalCC (ExprCC ccIdx) ccName (thisModule env) span
tick :: CoreTickish
- tick = ProfNote cc True True
+ tick = ProfNote cc count True
pure $ Tick tick e
| otherwise = pure e
doExpr _env e@(Lit _) = pure e