BinIface

ghc-8.10.2: The GHC API

Safe Haskell | None
Language | Haskell2010

BinIface

Contents

- Public API for interface file serialisation
- Internal serialisation functions

Description

Binary interface file support.

Synopsis

- writeBinIface :: DynFlags -> FilePath -> ModIface -> IO ()
- readBinIface :: CheckHiWay -> TraceBinIFaceReading -> FilePath -> TcRnIf a b ModIface
- getSymtabName :: NameCacheUpdater -> Dictionary -> SymbolTable -> BinHandle -> IO Name
- getDictFastString :: Dictionary -> BinHandle -> IO FastString
- data CheckHiWay
  - = CheckHiWay
  - | IgnoreHiWay
- data TraceBinIFaceReading
  - = TraceBinIFaceReading
  - | QuietBinIFaceReading
- getWithUserData :: Binary a => NameCacheUpdater -> BinHandle -> IO a
- putWithUserData :: Binary a => (SDoc -> IO ()) -> BinHandle -> a -> IO ()
- getSymbolTable :: BinHandle -> NameCacheUpdater -> IO SymbolTable
- putName :: BinDictionary -> BinSymbolTable -> BinHandle -> Name -> IO ()
- putDictionary :: BinHandle -> Int -> UniqFM (Int, FastString) -> IO ()
- putFastString :: BinDictionary -> BinHandle -> FastString -> IO ()
- putSymbolTable :: BinHandle -> Int -> UniqFM (Int, Name) -> IO ()
- data BinSymbolTable = BinSymbolTable {
  - bin_symtab_next :: !FastMutInt
  - bin_symtab_map :: !(IORef (UniqFM (Int, Name)))
  }
- data BinDictionary = BinDictionary {
  - bin_dict_next :: !FastMutInt
  - bin_dict_map :: !(IORef (UniqFM (Int, FastString)))
  }

# Public API for interface file serialisation

writeBinIface :: DynFlags -> FilePath -> ModIface -> IO () Source #

Write an interface file

readBinIface :: CheckHiWay -> TraceBinIFaceReading -> FilePath -> TcRnIf a b ModIface Source #

Read an interface file

getSymtabName :: NameCacheUpdater -> Dictionary -> SymbolTable -> BinHandle -> IO Name Source #

getDictFastString :: Dictionary -> BinHandle -> IO FastString Source #

data CheckHiWay Source #

Constructors

CheckHiWay |
IgnoreHiWay |

#### Instances

Instances details

Eq CheckHiWay # |
Instance details Defined in BinIface Methods (==) :: CheckHiWay -> CheckHiWay -> Bool # (/=) :: CheckHiWay -> CheckHiWay -> Bool #

data TraceBinIFaceReading Source #

Constructors

TraceBinIFaceReading |
QuietBinIFaceReading |

#### Instances

Instances details

Eq TraceBinIFaceReading # |
Instance details Defined in BinIface Methods (==) :: TraceBinIFaceReading -> TraceBinIFaceReading -> Bool # (/=) :: TraceBinIFaceReading -> TraceBinIFaceReading -> Bool #

getWithUserData :: Binary a => NameCacheUpdater -> BinHandle -> IO a Source #

This performs a get action after reading the dictionary and symbol table. It is necessary to run this before trying to deserialise any Names or FastStrings.

putWithUserData :: Binary a => (SDoc -> IO ()) -> BinHandle -> a -> IO () Source #

Put a piece of data with an initialised `UserData` field. This is necessary if you want to serialise Names or FastStrings. It also writes a symbol table and the dictionary. This segment should be read using `getWithUserData`.

# Internal serialisation functions

getSymbolTable :: BinHandle -> NameCacheUpdater -> IO SymbolTable Source #

putName :: BinDictionary -> BinSymbolTable -> BinHandle -> Name -> IO () Source #

putDictionary :: BinHandle -> Int -> UniqFM (Int, FastString) -> IO () Source #

putFastString :: BinDictionary -> BinHandle -> FastString -> IO () Source #

putSymbolTable :: BinHandle -> Int -> UniqFM (Int, Name) -> IO () Source #

data BinSymbolTable Source #

Constructors

BinSymbolTable |
Fields bin_symtab_next :: !FastMutInt bin_symtab_map :: !(IORef (UniqFM (Int, Name)))

data BinDictionary Source #

Constructors

BinDictionary |
Fields bin_dict_next :: !FastMutInt bin_dict_map :: !(IORef (UniqFM (Int, FastString)))