Commit 83dedf64 authored by dterei's avatar dterei
Browse files

SafeHaskell: Fix recompilation avoidance to take Safe into account.

parent 3a8df611
......@@ -341,7 +341,7 @@ and suppose we are compiling module X:
data T = ...
instance C S T where ...
If we base the instance verion on T, I'm worried that changing S to S'
If we base the instance version on T, I'm worried that changing S to S'
would change T's version, but not S or S'. But an importing module might
not depend on T, and so might not be recompiled even though the new instance
(C S' T) might be relevant. I have not been able to make a concrete example,
......@@ -298,8 +298,6 @@ mkIface_ hsc_env maybe_old_fingerprint
then return ( errs_and_warns, Nothing )
else do {
-- XXX ; when (dopt Opt_D_dump_hi_diffs dflags) (printDump pp_diffs)
-- Debug printing
; dumpIfSet_dyn dflags Opt_D_dump_hi "FINAL INTERFACE"
(pprModIface new_iface)
......@@ -520,9 +518,13 @@ addFingerprints hsc_env mb_old_fingerprint iface0 new_decls
(mi_exports iface0,
dep_pkgs (mi_deps iface0))
dep_pkgs (mi_deps iface0),
-- dep_pkgs: see "Package Version Changes" on
-- wiki/Commentary/Compiler/RecompilationAvoidance
mi_trust iface0)
-- TODO: Can probably make more fine grained. Only
-- really need to have recompilation for overlapping
-- instances.
-- put the declarations in a canonical order, sorted by OccName
let sorted_decls = Map.elems $ Map.fromList $
......@@ -435,6 +435,15 @@ instance (Binary a, Binary b, Binary c, Binary d) => Binary (a,b,c,d) where
d <- get bh
return (a,b,c,d)
instance (Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a,b,c,d, e) where
put_ bh (a,b,c,d, e) = do put_ bh a; put_ bh b; put_ bh c; put_ bh d; put_ bh e;
get bh = do a <- get bh
b <- get bh
c <- get bh
d <- get bh
e <- get bh
return (a,b,c,d,e)
instance Binary a => Binary (Maybe a) where
put_ bh Nothing = putByte bh 0
put_ bh (Just a) = do putByte bh 1; put_ bh a
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment