summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsExpr.hs
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-03-02 12:59:06 -0500
committerBen Gamari <ben@smart-cactus.org>2018-03-02 14:11:22 -0500
commitd8e47a2ea89dbce647b06132ec10c39a2de67437 (patch)
treea459384018bd2ec0b0333929641e39834a24b104 /compiler/deSugar/DsExpr.hs
parentf8e3cd3b160d20dbd18d490b7babe43153bb3287 (diff)
downloadhaskell-d8e47a2ea89dbce647b06132ec10c39a2de67437.tar.gz
Make cost centre symbol names deterministic.
Previously, non-CAF cost centre symbol names contained a unique, leading to non-deterministic object files which, among other issues, can lead to an inconsistency causing linking failure when using cached builds sourced from multiple machines, such as with nix. Now, each cost centre symbol is annotated with the type of cost centre it is (CAF, expression annotation, declaration annotation, or HPC) and, when a single module has multiple cost centres with the same name and type, a 0-based index. Reviewers: bgamari, simonmar Reviewed By: bgamari Subscribers: niteria, simonmar, RyanGlScott, osa1, rwbarton, thomie, carter GHC Trac Issues: #4012, #12935 Differential Revision: https://phabricator.haskell.org/D4388
Diffstat (limited to 'compiler/deSugar/DsExpr.hs')
-rw-r--r--compiler/deSugar/DsExpr.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/deSugar/DsExpr.hs b/compiler/deSugar/DsExpr.hs
index 2f3739e4c2..0b439a14b2 100644
--- a/compiler/deSugar/DsExpr.hs
+++ b/compiler/deSugar/DsExpr.hs
@@ -392,8 +392,9 @@ ds_expr _ (HsSCC _ cc expr@(L loc _)) = do
then do
mod_name <- getModule
count <- goptM Opt_ProfCountEntries
- uniq <- newUnique
- Tick (ProfNote (mkUserCC (sl_fs cc) mod_name loc uniq) count True)
+ let nm = sl_fs cc
+ flavour <- ExprCC <$> getCCIndexM nm
+ Tick (ProfNote (mkUserCC nm mod_name loc flavour) count True)
<$> dsLExpr expr
else dsLExpr expr