From 0492eec2eadfe76ed0bbf957244cd5daab5178ed Mon Sep 17 00:00:00 2001 From: Andreas Klebinger Date: Wed, 22 Dec 2021 16:09:38 +0100 Subject: Make callerCC profiling mode represent entry counter flag. Fixes #20854 --- compiler/GHC/Core/Opt/CallerCC.hs | 5 +++-- 1 file 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 -- cgit v1.2.1