[commit: ghc] master: Add ghc-prim as dependency to ghc-bin (437ff69)
git at git.haskell.org
git at git.haskell.org
Wed Jun 27 10:05:17 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/437ff69e2f4d53f2ca6d0a07f86276fd53c27ef4/ghc
>---------------------------------------------------------------
commit 437ff69e2f4d53f2ca6d0a07f86276fd53c27ef4
Author: Ömer Sinan Ağacan <omeragacan at gmail.com>
Date: Wed Jun 27 13:04:47 2018 +0300
Add ghc-prim as dependency to ghc-bin
Remove unsafeCoerce introduced by a54c94f08b
Reviewers: simonmar, bgamari
Reviewed By: simonmar
Subscribers: rwbarton, thomie, carter
Differential Revision: https://phabricator.haskell.org/D4901
>---------------------------------------------------------------
437ff69e2f4d53f2ca6d0a07f86276fd53c27ef4
ghc/GHCi/Leak.hs | 12 ++++--------
ghc/ghc-bin.cabal.in | 1 +
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/ghc/GHCi/Leak.hs b/ghc/GHCi/Leak.hs
index 6d1bc58..aec1ab5 100644
--- a/ghc/GHCi/Leak.hs
+++ b/ghc/GHCi/Leak.hs
@@ -10,15 +10,15 @@ import Data.Bits
import DynFlags (settings, sTargetPlatform)
import Foreign.Ptr (ptrToIntPtr, intPtrToPtr)
import GHC
-import GHC.Exts (anyToAddr#, State#, RealWorld)
+import GHC.Exts (anyToAddr#)
import GHC.Ptr (Ptr (..))
+import GHC.Types (IO (..))
import HscTypes
import Outputable
import Platform (target32Bit)
import System.Mem
import System.Mem.Weak
import UniqDFM
-import Unsafe.Coerce (unsafeCoerce)
-- Checking for space leaks in GHCi. See #15111, and the
-- -fghci-leak-check flag.
@@ -63,15 +63,11 @@ checkLeakIndicators dflags (LeakIndicators leakmods) = do
report :: String -> Maybe a -> IO ()
report _ Nothing = return ()
report msg (Just a) = do
- addr <- mkIO (\s -> case anyToAddr# a s of
- (# s', addr #) -> (# s', Ptr addr #)) :: IO (Ptr ())
+ addr <- IO (\s -> case anyToAddr# a s of
+ (# s', addr #) -> (# s', Ptr addr #)) :: IO (Ptr ())
putStrLn ("-fghci-leak-check: " ++ msg ++ " is still alive at " ++
show (maskTagBits addr))
- -- We don't have access to ghc-prim here so using `unsafeCoerce` for `IO`
- mkIO :: (State# RealWorld -> (# State# RealWorld, a #)) -> IO a
- mkIO = unsafeCoerce
-
tagBits
| target32Bit (sTargetPlatform (settings dflags)) = 2
| otherwise = 3
diff --git a/ghc/ghc-bin.cabal.in b/ghc/ghc-bin.cabal.in
index d3cc402..85a9250 100644
--- a/ghc/ghc-bin.cabal.in
+++ b/ghc/ghc-bin.cabal.in
@@ -54,6 +54,7 @@ Executable ghc
Build-depends:
containers >= 0.5 && < 0.7,
deepseq == 1.4.*,
+ ghc-prim == 0.5.*,
ghci == @ProjectVersionMunged@,
haskeline == 0.7.*,
time == 1.8.*,
More information about the ghc-commits
mailing list