@@ -18,6 +18,8 @@ import Control.Monad.State hiding (get, put)
18import System.FilePath
18import System.FilePath
19import System.Directory
19import System.Directory
21import Paths_idris
23import Paths_idris
23ibcVersion :: Word8
25ibcVersion :: Word8
@@ -48,6 +50,7 @@ data IBCFile = IBCFile { ver :: Word8,
48 ibc_docstrings :: [(Name, String)],
50 ibc_docstrings :: [(Name, String)],
49 ibc_coercions :: [Name]
51 ibc_coercions :: [Name]
52deriving instance Binary IBCFile
55deriving instance Binary IBCFile
@@ -327,16 +330,21 @@ instance Binary FC where
328instance Binary Name where
331instance Binary Name where
333+ = {-# SCC "putName" #-}
330− = case x of
334+ case x of
335+ UN x1 -> {-# SCC "putUN" #-}
331− UN x1 -> do putWord8 0
336+ do putWord8 0
332− put x1
337+ {-# SCC "putNString" #-} put x1
338+ NS x1 x2 -> {-# SCC "putNS" #-}
333− NS x1 x2 -> do putWord8 1
339+ do putWord8 1
342+ MN x1 x2 -> {-# SCC "putMN" #-}
336− MN x1 x2 -> do putWord8 2
343+ do putWord8 2
346+ NErased -> {-# SCC "putNErased" #-}
339− NErased -> putWord8 3
347+ putWord8 3
341 = do i <- getWord8
349 = do i <- getWord8
342 case i of
350 case i of
@@ -528,9 +536,10 @@ instance Binary NameType where
528 _ -> error "Corrupted binary data for NameType"
536 _ -> error "Corrupted binary data for NameType"
531−instance (Binary n) => Binary (TT n) where
539+instance {-(Binary n) =>-} Binary (TT Name) where
541+ = {-# SCC "putTT" #-}
533− = case x of
542+ case x of
534 P x1 x2 x3 -> do putWord8 0
543 P x1 x2 x3 -> do putWord8 0
@@ -613,7 +622,8 @@ instance Binary SC where
614instance Binary CaseAlt where
623instance Binary CaseAlt where
625+ = {-# SCC "putCaseAlt" #-}
616− = case x of
626+ case x of
617 ConCase x1 x2 x3 x4 -> do putWord8 0
627 ConCase x1 x2 x3 x4 -> do putWord8 0
@@ -642,17 +652,16 @@ instance Binary CaseAlt where
643instance Binary Def where
653instance Binary Def where
655+ = {-# SCC "putDef" #-}
645− = case x of
656+ case x of
646 Function x1 x2 -> do putWord8 0
657 Function x1 x2 -> do putWord8 0
649 TyDecl x1 x2 -> do putWord8 1
660 TyDecl x1 x2 -> do putWord8 1
663+ -- all primitives just get added at the start, don't write
652− Operator x1 x2 x3 -> do putWord8 2
664+ Operator x1 x2 x3 -> do return ()
656 CaseOp x1 x2 x3 x3a x4 x5 x6 x7 x8 ->
665 CaseOp x1 x2 x3 x3a x4 x5 x6 x7 x8 ->
657 do putWord8 3
666 do putWord8 3
@@ -750,8 +759,9 @@ instance Binary Totality where
750 _ -> error "Corrupted binary data for Totality"
759 _ -> error "Corrupted binary data for Totality"
752instance Binary IBCFile where
761instance Binary IBCFile where
753− put (IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24)
762+ put x@(IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23 x24)
763+ = {-# SCC "putIBCFile" #-}
754− = do put x1
764+ do put x1