diff options
author | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2006-10-13 00:42:23 +0000 |
---|---|---|
committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2006-10-13 00:42:23 +0000 |
commit | 311b1cdfc9b1c311cc53482c461c18cba8885b2a (patch) | |
tree | d3c228574136d2c2170da99f521d4cb449cb7140 /compiler/rename | |
parent | 8a5d47de2b82d9cca86546a7bd89d915488934ef (diff) | |
download | haskell-311b1cdfc9b1c311cc53482c461c18cba8885b2a.tar.gz |
Keep track of family instance modules
- Now each modules carries
(1) a flag saying whether it contains family instance declarations and
(2) a list of all modules further down in the import tree that contain
family instance declarations.
(The information is split into these two parts for the exact same reasons why
the info about orphan modules is split, too.)
- This is the first step to *optimised* overlap checking of family instances
coming from imported modules.
*** WARNING: This patch changes the interface file format! ***
*** Recompile libraries and stage2 from scratch! ***
Diffstat (limited to 'compiler/rename')
-rw-r--r-- | compiler/rename/RnNames.lhs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/compiler/rename/RnNames.lhs b/compiler/rename/RnNames.lhs index ec65f720bd..29468fd0ba 100644 --- a/compiler/rename/RnNames.lhs +++ b/compiler/rename/RnNames.lhs @@ -163,10 +163,11 @@ rnImportDecl this_mod (L loc (ImportDecl loc_imp_mod_name want_boot (warnRedundantSourceImport imp_mod_name) let - imp_mod = mi_module iface - deprecs = mi_deprecs iface - is_orph = mi_orphan iface - deps = mi_deps iface + imp_mod = mi_module iface + deprecs = mi_deprecs iface + is_orph = mi_orphan iface + has_finsts = mi_finsts iface + deps = mi_deps iface filtered_exports = filter not_this_mod (mi_exports iface) not_this_mod (mod,_) = mod /= this_mod @@ -211,6 +212,10 @@ rnImportDecl this_mod (L loc (ImportDecl loc_imp_mod_name want_boot imp_mod : dep_orphs deps | otherwise = dep_orphs deps + finsts | has_finsts = ASSERT( not (imp_mod `elem` dep_finsts deps) ) + imp_mod : dep_finsts deps + | otherwise = dep_finsts deps + pkg = modulePackageId (mi_module iface) (dependent_mods, dependent_pkgs) @@ -244,6 +249,7 @@ rnImportDecl this_mod (L loc (ImportDecl loc_imp_mod_name want_boot imp_env = unitUFM qual_mod_name filtered_avails, imp_mods = unitModuleEnv imp_mod (imp_mod, import_all, loc), imp_orphs = orphans, + imp_finsts = finsts, imp_dep_mods = mkModDeps dependent_mods, imp_dep_pkgs = dependent_pkgs, imp_parent = emptyNameEnv |