From 446a82f58ad1d7d3f562420262985a6a84e1e2f0 Mon Sep 17 00:00:00 2001 From: sof Date: Mon, 24 Nov 1997 20:11:57 +0000 Subject: [PATCH] [project @ 1997-11-24 20:10:33 by sof] fix to have it compile with 2.09 (and later) --- ghc/compiler/nativeGen/MachRegs.lhs | 5 ----- ghc/compiler/nativeGen/PprMach.lhs | 3 --- ghc/compiler/reader/Lex.lhs | 28 ++++++++++++++++------------ ghc/compiler/reader/ReadPrefix.lhs | 2 +- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/ghc/compiler/nativeGen/MachRegs.lhs b/ghc/compiler/nativeGen/MachRegs.lhs index 00e16b7..d772c90 100644 --- a/ghc/compiler/nativeGen/MachRegs.lhs +++ b/ghc/compiler/nativeGen/MachRegs.lhs @@ -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 ) diff --git a/ghc/compiler/nativeGen/PprMach.lhs b/ghc/compiler/nativeGen/PprMach.lhs index 1ac24d0..617ba89 100644 --- a/ghc/compiler/nativeGen/PprMach.lhs +++ b/ghc/compiler/nativeGen/PprMach.lhs @@ -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 diff --git a/ghc/compiler/reader/Lex.lhs b/ghc/compiler/reader/Lex.lhs index d2492df..8b19bd3 100644 --- a/ghc/compiler/reader/Lex.lhs +++ b/ghc/compiler/reader/Lex.lhs @@ -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) diff --git a/ghc/compiler/reader/ReadPrefix.lhs b/ghc/compiler/reader/ReadPrefix.lhs index 88bd244..5c057fe 100644 --- a/ghc/compiler/reader/ReadPrefix.lhs +++ b/ghc/compiler/reader/ReadPrefix.lhs @@ -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 -- 1.7.10.4