diff options
Diffstat (limited to 'compiler/GHC/Unit/Module/ModIface.hs')
-rw-r--r-- | compiler/GHC/Unit/Module/ModIface.hs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/compiler/GHC/Unit/Module/ModIface.hs b/compiler/GHC/Unit/Module/ModIface.hs index 18101e309b..695e1ff6c2 100644 --- a/compiler/GHC/Unit/Module/ModIface.hs +++ b/compiler/GHC/Unit/Module/ModIface.hs @@ -242,13 +242,17 @@ data ModIface_ (phase :: ModIfacePhase) -- ^ Either `()` or `ModIfaceBackend` for -- a fully instantiated interface. - mi_ext_fields :: ExtensibleFields + mi_ext_fields :: ExtensibleFields, -- ^ Additional optional fields, where the Map key represents -- the field name, resulting in a (size, serialized data) pair. -- Because the data is intended to be serialized through the -- internal `Binary` class (increasing compatibility with types -- using `Name` and `FastString`, such as HIE), this format is -- chosen over `ByteString`s. + -- + + mi_src_hash :: !Fingerprint + -- ^ Hash of the .hs source, used for recompilation checking. } -- | Old-style accessor for whether or not the ModIface came from an hs-boot @@ -305,6 +309,9 @@ instance Binary ModIface where mi_module = mod, mi_sig_of = sig_of, mi_hsc_src = hsc_src, + mi_src_hash = _src_hash, -- Don't `put_` this in the instance + -- because we are going to write it + -- out separately in the actual file mi_deps = deps, mi_usages = usages, mi_exports = exports, @@ -406,6 +413,8 @@ instance Binary ModIface where mi_module = mod, mi_sig_of = sig_of, mi_hsc_src = hsc_src, + mi_src_hash = fingerprint0, -- placeholder because this is dealt + -- with specially when the file is read mi_deps = deps, mi_usages = usages, mi_exports = exports, @@ -452,6 +461,7 @@ emptyPartialModIface mod = ModIface { mi_module = mod, mi_sig_of = Nothing, mi_hsc_src = HsSrcFile, + mi_src_hash = fingerprint0, mi_deps = noDependencies, mi_usages = [], mi_exports = [], @@ -512,11 +522,11 @@ emptyIfaceHashCache _occ = Nothing -- avoid major space leaks. instance (NFData (IfaceBackendExts (phase :: ModIfacePhase)), NFData (IfaceDeclExts (phase :: ModIfacePhase))) => NFData (ModIface_ phase) where rnf (ModIface f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 - f13 f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24) = + f13 f14 f15 f16 f17 f18 f19 f20 f21 f22 f23 f24 f25) = rnf f1 `seq` rnf f2 `seq` f3 `seq` f4 `seq` f5 `seq` f6 `seq` rnf f7 `seq` f8 `seq` f9 `seq` rnf f10 `seq` rnf f11 `seq` f12 `seq` rnf f13 `seq` rnf f14 `seq` rnf f15 `seq` rnf f16 `seq` f17 `seq` rnf f18 `seq` rnf f19 `seq` f20 `seq` f21 `seq` f22 `seq` rnf f23 - `seq` rnf f24 + `seq` rnf f24 `seq` f25 `seq` () -- | Records whether a module has orphans. An \"orphan\" is one of: -- |