MkIface

ghc-8.4.1: The GHC API

Safe Haskell | None
Language | Haskell2010

MkIface

Description

Module for constructing `ModIface` values (interface files), writing them to disk and comparing two versions to see if recompilation is required.

Synopsis

- mkIface :: HscEnv -> Maybe Fingerprint -> ModDetails -> ModGuts -> IO (ModIface, Bool)
- mkIfaceTc :: HscEnv -> Maybe Fingerprint -> SafeHaskellMode -> ModDetails -> TcGblEnv -> IO (ModIface, Bool)
- writeIfaceFile :: DynFlags -> FilePath -> ModIface -> IO ()
- checkOldIface :: HscEnv -> ModSummary -> SourceModified -> Maybe ModIface -> IO (RecompileRequired, Maybe ModIface)
- data RecompileRequired
  - = UpToDate
  - | MustCompile
  - | RecompBecause String
- recompileRequired :: RecompileRequired -> Bool
- mkIfaceExports :: [AvailInfo] -> [IfaceExport]
- tyThingToIfaceDecl :: TyThing -> IfaceDecl

# Documentation

mkIface :: HscEnv -> Maybe Fingerprint -> ModDetails -> ModGuts -> IO (ModIface, Bool) Source #

mkIfaceTc :: HscEnv -> Maybe Fingerprint -> SafeHaskellMode -> ModDetails -> TcGblEnv -> IO (ModIface, Bool) Source #

make an interface from the results of typechecking only. Useful for non-optimising compilation, or where we aren't generating any object code at all (`HscNothing`).

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

checkOldIface :: HscEnv -> ModSummary -> SourceModified -> Maybe ModIface -> IO (RecompileRequired, Maybe ModIface) Source #

Top level function to check if the version of an old interface file is equivalent to the current source file the user asked us to compile. If the same, we can avoid recompilation. We return a tuple where the first element is a bool saying if we should recompile the object file and the second is maybe the interface file, where Nothng means to rebuild the interface file not use the exisitng one.

data RecompileRequired Source #

Constructors

UpToDate | everything is up to date, recompilation is not required
MustCompile | The .hs file has been touched, or the .o/.hi file does not exist
RecompBecause String | The .o/.hi files are up to date, but something else has changed to force recompilation; the String says what (one-line summary)

Instances

Eq RecompileRequired Source # |
Instance details Methods (==) :: RecompileRequired -> RecompileRequired -> Bool # (/=) :: RecompileRequired -> RecompileRequired -> Bool #

recompileRequired :: RecompileRequired -> Bool Source #

mkIfaceExports :: [AvailInfo] -> [IfaceExport] Source #

tyThingToIfaceDecl :: TyThing -> IfaceDecl Source #