ghc-9.6.3: The GHC API
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Iface.Recomp

Description

Module for detecting if recompilation is required

Synopsis

Documentation

checkOldIface :: HscEnv -> ModSummary -> Maybe ModIface -> IO (MaybeValidated 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 on the outside whether the interface file is up to date, providing evidence that is with a ModIface. In the case that it isn't, we may also return a found or provided ModIface. Why we don't always return the old one, if it exists, is unclear to me, except that I tried it and some tests failed (see #18205).

data MaybeValidated a Source #

Constructors

UpToDateItem a

The item contained is validated to be up to date

OutOfDateItem

The item is are absent altogether or out of date, for the reason given.

Fields

Instances

Instances details
Functor MaybeValidated Source # 
Instance details

Defined in GHC.Iface.Recomp

Methods

fmap :: (a -> b) -> MaybeValidated a -> MaybeValidated b Source #

(<$) :: a -> MaybeValidated b -> MaybeValidated a Source #

Outputable a => Outputable (MaybeValidated a) Source # 
Instance details

Defined in GHC.Iface.Recomp

Methods

ppr :: MaybeValidated a -> SDoc Source #

data CompileReason Source #

Constructors

MustCompile

The .hs file has been touched, or the .o/.hi file does not exist

RecompBecause !RecompReason

The .o/.hi files are up to date, but something else has changed to force recompilation; the String says what (one-line summary)

Instances

Instances details
Outputable CompileReason Source # 
Instance details

Defined in GHC.Iface.Recomp

Eq CompileReason Source # 
Instance details

Defined in GHC.Iface.Recomp

addFingerprints :: HscEnv -> PartialModIface -> IO ModIface Source #

Add fingerprints for top-level declarations to a ModIface.

See Note [Fingerprinting IfaceDecls]