Make cost centre symbol names deterministic.
authorShea Levy <shea@shealevy.com>
Fri, 2 Mar 2018 17:59:06 +0000 (12:59 -0500)
committerBen Gamari <ben@smart-cactus.org>
Fri, 2 Mar 2018 19:11:22 +0000 (14:11 -0500)
commitd8e47a2ea89dbce647b06132ec10c39a2de67437
treea459384018bd2ec0b0333929641e39834a24b104
parentf8e3cd3b160d20dbd18d490b7babe43153bb3287
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
compiler/deSugar/Coverage.hs
compiler/deSugar/DsExpr.hs
compiler/deSugar/DsMonad.hs
compiler/ghc.cabal.in
compiler/profiling/CostCentre.hs
compiler/profiling/CostCentreState.hs [new file with mode: 0644]
compiler/stgSyn/CoreToStg.hs
compiler/typecheck/TcBinds.hs
compiler/typecheck/TcRnMonad.hs
compiler/typecheck/TcRnTypes.hs