summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2019-09-24 10:32:05 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-09-25 13:56:07 -0400
commit795986aaf33e2ffc233836b86a92a77366c91db2 (patch)
tree585a901153899c50bfced5a91f605dafa2c3fd7c
parentd90d0bade05fa63b81fe68d42c4242dd97c46e77 (diff)
downloadhaskell-795986aaf33e2ffc233836b86a92a77366c91db2.tar.gz
Remove unneeded CPP now that GHC 8.6 is the minimum
The minimum required GHC version for bootstrapping is 8.6, so we can get rid of some unneeded `#if `__GLASGOW_HASKELL__` CPP guards, as well as one `MIN_VERSION_ghc_prim(0,5,3)` guard (since GHC 8.6 bundles `ghc-prim-0.5.3`).
-rw-r--r--libraries/ghc-heap/GHC/Exts/Heap.hs4
-rw-r--r--libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc8
-rw-r--r--libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc8
-rw-r--r--utils/genprimopcode/ParserM.hs7
4 files changed, 0 insertions, 27 deletions
diff --git a/libraries/ghc-heap/GHC/Exts/Heap.hs b/libraries/ghc-heap/GHC/Exts/Heap.hs
index 54481ccbca..4865dd60c9 100644
--- a/libraries/ghc-heap/GHC/Exts/Heap.hs
+++ b/libraries/ghc-heap/GHC/Exts/Heap.hs
@@ -114,11 +114,7 @@ getClosureRaw x = do
-- This is a hack to cover the bootstrap compiler using the old version of
-- 'unpackClosure'. The new 'unpackClosure' return values are not merely
-- a reordering, so using the old version would not work.
-#if MIN_VERSION_ghc_prim(0,5,3)
(# iptr, dat, pointers #) -> do
-#else
- (# iptr, pointers, dat #) -> do
-#endif
let nelems = (I# (sizeofByteArray# dat)) `div` wORD_SIZE
end = fromIntegral nelems - 1
rawWds = [W# (indexWordArray# dat i) | I# i <- [0.. end] ]
diff --git a/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc b/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc
index 95151b45ee..c700921465 100644
--- a/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc
+++ b/libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc
@@ -38,11 +38,7 @@ peekItbl a0 = do
ptrs' <- (#peek struct StgInfoTable_, layout.payload.ptrs) ptr
nptrs' <- (#peek struct StgInfoTable_, layout.payload.nptrs) ptr
tipe' <- (#peek struct StgInfoTable_, type) ptr
-#if __GLASGOW_HASKELL__ > 804
srtlen' <- (#peek struct StgInfoTable_, srt) a0
-#else
- srtlen' <- (#peek struct StgInfoTable_, srt_bitmap) ptr
-#endif
return StgInfoTable
{ entry = entry'
, ptrs = ptrs'
@@ -60,11 +56,7 @@ pokeItbl a0 itbl = do
(#poke StgInfoTable, layout.payload.ptrs) a0 (ptrs itbl)
(#poke StgInfoTable, layout.payload.nptrs) a0 (nptrs itbl)
(#poke StgInfoTable, type) a0 (toHalfWord (fromEnum (tipe itbl)))
-#if __GLASGOW_HASKELL__ > 804
(#poke StgInfoTable, srt) a0 (srtlen itbl)
-#else
- (#poke StgInfoTable, srt_bitmap) a0 (srtlen itbl)
-#endif
#if defined(TABLES_NEXT_TO_CODE)
let code_offset = a0 `plusPtr` (#offset StgInfoTable, code)
case code itbl of
diff --git a/libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc b/libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc
index 56d7caae70..ded386bb8d 100644
--- a/libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc
+++ b/libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc
@@ -35,11 +35,7 @@ peekItbl a0 = do
ptrs' <- (#peek struct StgInfoTable_, layout.payload.ptrs) ptr
nptrs' <- (#peek struct StgInfoTable_, layout.payload.nptrs) ptr
tipe' <- (#peek struct StgInfoTable_, type) ptr
-#if __GLASGOW_HASKELL__ > 804
srtlen' <- (#peek struct StgInfoTable_, srt) a0
-#else
- srtlen' <- (#peek struct StgInfoTable_, srt_bitmap) ptr
-#endif
return StgInfoTable
{ entry = entry'
, ptrs = ptrs'
@@ -57,11 +53,7 @@ pokeItbl a0 itbl = do
(#poke StgInfoTable, layout.payload.ptrs) a0 (ptrs itbl)
(#poke StgInfoTable, layout.payload.nptrs) a0 (nptrs itbl)
(#poke StgInfoTable, type) a0 (fromEnum (tipe itbl))
-#if __GLASGOW_HASKELL__ > 804
(#poke StgInfoTable, srt) a0 (srtlen itbl)
-#else
- (#poke StgInfoTable, srt_bitmap) a0 (srtlen itbl)
-#endif
#if defined(TABLES_NEXT_TO_CODE)
let code_offset = a0 `plusPtr` (#offset StgInfoTable, code)
case code itbl of
diff --git a/utils/genprimopcode/ParserM.hs b/utils/genprimopcode/ParserM.hs
index 1691bbaefb..e98d6bb11a 100644
--- a/utils/genprimopcode/ParserM.hs
+++ b/utils/genprimopcode/ParserM.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
module ParserM (
-- Parser Monad
ParserM(..), AlexInput, run_parser,
@@ -20,12 +19,8 @@ module ParserM (
import Control.Applicative
-#if __GLASGOW_HASKELL__ >= 806
import Prelude hiding (fail)
import Control.Monad.Fail (MonadFail (..))
-#else
-import Prelude
-#endif
import Control.Monad (ap, liftM)
import Data.Word (Word8)
@@ -50,9 +45,7 @@ instance Monad ParserM where
Left err
return a = ParserM $ \i s -> Right (i, s, a)
-#if __GLASGOW_HASKELL__ >= 806
instance MonadFail ParserM where
-#endif
fail err = ParserM $ \_ _ -> Left err
run_parser :: ParserM a -> (String -> Either String a)