Commit 795986aa authored by Ryan Scott's avatar Ryan Scott Committed by Marge Bot
Browse files

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`).
parent d90d0bad
Pipeline #10596 failed with stages
in 366 minutes and 48 seconds
......@@ -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] ]
......
......@@ -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
......
......@@ -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
......
{-# 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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment