compiled:
import B <n> ;
to record the fact that A does import B indirectly. This is used to decide
-to look to look for B.hi rather than B.hi-boot when compiling a module that
+to look for B.hi rather than B.hi-boot when compiling a module that
imports A. This line says that A imports B, but uses nothing in it.
So we'll get an early bale-out when compiling A if B's version changes.
haul in all the unfoldings for B, in case the module that imports A *is*
compiled with -O. I think this is the case.]
+SimonM [30/11/2007]: I believe the above is all out of date; the
+current implementation doesn't do it this way. Instead, when any of
+the dependencies of a declaration changes, the version of the
+declaration itself changes.
\begin{code}
#include "HsVersions.h"
import Control.Monad
import Data.List
import Data.IORef
+import System.FilePath
\end{code}
mi_fix_fn = mkIfaceFixCache fixities }
-- Add version information
- ; ext_ver_fn = mkParentVerFun hsc_env eps
+ ; ext_ver_fn = mkParentVerFun hsc_env eps
; (new_iface, no_change_at_all, pp_diffs, pp_orphs)
= {-# SCC "versioninfo" #-}
addVersionInfo ext_ver_fn maybe_old_iface
-----------------------------
writeIfaceFile :: DynFlags -> ModLocation -> ModIface -> IO ()
writeIfaceFile dflags location new_iface
- = do createDirectoryHierarchy (directoryOf hi_file_path)
+ = do createDirectoryHierarchy (takeDirectory hi_file_path)
writeBinIface dflags hi_file_path new_iface
where hi_file_path = ml_hi_file location
-- return True if an external name has changed
name_changed :: Name -> Bool
name_changed nm
+ | isWiredInName nm -- Wired-in things don't get into interface
+ = False -- files and hence don't get into the ver_fn
| Just ents <- lookupUFM usg_modmap (moduleName mod),
Just v <- lookupUFM ents parent_occ
= v < new_version
usg_modmap = listToUFM [ (usg_name usg, listToUFM (usg_entities usg))
| usg <- old_usages ]
- get_local_eq_info :: GenIfaceEq NameSet -> GenIfaceEq OccSet
+ get_local_eq_info :: GenIfaceEq Name -> GenIfaceEq OccName
get_local_eq_info Equal = Equal
get_local_eq_info NotEqual = NotEqual
get_local_eq_info (EqBut ns) = foldNameSet f Equal ns
where (occs, iface_eqs) = unzip pairs
add_changes so_far other = so_far
-type OccIfaceEq = GenIfaceEq OccSet
+type OccIfaceEq = GenIfaceEq OccName
changedWrt :: OccSet -> OccIfaceEq -> Bool
changedWrt so_far Equal = False