never executed always true always false
1 module GHC.Unit.Module.Status
2 ( HscBackendAction(..), HscRecompStatus (..)
3 )
4 where
5
6 import GHC.Prelude
7
8 import GHC.Unit
9 import GHC.Unit.Module.ModGuts
10 import GHC.Unit.Module.ModIface
11
12 import GHC.Utils.Fingerprint
13 import GHC.Linker.Types
14 import GHC.Utils.Outputable
15
16 -- | Status of a module in incremental compilation
17 data HscRecompStatus
18 -- | Nothing to do because code already exists.
19 = HscUpToDate ModIface (Maybe Linkable)
20 -- | Recompilation of module, or update of interface is required. Optionally
21 -- pass the old interface hash to avoid updating the existing interface when
22 -- it has not changed.
23 | HscRecompNeeded (Maybe Fingerprint)
24
25 -- | Action to perform in backend compilation
26 data HscBackendAction
27 -- | Update the boot and signature file results.
28 = HscUpdate ModIface
29 -- | Recompile this module.
30 | HscRecomp
31 { hscs_guts :: CgGuts
32 -- ^ Information for the code generator.
33 , hscs_mod_location :: !ModLocation
34 -- ^ Module info
35 , hscs_partial_iface :: !PartialModIface
36 -- ^ Partial interface
37 , hscs_old_iface_hash :: !(Maybe Fingerprint)
38 -- ^ Old interface hash for this compilation, if an old interface file
39 -- exists. Pass to `hscMaybeWriteIface` when writing the interface to
40 -- avoid updating the existing interface when the interface isn't
41 -- changed.
42 }
43
44
45 instance Outputable HscBackendAction where
46 ppr (HscUpdate mi) = text "Update:" <+> (ppr (mi_module mi))
47 ppr (HscRecomp _ ml _mi _mf) = text "Recomp:" <+> ppr ml