[project @ 1997-11-24 20:10:33 by sof]
authorsof <unknown>
Mon, 24 Nov 1997 20:11:57 +0000 (20:11 +0000)
committersof <unknown>
Mon, 24 Nov 1997 20:11:57 +0000 (20:11 +0000)
fix to have it compile with 2.09 (and later)

ghc/compiler/nativeGen/MachRegs.lhs
ghc/compiler/nativeGen/PprMach.lhs
ghc/compiler/reader/Lex.lhs
ghc/compiler/reader/ReadPrefix.lhs

index 00e16b7..d772c90 100644 (file)
@@ -59,12 +59,7 @@ module MachRegs (
 #endif
     ) where
 
-#if __GLASGOW_HASKELL__ >= 202
-import GlaExts
-import FastString
-#else
 IMP_Ubiq(){-uitous-}
-#endif
 
 import AbsCSyn         ( MagicId(..) )
 import AbsCUtils       ( magicIdPrimRep )
index 1ac24d0..617ba89 100644 (file)
@@ -17,9 +17,6 @@ IMPORT_1_3(Char(isPrint,isDigit))
 #if __GLASGOW_HASKELL__ == 201
 import qualified GHCbase(Addr(..)) -- to see innards
 IMP_Ubiq(){-uitious-}
-#elif __GLASGOW_HASKELL__ >= 202
-import GlaExts
-import FastString
 #else
 IMP_Ubiq(){-uitious-}
 #endif
index d2492df..8b19bd3 100644 (file)
@@ -29,6 +29,10 @@ import {-# SOURCE #-} CostCentre
 # if __GLASGOW_HASKELL__ == 202
 import PrelBase ( Char(..) )
 # endif
+# if __GLASGOW_HASKELL__ >= 209
+import Addr ( Addr(..) )
+import ST   ( runST )
+# endif
 #endif
 
 import CmdLineOpts     ( opt_IgnoreIfacePragmas )
@@ -540,19 +544,19 @@ lex_tuple cont module_dot buf =
 
 id_arr :: _ByteArray Int
 id_arr =
- unsafePerformPrimIO (
-  newCharArray (0,255) `thenPrimIO` \ barr ->
+ unsafePerformST (
+  newCharArray (0,255) `thenStrictlyST` \ barr ->
   let
-   loop 256# = returnPrimIO ()
+   loop 256# = returnStrictlyST ()
    loop i# =
     if isAlphanum (C# (chr# i#)) || is_sym (chr# i#) then
-       writeCharArray barr (I# i#) '\1' `seqPrimIO`
+       writeCharArray barr (I# i#) '\1' `seqStrictlyST`
        loop (i# +# 1#)
     else
-       writeCharArray barr (I# i#) '\0' `seqPrimIO`
+       writeCharArray barr (I# i#) '\0' `seqStrictlyST`
        loop (i# +# 1#)
   in
-  loop 0#                    `seqPrimIO`
+  loop 0#                    `seqStrictlyST`
   unsafeFreezeByteArray barr)
 
 is_id_char (C# c#) = 
@@ -579,19 +583,19 @@ is_sym c#=
 
 mod_arr :: _ByteArray Int
 mod_arr =
- unsafePerformPrimIO (
-  newCharArray (0,255) `thenPrimIO` \ barr ->
+ unsafePerformST (
+  newCharArray (0,255) `thenStrictlyST` \ barr ->
   let
-   loop 256# = returnPrimIO ()
+   loop 256# = returnStrictlyST ()
    loop i# =
     if isAlphanum (C# (chr# i#)) || i# ==# (ord# '_'#) || i# ==# (ord# '\''#) then
-       writeCharArray barr (I# i#) '\1' `seqPrimIO`
+       writeCharArray barr (I# i#) '\1' `seqStrictlyST`
        loop (i# +# 1#)
     else
-       writeCharArray barr (I# i#) '\0' `seqPrimIO`
+       writeCharArray barr (I# i#) '\0' `seqStrictlyST`
        loop (i# +# 1#)
   in
-  loop 0#                    `seqPrimIO`
+  loop 0#                    `seqStrictlyST`
   unsafeFreezeByteArray barr)
 
              
index 88bd244..5c057fe 100644 (file)
@@ -458,7 +458,7 @@ wlkPat pat
 #if __GLASGOW_HASKELL__ == 201
                 ioToUgnM  (GHCbase.ioToPrimIO (hPutStr stderr msg)) `thenUgn` \ _ ->
                 ioToUgnM  (GHCbase.ioToPrimIO (ghcExit 1))          `thenUgn` \ _ ->
-#elif __GLASGOW_HASKELL__ >= 202
+#elif __GLASGOW_HASKELL__ >= 202 && __GLASGOW_HASKELL__ < 209
                 ioToUgnM  (IOBase.ioToPrimIO (hPutStr stderr msg)) `thenUgn` \ _ ->
                 ioToUgnM  (IOBase.ioToPrimIO (ghcExit 1))           `thenUgn` \ _ ->
 #else