@@ -31,12 +31,13 @@ import Codec.Compression.Zlib (compress)
3131import Util.Zlib (decompressEither)
3232
3333ibcVersion :: Word8
34−ibcVersion = 75
34+ibcVersion = 76
3535
3636data IBCFile = IBCFile { ver :: Word8,
3737 sourcefile :: FilePath,
3838 symbols :: [Name],
3939 ibc_imports :: [FilePath],
40+ ibc_importdirs :: [FilePath],
4041 ibc_implicits :: [(Name, [PArg])],
4142 ibc_fixes :: [FixDecl],
4243 ibc_statics :: [(Name, [Bool])],
@@ -78,7 +79,7 @@ deriving instance Binary IBCFile
7879!-}
7980
8081initIBC :: IBCFile
81−initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing
82+initIBC = IBCFile ibcVersion "" [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] Nothing
8283
8384loadIBC :: FilePath -> Idris ()
8485loadIBC fp = do imps <- getImported
@@ -149,6 +150,7 @@ ibc i (IBCOpt n) f = case lookupCtxt n (idris_optimisation i) of
149150ibc i (IBCSyntax n) f = return f { ibc_syntax = n : ibc_syntax f }
150151ibc i (IBCKeyword n) f = return f { ibc_keywords = n : ibc_keywords f }
151152ibc i (IBCImport n) f = return f { ibc_imports = n : ibc_imports f }
153+ibc i (IBCImportDir n) f = return f { ibc_importdirs = n : ibc_importdirs f }
152154ibc i (IBCObj tgt n) f = return f { ibc_objs = (tgt, n) : ibc_objs f }
153155ibc i (IBCLib tgt n) f = return f { ibc_libs = (tgt, n) : ibc_libs f }
154156ibc i (IBCCGFlag tgt n) f = return f { ibc_cgflags = (tgt, n) : ibc_cgflags f }
@@ -255,6 +257,7 @@ process i fn
255257 v <- verbose
256258 quiet <- getQuiet
257259-- when (v && srcok && not quiet) $ iputStrLn $ "Skipping " ++ sourcefile i
260+ pImportDirs (ibc_importdirs i)
258261 pImports (ibc_imports i)
259262 pImps (ibc_implicits i)
260263 pFixes (ibc_fixes i)
@@ -307,6 +310,9 @@ pParsedSpan :: Maybe FC -> Idris ()
307310pParsedSpan fc = do ist <- getIState
308311 putIState ist { idris_parsedSpan = fc }
309312
313+pImportDirs :: [FilePath] -> Idris ()
314+pImportDirs fs = mapM_ addImportDir fs
315+
310316pImports :: [FilePath] -> Idris ()
311317pImports fs
312318 = do mapM_ (\f -> do i <- getIState
@@ -831,7 +837,7 @@ instance Binary MetaInformation where
831837 return (DataMI x1)
832838
833839instance Binary IBCFile where
834− 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 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38)
840+ 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 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39)
835841 = {-# SCC "putIBCFile" #-}
836842 do put x1
837843 put x2
@@ -871,6 +877,7 @@ instance Binary IBCFile where
871877 put x36
872878 put x37
873879 put x38
880+ put x39
874881
875882 get
876883 = do x1 <- get
@@ -912,7 +919,8 @@ instance Binary IBCFile where
912919 x36 <- get
913920 x37 <- get
914921 x38 <- get
915− 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 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38)
922+ x39 <- get
923+ 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 x25 x26 x27 x28 x29 x30 x31 x32 x33 x34 x35 x36 x37 x38 x39)
916924 else return (initIBC { ver = x1 })
917925
918926instance Binary DataOpt where