Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/83dedf643d17959461478f25f30be5277636f0a3 >--------------------------------------------------------------- commit 83dedf643d17959461478f25f30be5277636f0a3 Author: David Terei <[email protected]> Date: Thu May 5 16:13:21 2011 -0700 SafeHaskell: Fix recompilation avoidance to take Safe into account. >--------------------------------------------------------------- compiler/iface/IfaceSyn.lhs | 2 +- compiler/iface/MkIface.lhs | 8 +++++--- compiler/utils/Binary.hs | 9 +++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/compiler/iface/IfaceSyn.lhs b/compiler/iface/IfaceSyn.lhs index 49fded9..2178381 100644 --- a/compiler/iface/IfaceSyn.lhs +++ b/compiler/iface/IfaceSyn.lhs @@ -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, diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs index a2d3eb1..c2d7401 100644 --- a/compiler/iface/MkIface.lhs +++ b/compiler/iface/MkIface.lhs @@ -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, orphan_hash, dep_orphan_hashes, - 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 $ diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs index 3785957..1981dc8 100644 --- a/compiler/utils/Binary.hs +++ b/compiler/utils/Binary.hs @@ -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 _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
