GHC.Iface.Recomp

ghc-9.2.0.20210331: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Iface.Recomp

Description

Module for detecting if recompilation is required

Synopsis

- checkOldIface :: HscEnv -> ModSummary -> SourceModified -> Maybe ModIface -> IO (RecompileRequired, Maybe ModIface)
- data RecompileRequired
  - = UpToDate
  - | MustCompile
  - | RecompBecause String
- recompileRequired :: RecompileRequired -> Bool
- addFingerprints :: HscEnv -> PartialModIface -> IO ModIface

# Documentation

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 Nothing means to rebuild the interface file and not use the existing 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

Instances details

Monoid RecompileRequired # |
Instance details Defined in GHC.Iface.Recomp Methods mempty :: RecompileRequired Source # mappend :: RecompileRequired -> RecompileRequired -> RecompileRequired Source # mconcat :: [RecompileRequired] -> RecompileRequired Source #
Semigroup RecompileRequired # |
Instance details Defined in GHC.Iface.Recomp Methods (<>) :: RecompileRequired -> RecompileRequired -> RecompileRequired Source # sconcat :: NonEmpty RecompileRequired -> RecompileRequired Source # stimes :: Integral b => b -> RecompileRequired -> RecompileRequired Source #
Eq RecompileRequired # |
Instance details Defined in GHC.Iface.Recomp Methods (==) :: RecompileRequired -> RecompileRequired -> Bool # (/=) :: RecompileRequired -> RecompileRequired -> Bool #

recompileRequired :: RecompileRequired -> Bool Source #

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

Add fingerprints for top-level declarations to a `ModIface_`.

See Note [Fingerprinting IfaceDecls]