diff options
Diffstat (limited to 'compiler/utils/Binary.hs')
-rw-r--r-- | compiler/utils/Binary.hs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs index 4f48a424b3..c61f8a6baa 100644 --- a/compiler/utils/Binary.hs +++ b/compiler/utils/Binary.hs @@ -67,6 +67,7 @@ import Panic import UniqFM import FastMutInt import Fingerprint +import BasicTypes import Foreign import Data.Array @@ -726,3 +727,13 @@ instance Binary Fingerprint where put_ h (Fingerprint w1 w2) = do put_ h w1; put_ h w2 get h = do w1 <- get h; w2 <- get h; return (Fingerprint w1 w2) +instance Binary FunctionOrData where + put_ bh IsFunction = putByte bh 0 + put_ bh IsData = putByte bh 1 + get bh = do + h <- getByte bh + case h of + 0 -> return IsFunction + 1 -> return IsData + _ -> panic "Binary FunctionOrData" + |