diff options
Diffstat (limited to 'compiler/GHC/Utils')
-rw-r--r-- | compiler/GHC/Utils/Binary.hs | 1 | ||||
-rw-r--r-- | compiler/GHC/Utils/Binary/Typeable.hs | 13 |
2 files changed, 13 insertions, 1 deletions
diff --git a/compiler/GHC/Utils/Binary.hs b/compiler/GHC/Utils/Binary.hs index ce533ed127..5ee0806cc1 100644 --- a/compiler/GHC/Utils/Binary.hs +++ b/compiler/GHC/Utils/Binary.hs @@ -876,7 +876,6 @@ instance Binary (Bin a) where get bh = do i <- getWord32 bh; return (BinPtr (fromIntegral (i :: Word32))) - -- ----------------------------------------------------------------------------- -- Lazy reading/writing diff --git a/compiler/GHC/Utils/Binary/Typeable.hs b/compiler/GHC/Utils/Binary/Typeable.hs index c5b89bf35a..ebee92e211 100644 --- a/compiler/GHC/Utils/Binary/Typeable.hs +++ b/compiler/GHC/Utils/Binary/Typeable.hs @@ -22,6 +22,9 @@ import GHC.Prelude import GHC.Utils.Binary import GHC.Exts (TYPE, RuntimeRep(..), VecCount(..), VecElem(..)) +#if __GLASGOW_HASKELL__ >= 901 +import GHC.Exts (Levity(Lifted, Unlifted)) +#endif import GHC.Serialized import Foreign @@ -115,8 +118,13 @@ instance Binary RuntimeRep where put_ bh (VecRep a b) = putByte bh 0 >> put_ bh a >> put_ bh b put_ bh (TupleRep reps) = putByte bh 1 >> put_ bh reps put_ bh (SumRep reps) = putByte bh 2 >> put_ bh reps +#if __GLASGOW_HASKELL__ >= 901 + put_ bh (BoxedRep Lifted) = putByte bh 3 + put_ bh (BoxedRep Unlifted) = putByte bh 4 +#else put_ bh LiftedRep = putByte bh 3 put_ bh UnliftedRep = putByte bh 4 +#endif put_ bh IntRep = putByte bh 5 put_ bh WordRep = putByte bh 6 put_ bh Int64Rep = putByte bh 7 @@ -139,8 +147,13 @@ instance Binary RuntimeRep where 0 -> VecRep <$> get bh <*> get bh 1 -> TupleRep <$> get bh 2 -> SumRep <$> get bh +#if __GLASGOW_HASKELL__ >= 901 + 3 -> pure (BoxedRep Lifted) + 4 -> pure (BoxedRep Unlifted) +#else 3 -> pure LiftedRep 4 -> pure UnliftedRep +#endif 5 -> pure IntRep 6 -> pure WordRep 7 -> pure Int64Rep |