X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fmain%2FBreakArray.hs;h=4d2c07bba93fff188d8e0c312ab0ae9ba0030358;hp=86b9da44e40753f7b56ddc0484c15a59251a34b5;hb=edc0bafd3fcd01b85a2e8894e5dfe149eb0e0857;hpb=17b297d97d327620ed6bfab942f8992b2446f1bf diff --git a/compiler/main/BreakArray.hs b/compiler/main/BreakArray.hs index 86b9da4..4d2c07b 100644 --- a/compiler/main/BreakArray.hs +++ b/compiler/main/BreakArray.hs @@ -3,31 +3,30 @@ -- 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_GHC -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/WorkingConventions#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 +import GHC.IO ( IO(..) ) import Constants data BreakArray = BA (MutableByteArray# RealWorld) @@ -106,3 +105,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 */ +