X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FBreakArray.hs;h=2d1a4d491fdd88166c6f123f1ec3b018bef6de76;hp=d258ae69618651ac7290af3b79c18c56d9975721;hb=d436c70d43fb905c63220040168295e473f4b90a;hpb=ad94d40948668032189ad22a0ad741ac1f645f50 diff --git a/compiler/main/BreakArray.hs b/compiler/main/BreakArray.hs index d258ae6..2d1a4d4 100644 --- a/compiler/main/BreakArray.hs +++ b/compiler/main/BreakArray.hs @@ -3,31 +3,34 @@ -- Break Arrays in the IO monad -- Entries in the array are Word sized -- +-- Conceptually, a zero-indexed IOArray of Bools, initially False. +-- They're represented as Words with 0==False, 1==True. +-- They're used to determine whether GHCI breakpoints are on or off. +-- -- (c) The University of Glasgow 2007 -- ----------------------------------------------------------------------------- -{-# OPTIONS -w #-} --- The above warning supression flag is a temporary kludge. --- While working on this module you are encouraged to remove it and fix --- any warnings in the module. See --- http://hackage.haskell.org/trac/ghc/wiki/CodingStyle#Warnings --- for details - module BreakArray - ( BreakArray (BA) - -- constructor is exported only for ByteCodeGen + ( BreakArray +#ifdef GHCI + (BA) -- constructor is exported only for ByteCodeGen +#endif , newBreakArray +#ifdef GHCI , getBreak , setBreakOn , setBreakOff , showBreakArray +#endif ) where - +#ifdef GHCI import GHC.Exts -import GHC.IOBase -import GHC.Prim -import GHC.Word +#if __GLASGOW_HASKELL__ >= 611 +import GHC.IO ( IO(..) ) +#else +import GHC.IOBase ( IO(..) ) +#endif import Constants data BreakArray = BA (MutableByteArray# RealWorld) @@ -106,3 +109,14 @@ readBA# array i = IO $ \s -> readBreakArray :: BreakArray -> Int -> IO Word readBreakArray (BA array) (I# i) = readBA# array i + +#else /* GHCI */ +--stub implementation to make main/, etc., code happier. +--IOArray and IOUArray are increasingly non-portable, +--still don't have quite the same interface, and (for GHCI) +--presumably have a different representation. +data BreakArray = Unspecified +newBreakArray :: Int -> IO BreakArray +newBreakArray _ = return Unspecified +#endif /* GHCI */ +