ghc-7.4.2: The GHC API

Safe Haskell | None

MkIface

Description

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

Synopsis

- mkUsedNames :: TcGblEnv -> NameSet
- mkDependencies :: TcGblEnv -> IO Dependencies
- mkIface :: HscEnv -> Maybe Fingerprint -> ModDetails -> ModGuts -> IO (Messages, Maybe (ModIface, Bool))
- mkIfaceTc :: HscEnv -> Maybe Fingerprint -> SafeHaskellMode -> ModDetails -> TcGblEnv -> IO (Messages, Maybe (ModIface, Bool))
- writeIfaceFile :: DynFlags -> ModLocation -> ModIface -> IO ()
- checkOldIface :: HscEnv -> ModSummary -> SourceModified -> Maybe ModIface -> IO (RecompileRequired, Maybe ModIface)
- tyThingToIfaceDecl :: TyThing -> IfaceDecl

# Documentation

mkUsedNames :: TcGblEnv -> NameSet

mkDependencies :: TcGblEnv -> IO Dependencies

Extract information from the rename and typecheck phases to produce a dependencies information for the module being compiled.

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

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

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 -> ModLocation -> ModIface -> IO ()

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

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.

tyThingToIfaceDecl :: TyThing -> IfaceDecl