Skip to content
Snippets Groups Projects
Commit 437ff69e authored by Ömer Sinan Ağacan's avatar Ömer Sinan Ağacan
Browse files

Add ghc-prim as dependency to ghc-bin

Remove unsafeCoerce introduced by a54c94f0

Reviewers: simonmar, bgamari

Reviewed By: simonmar

Subscribers: rwbarton, thomie, carter

Differential Revision: https://phabricator.haskell.org/D4901
parent a54c94f0
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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.*,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment