X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FRtClosureInspect.hs;h=269a7bb1d26347b6e04adb638ff902261221865a;hb=7510eeadaf490f7e7f6c9ab3f06ca500c1d95cc0;hp=437ff940fe1827e7e8d0328ccd84639675b39711;hpb=6c27803d6d1095741fc99136c329aaffa6f3006c;p=ghc-hetmet.git diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index 437ff94..269a7bb 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -50,8 +50,7 @@ import Linker import DataCon import Type import Var -import TcRnMonad ( TcM, initTc, ioToTcRn, - tryTcErrs, traceTc) +import TcRnMonad import TcType import TcMType import TcUnify @@ -68,13 +67,16 @@ import TysPrim import PrelNames import TysWiredIn -import Constants import Outputable import Panic +#ifndef GHCI_TABLES_NEXT_TO_CODE +import Constants ( wORD_SIZE ) +#endif + import GHC.Arr ( Array(..) ) import GHC.Exts -import GHC.IOBase +import GHC.IOBase ( IO(IO) ) import Control.Monad import Data.Maybe @@ -261,11 +263,11 @@ extractUnboxed tt clos = go tt (nonPtrs clos) | otherwise = pprPanic "Expected a TcTyCon" (ppr t) go [] _ = [] go (t:tt) xx - | (x, rest) <- splitAt ((sizeofType t + wORD_SIZE - 1) `div` wORD_SIZE) xx + | (x, rest) <- splitAt (sizeofType t) xx = x : go tt rest -sizeofTyCon :: TyCon -> Int -sizeofTyCon = sizeofPrimRep . tyConPrimRep +sizeofTyCon :: TyCon -> Int -- in *words* +sizeofTyCon = primRepSizeW . tyConPrimRep ----------------------------------- -- * Traversals for Terms @@ -538,7 +540,7 @@ traceTR :: SDoc -> TR () traceTR = liftTcM . traceTc trIO :: IO a -> TR a -trIO = liftTcM . ioToTcRn +trIO = liftTcM . liftIO liftTcM :: TcM a -> TR a liftTcM = id