Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/eda2c7316883e7d107755c08ad696e669ead0447 >--------------------------------------------------------------- commit eda2c7316883e7d107755c08ad696e669ead0447 Author: Simon Marlow <[email protected]> Date: Thu Feb 16 09:34:43 2012 +0000 Be less conservative about recompiling after changes to -main-is (#5878) >--------------------------------------------------------------- compiler/iface/FlagChecker.hs | 7 ++++--- compiler/iface/MkIface.lhs | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/compiler/iface/FlagChecker.hs b/compiler/iface/FlagChecker.hs index 5e4a709..fecd001 100644 --- a/compiler/iface/FlagChecker.hs +++ b/compiler/iface/FlagChecker.hs @@ -10,6 +10,7 @@ import Binary import BinIface () import DynFlags import HscTypes +import Module import Name import Fingerprint -- import Outputable @@ -21,11 +22,11 @@ import System.FilePath (normalise) -- | Produce a fingerprint of a @DynFlags@ value. We only base -- the finger print on important fields in @DynFlags@ so that -- the recompilation checker can use this fingerprint. -fingerprintDynFlags :: DynFlags -> (BinHandle -> Name -> IO ()) +fingerprintDynFlags :: DynFlags -> Module -> (BinHandle -> Name -> IO ()) -> IO Fingerprint -fingerprintDynFlags DynFlags{..} nameio = - let mainis = (mainModIs, mainFunIs) +fingerprintDynFlags DynFlags{..} this_mod nameio = + let mainis = mainModIs == this_mod -- see #5878 -- pkgopts = (thisPackage dflags, sort $ packageFlags dflags) safeHs = setSafeMode safeHaskell -- oflags = sort $ filter filterOFlags $ flags dflags diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs index 31bcb7a..dcd8eed 100644 --- a/compiler/iface/MkIface.lhs +++ b/compiler/iface/MkIface.lhs @@ -594,7 +594,7 @@ addFingerprints hsc_env mb_old_fingerprint iface0 new_decls -- - (some of) dflags -- it returns two hashes, one that shouldn't change -- the abi hash and one that should - flag_hash <- fingerprintDynFlags dflags putNameLiterally + flag_hash <- fingerprintDynFlags dflags this_mod putNameLiterally -- the ABI hash depends on: -- - decls @@ -1222,7 +1222,9 @@ checkVersions hsc_env mod_summary iface checkFlagHash :: HscEnv -> ModIface -> IfG RecompileRequired checkFlagHash hsc_env iface = do let old_hash = mi_flag_hash iface - new_hash <- liftIO $ fingerprintDynFlags (hsc_dflags hsc_env) putNameLiterally + new_hash <- liftIO $ fingerprintDynFlags (hsc_dflags hsc_env) + (mi_module iface) + putNameLiterally case old_hash == new_hash of True -> up_to_date (ptext $ sLit "Module flags unchanged") False -> out_of_date_hash (ptext $ sLit " Module flags have changed") _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
