[commit: ghc] ghc-8.0: ErrUtils: Emulate getAllocationCounter on GHC 7.8 (457d15f)

git at git.haskell.org git at git.haskell.org
Thu Mar 24 22:00:31 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/457d15f1d212c9d29ee942ec3771bacaeba87d74/ghc

>---------------------------------------------------------------

commit 457d15f1d212c9d29ee942ec3771bacaeba87d74
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Thu Mar 24 13:08:34 2016 +0100

    ErrUtils: Emulate getAllocationCounter on GHC 7.8


>---------------------------------------------------------------

457d15f1d212c9d29ee942ec3771bacaeba87d74
 compiler/main/ErrUtils.hs | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/compiler/main/ErrUtils.hs b/compiler/main/ErrUtils.hs
index 21fd7e8..9b98b5e 100644
--- a/compiler/main/ErrUtils.hs
+++ b/compiler/main/ErrUtils.hs
@@ -462,6 +462,14 @@ showPass dflags what
   = ifVerbose dflags 2 $
     logInfo dflags defaultUserStyle (text "***" <+> text what <> colon)
 
+#if ! MIN_VERSION_base(4,8,0)
+-- This is a hack to allow us to build stage1 with 7.8 compilers, which
+-- did not support getAllocationCounter. This means that the allocation numbers
+-- produced by stage1 are bogus, but stage2 will be fine.
+getAllocationCounter :: IO Int64
+getAllocationCounter = return 0
+#endif
+
 -- | Time a compilation phase.
 --
 -- When timings are enabled (e.g. with the @-v2@ flag), the allocations



More information about the ghc-commits mailing list