@@ -21,7 +21,7 @@ import System.Directory
21import Paths_idris
21import Paths_idris
23ibcVersion :: Word8
23ibcVersion :: Word8
24−ibcVersion = 27
24+ibcVersion = 28
26data IBCFile = IBCFile { ver :: Word8,
26data IBCFile = IBCFile { ver :: Word8,
27 sourcefile :: FilePath,
27 sourcefile :: FilePath,
@@ -38,6 +38,7 @@ data IBCFile = IBCFile { ver :: Word8,
38 ibc_keywords :: [String],
38 ibc_keywords :: [String],
39 ibc_objs :: [FilePath],
39 ibc_objs :: [FilePath],
40 ibc_libs :: [String],
40 ibc_libs :: [String],
41+ ibc_dynamic_libs :: [String],
41 ibc_hdrs :: [String],
42 ibc_hdrs :: [String],
42 ibc_access :: [(Name, Accessibility)],
43 ibc_access :: [(Name, Accessibility)],
43 ibc_total :: [(Name, Totality)],
44 ibc_total :: [(Name, Totality)],
@@ -52,7 +53,7 @@ deriving instance Binary IBCFile
54initIBC :: IBCFile
55initIBC :: IBCFile
55−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
56+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] []
57loadIBC :: FilePath -> Idris ()
58loadIBC :: FilePath -> Idris ()
58loadIBC fp = do iLOG $ "Loading ibc " ++ fp
59loadIBC fp = do iLOG $ "Loading ibc " ++ fp
@@ -110,6 +111,7 @@ ibc i (IBCKeyword n) f = return f { ibc_keywords = n : ibc_keywords f }
110ibc i (IBCImport n) f = return f { ibc_imports = n : ibc_imports f }
111ibc i (IBCImport n) f = return f { ibc_imports = n : ibc_imports f }
111ibc i (IBCObj n) f = return f { ibc_objs = n : ibc_objs f }
112ibc i (IBCObj n) f = return f { ibc_objs = n : ibc_objs f }
112ibc i (IBCLib n) f = return f { ibc_libs = n : ibc_libs f }
113ibc i (IBCLib n) f = return f { ibc_libs = n : ibc_libs f }
114+ibc i (IBCDyLib n) f = return f {ibc_dynamic_libs = n : ibc_dynamic_libs f }
113ibc i (IBCHeader n) f = return f { ibc_hdrs = n : ibc_hdrs f }
115ibc i (IBCHeader n) f = return f { ibc_hdrs = n : ibc_hdrs f }
114ibc i (IBCDef n) f = case lookupDef Nothing n (tt_ctxt i) of
116ibc i (IBCDef n) f = case lookupDef Nothing n (tt_ctxt i) of
115 [v] -> return f { ibc_defs = (n,v) : ibc_defs f }
117 [v] -> return f { ibc_defs = (n,v) : ibc_defs f }
@@ -147,6 +149,7 @@ process i fn
147 pKeywords (ibc_keywords i)
149 pKeywords (ibc_keywords i)
148 pObjs (ibc_objs i)
150 pObjs (ibc_objs i)
149 pLibs (ibc_libs i)
151 pLibs (ibc_libs i)
152+ pDyLibs (ibc_dynamic_libs i)
150 pHdrs (ibc_hdrs i)
153 pHdrs (ibc_hdrs i)
151 pDefs (ibc_defs i)
154 pDefs (ibc_defs i)
152 pAccess (ibc_access i)
155 pAccess (ibc_access i)
@@ -242,6 +245,9 @@ pObjs os = mapM_ addObjectFile os
242pLibs :: [String] -> Idris ()
245pLibs :: [String] -> Idris ()
243pLibs ls = mapM_ addLib ls
246pLibs ls = mapM_ addLib ls
248+pDyLibs :: [String] -> Idris ()
249+pDyLibs ls = mapM_ addDyLib ls
245pHdrs :: [String] -> Idris ()
251pHdrs :: [String] -> Idris ()
246pHdrs hs = mapM_ addHdr hs
252pHdrs hs = mapM_ addHdr hs
@@ -744,7 +750,7 @@ instance Binary Totality where
744 _ -> error "Corrupted binary data for Totality"
750 _ -> error "Corrupted binary data for Totality"
746instance Binary IBCFile where
752instance Binary IBCFile where
747− 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)
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)
748 = do put x1
754 = do put x1
@@ -768,6 +774,7 @@ instance Binary IBCFile where
772 = do x1 <- get
779 = do x1 <- get
773 if x1 == ibcVersion then
780 if x1 == ibcVersion then
@@ -793,7 +800,8 @@ instance Binary IBCFile where
793 x21 <- get
800 x21 <- get
794 x22 <- get
801 x22 <- get
795 x23 <- get
802 x23 <- get
796− return (IBCFile x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 x14 x15 x16 x17 x18 x19 x20 x21 x22 x23)
804+ return (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)
797 else return (initIBC { ver = x1 })
805 else return (initIBC { ver = x1 })
799instance Binary FnOpt where
807instance Binary FnOpt where