summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2018-06-27 13:04:47 +0300
committerÖmer Sinan Ağacan <omeragacan@gmail.com>2018-06-27 13:04:58 +0300
commit437ff69e2f4d53f2ca6d0a07f86276fd53c27ef4 (patch)
treec168bbd7fcda6a0223b903b9ba2667e8b4364dcb
parenta54c94f08b938c02cbaf003e23a7ef3352eee19a (diff)
downloadhaskell-437ff69e2f4d53f2ca6d0a07f86276fd53c27ef4.tar.gz
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
-rw-r--r--ghc/GHCi/Leak.hs12
-rw-r--r--ghc/ghc-bin.cabal.in1
2 files changed, 5 insertions, 8 deletions
diff --git a/ghc/GHCi/Leak.hs b/ghc/GHCi/Leak.hs
index 6d1bc58265..aec1ab544e 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 d3cc40235d..85a92501d2 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.*,