From: Ian Lynagh Date: Wed, 15 Dec 2010 20:10:06 +0000 (+0000) Subject: Remove code that is dead now that we need >= 6.12 to build X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=edc0bafd3fcd01b85a2e8894e5dfe149eb0e0857 Remove code that is dead now that we need >= 6.12 to build --- diff --git a/compiler/basicTypes/OccName.lhs b/compiler/basicTypes/OccName.lhs index 9ff53f1..439a2f8 100644 --- a/compiler/basicTypes/OccName.lhs +++ b/compiler/basicTypes/OccName.lhs @@ -107,16 +107,6 @@ import Data.Char import Data.Data \end{code} -\begin{code} --- Unicode TODO: put isSymbol in libcompat -#if !defined(__GLASGOW_HASKELL__) || __GLASGOW_HASKELL__ > 604 -#else -isSymbol :: a -> Bool -isSymbol = const False -#endif - -\end{code} - %************************************************************************ %* * \subsection{Name space} diff --git a/compiler/basicTypes/UniqSupply.lhs b/compiler/basicTypes/UniqSupply.lhs index a4c16fd..493bfbe 100644 --- a/compiler/basicTypes/UniqSupply.lhs +++ b/compiler/basicTypes/UniqSupply.lhs @@ -31,11 +31,7 @@ import FastTypes import MonadUtils import Control.Monad -#if __GLASGOW_HASKELL__ >= 611 import GHC.IO (unsafeDupableInterleaveIO) -#else -import GHC.IOBase (unsafeDupableInterleaveIO) -#endif \end{code} diff --git a/compiler/cmm/CmmBuildInfoTables.hs b/compiler/cmm/CmmBuildInfoTables.hs index 0778e7c..4e3879f 100644 --- a/compiler/cmm/CmmBuildInfoTables.hs +++ b/compiler/cmm/CmmBuildInfoTables.hs @@ -1,6 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 611 {-# OPTIONS_GHC -XNoMonoLocalBinds #-} -#endif -- Norman likes local bindings -- If this module lives on I'd like to get rid of this flag in due course diff --git a/compiler/cmm/CmmCPSZ.hs b/compiler/cmm/CmmCPSZ.hs index d74da69..23e57d7 100644 --- a/compiler/cmm/CmmCPSZ.hs +++ b/compiler/cmm/CmmCPSZ.hs @@ -1,6 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 611 {-# OPTIONS_GHC -XNoMonoLocalBinds #-} -#endif -- Norman likes local bindings -- If this module lives on I'd like to get rid of this flag in due course diff --git a/compiler/cmm/CmmSpillReload.hs b/compiler/cmm/CmmSpillReload.hs index a8839a8..c457383 100644 --- a/compiler/cmm/CmmSpillReload.hs +++ b/compiler/cmm/CmmSpillReload.hs @@ -1,6 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 611 {-# OPTIONS_GHC -XNoMonoLocalBinds #-} -#endif -- Norman likes local bindings -- If this module lives on I'd like to get rid of this flag in due course diff --git a/compiler/cmm/CmmStackLayout.hs b/compiler/cmm/CmmStackLayout.hs index 847019c..df1b89c 100644 --- a/compiler/cmm/CmmStackLayout.hs +++ b/compiler/cmm/CmmStackLayout.hs @@ -1,6 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 611 {-# OPTIONS_GHC -XNoMonoLocalBinds #-} -#endif -- Norman likes local bindings -- If this module lives on I'd like to get rid of this flag in due course diff --git a/compiler/cmm/ZipCfgCmmRep.hs b/compiler/cmm/ZipCfgCmmRep.hs index aa16f0b..0f00641 100644 --- a/compiler/cmm/ZipCfgCmmRep.hs +++ b/compiler/cmm/ZipCfgCmmRep.hs @@ -1,6 +1,4 @@ -#if __GLASGOW_HASKELL__ >= 611 {-# OPTIONS_GHC -XNoMonoLocalBinds #-} -#endif -- Norman likes local bindings -- This module is pure representation and should be imported only by diff --git a/compiler/ghci/RtClosureInspect.hs b/compiler/ghci/RtClosureInspect.hs index 5d74dc9..597a9a7 100644 --- a/compiler/ghci/RtClosureInspect.hs +++ b/compiler/ghci/RtClosureInspect.hs @@ -59,12 +59,7 @@ import Constants ( wORD_SIZE ) import GHC.Arr ( Array(..) ) import GHC.Exts - -#if __GLASGOW_HASKELL__ >= 611 import GHC.IO ( IO(..) ) -#else -import GHC.IOBase ( IO(..) ) -#endif import Control.Monad import Data.Maybe diff --git a/compiler/main/BreakArray.hs b/compiler/main/BreakArray.hs index 2d1a4d4..4d2c07b 100644 --- a/compiler/main/BreakArray.hs +++ b/compiler/main/BreakArray.hs @@ -26,11 +26,7 @@ module BreakArray ) where #ifdef GHCI import GHC.Exts -#if __GLASGOW_HASKELL__ >= 611 import GHC.IO ( IO(..) ) -#else -import GHC.IOBase ( IO(..) ) -#endif import Constants data BreakArray = BA (MutableByteArray# RealWorld) diff --git a/compiler/parser/cutils.c b/compiler/parser/cutils.c index 157c902..c42ec9e 100644 --- a/compiler/parser/cutils.c +++ b/compiler/parser/cutils.c @@ -4,9 +4,6 @@ places in the GHC library. */ #include "Rts.h" -#if __GLASGOW_HASKELL__ <= 610 -#include "RtsFlags.h" -#endif #include "HsFFI.h" diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs index 249480a..3785957 100644 --- a/compiler/utils/Binary.hs +++ b/compiler/utils/Binary.hs @@ -81,12 +81,7 @@ import System.IO.Error ( mkIOError, eofErrorType ) import GHC.Real ( Ratio(..) ) import GHC.Exts import GHC.Word ( Word8(..) ) - -#if __GLASGOW_HASKELL__ >= 611 import GHC.IO ( IO(..) ) -#else -import GHC.IOBase ( IO(..) ) -#endif type BinArray = ForeignPtr Word8 diff --git a/compiler/utils/Digraph.lhs b/compiler/utils/Digraph.lhs index 2ed3933..a341bde 100644 --- a/compiler/utils/Digraph.lhs +++ b/compiler/utils/Digraph.lhs @@ -50,12 +50,7 @@ import Control.Monad.ST import Data.Maybe import Data.Array import Data.List ( (\\) ) - -#if !defined(__GLASGOW_HASKELL__) || __GLASGOW_HASKELL__ > 604 import Data.Array.ST -#else -import Data.Array.ST hiding ( indices, bounds ) -#endif \end{code} %************************************************************************ diff --git a/compiler/utils/FastFunctions.lhs b/compiler/utils/FastFunctions.lhs index d6a282f..5496ed0 100644 --- a/compiler/utils/FastFunctions.lhs +++ b/compiler/utils/FastFunctions.lhs @@ -22,19 +22,7 @@ import System.IO.Unsafe import GHC.Exts import GHC.Word - -#if __GLASGOW_HASKELL__ >= 611 -import GHC.IO ( IO(..) ) -#else -import GHC.IOBase ( IO(..) ) -#endif - -#if __GLASGOW_HASKELL__ >= 611 -import GHC.IO (unsafeDupableInterleaveIO) -#else -import GHC.IOBase (unsafeDupableInterleaveIO) -#endif - +import GHC.IO (IO(..), unsafeDupableInterleaveIO) import GHC.Base (unsafeChr) -- Just like unsafePerformIO, but we inline it. diff --git a/compiler/utils/FastMutInt.lhs b/compiler/utils/FastMutInt.lhs index 61e3e85..2618307 100644 --- a/compiler/utils/FastMutInt.lhs +++ b/compiler/utils/FastMutInt.lhs @@ -28,12 +28,6 @@ module FastMutInt( import GHC.Base import GHC.Ptr -#if __GLASGOW_HASKELL__ >= 611 --- import GHC.IO ( IO(..) ) -#else -import GHC.IOBase ( IO(..) ) -#endif - #else /* ! __GLASGOW_HASKELL__ */ import Data.IORef diff --git a/compiler/utils/FastString.lhs b/compiler/utils/FastString.lhs index dafdf6a..c6dac8f 100644 --- a/compiler/utils/FastString.lhs +++ b/compiler/utils/FastString.lhs @@ -106,11 +106,7 @@ import Data.IORef ( IORef, newIORef, readIORef, writeIORef ) import Data.Maybe ( isJust ) import Data.Char ( ord ) -#if __GLASGOW_HASKELL__ >= 611 import GHC.IO ( IO(..) ) -#else -import GHC.IOBase ( IO(..) ) -#endif import GHC.Ptr ( Ptr(..) ) #if defined(__GLASGOW_HASKELL__) diff --git a/compiler/utils/Serialized.hs b/compiler/utils/Serialized.hs index 95a09b9..26cca6c 100644 --- a/compiler/utils/Serialized.hs +++ b/compiler/utils/Serialized.hs @@ -82,11 +82,7 @@ serializeConstr :: ConstrRep -> [Word8] -> [Word8] serializeConstr (AlgConstr ix) = serializeWord8 1 . serializeInt ix serializeConstr (IntConstr i) = serializeWord8 2 . serializeInteger i serializeConstr (FloatConstr r) = serializeWord8 3 . serializeRational r -#if __GLASGOW_HASKELL__ < 611 -serializeConstr (StringConstr s) = serializeWord8 4 . serializeString s -#else serializeConstr (CharConstr c) = serializeWord8 4 . serializeChar c -#endif deserializeConstr :: [Word8] -> (ConstrRep -> [Word8] -> a) -> a @@ -95,11 +91,7 @@ deserializeConstr bytes k = deserializeWord8 bytes $ \constr_ix bytes -> 1 -> deserializeInt bytes $ \ix -> k (AlgConstr ix) 2 -> deserializeInteger bytes $ \i -> k (IntConstr i) 3 -> deserializeRational bytes $ \r -> k (FloatConstr r) -#if __GLASGOW_HASKELL__ >= 611 4 -> deserializeChar bytes $ \c -> k (CharConstr c) -#else - 4 -> deserializeString bytes $ \s -> k (StringConstr s) -#endif x -> error $ "deserializeConstr: unrecognised serialized constructor type " ++ show x ++ " in context " ++ show bytes @@ -158,13 +150,11 @@ deserializeInteger :: [Word8] -> (Integer -> [Word8] -> a) -> a deserializeInteger bytes k = deserializeString bytes (k . read) -#if __GLASGOW_HASKELL__ >= 611 serializeChar :: Char -> [Word8] -> [Word8] serializeChar = serializeString . show deserializeChar :: [Word8] -> (Char -> [Word8] -> a) -> a deserializeChar bytes k = deserializeString bytes (k . read) -#endif serializeString :: String -> [Word8] -> [Word8] diff --git a/compiler/utils/UniqFM.lhs b/compiler/utils/UniqFM.lhs index 19b1428..293e48e 100644 --- a/compiler/utils/UniqFM.lhs +++ b/compiler/utils/UniqFM.lhs @@ -183,20 +183,7 @@ plusUFM (UFM x) (UFM y) = UFM (M.union y x) plusUFM_C f (UFM x) (UFM y) = UFM (M.unionWith f x y) minusUFM (UFM x) (UFM y) = UFM (M.difference x y) intersectUFM (UFM x) (UFM y) = UFM (M.intersection x y) -#if __GLASGOW_HASKELL__ >= 611 intersectUFM_C f (UFM x) (UFM y) = UFM (M.intersectionWith f x y) -#else --- In GHC 6.10, intersectionWith is (a -> b -> a) instead of (a -> b -> c), --- so we need to jump through some hoops to get the more general type. -intersectUFM_C f (UFM x) (UFM y) = UFM z - where z = let x' = M.map Left x - f' (Left a) b = Right (f a b) - f' (Right _) _ = panic "intersectUFM_C: f': Right" - z' = M.intersectionWith f' x' y - fromRight (Right a) = a - fromRight _ = panic "intersectUFM_C: Left" - in M.map fromRight z' -#endif foldUFM k z (UFM m) = M.fold k z m foldUFM_Directly k z (UFM m) = M.foldWithKey (k . getUnique) z m diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs index e019f67..55a1a4f5 100644 --- a/compiler/utils/Util.lhs +++ b/compiler/utils/Util.lhs @@ -1019,11 +1019,3 @@ abstractDataType :: String -> DataType abstractDataType n = mkDataType n [abstractConstr n] \end{code} -\begin{code} --- Old GHC versions come with a base library with this function misspelled. -#if __GLASGOW_HASKELL__ < 612 -mkNoRepType :: String -> DataType -mkNoRepType = mkNorepType -#endif -\end{code} - diff --git a/compiler/vectorise/Vectorise/Type/Env.hs b/compiler/vectorise/Vectorise/Type/Env.hs index 43ff97c..99c1746 100644 --- a/compiler/vectorise/Vectorise/Type/Env.hs +++ b/compiler/vectorise/Vectorise/Type/Env.hs @@ -1,7 +1,5 @@ {-# OPTIONS_GHC -fno-warn-missing-signatures #-} -#if __GLASGOW_HASKELL__ >= 611 {-# OPTIONS_GHC -XNoMonoLocalBinds #-} -#endif -- Roman likes local bindings -- If this module lives on I'd like to get rid of this flag in due course