X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcRnTypes.lhs;h=d11ee27d57b6773b8b52afd305b51a204bbce51a;hb=refs%2Ftags%2FBefore_type_family_merge;hp=be37c16940f96802c1b72f9cc985d56e9daa6004;hpb=2eb04ca0f8d0ec72b417cddc60672c696b4a3daa;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcRnTypes.lhs b/compiler/typecheck/TcRnTypes.lhs index be37c16..d11ee27 100644 --- a/compiler/typecheck/TcRnTypes.lhs +++ b/compiler/typecheck/TcRnTypes.lhs @@ -226,7 +226,8 @@ data TcGblEnv tcg_fords :: [LForeignDecl Id], -- ...Foreign import & exports tcg_doc :: Maybe (HsDoc Name), -- Maybe Haddock documentation - tcg_hmi :: HaddockModInfo Name -- Haddock module information + tcg_hmi :: HaddockModInfo Name, -- Haddock module information + tcg_hpc :: AnyHpcUsage -- True if any part of the prog uses hpc instrumentation. } type RecFieldEnv = NameEnv [Name] -- Maps a constructor name *in this module* @@ -490,8 +491,11 @@ It is used * when processing the export list \begin{code} data ImportAvails = ImportAvails { - imp_mods :: ModuleEnv (Module, Bool, SrcSpan), + imp_mods :: ModuleEnv (Module, [(ModuleName, Bool, SrcSpan)]), -- Domain is all directly-imported modules + -- The ModuleName is what the module was imported as, e.g. in + -- import Foo as Bar + -- it is Bar. -- Bool means: -- True => import was "import Foo ()" -- False => import was some other form @@ -554,12 +558,13 @@ plusImportAvails (ImportAvails { imp_mods = mods2, imp_dep_mods = dmods2, imp_dep_pkgs = dpkgs2, imp_orphs = orphs2, imp_finsts = finsts2 }) - = ImportAvails { imp_mods = mods1 `plusModuleEnv` mods2, + = ImportAvails { imp_mods = plusModuleEnv_C plus_mod mods1 mods2, imp_dep_mods = plusUFM_C plus_mod_dep dmods1 dmods2, imp_dep_pkgs = dpkgs1 `unionLists` dpkgs2, imp_orphs = orphs1 `unionLists` orphs2, imp_finsts = finsts1 `unionLists` finsts2 } where + plus_mod (m1, xs1) (_, xs2) = (m1, xs1 ++ xs2) plus_mod_dep (m1, boot1) (m2, boot2) = WARN( not (m1 == m2), (ppr m1 <+> ppr m2) $$ (ppr boot1 <+> ppr boot2) ) -- Check mod-names match