X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnIfaces.lhs;h=7311439af4a897d3fcd9a64ae5230260f587eab3;hb=d00cf5b8622c0715a038129c6887bb677baa5996;hp=797e1804a003d39e8f69277a0c388b7ec473eee1;hpb=4adc89ca6a497c9b2a9028ee2a62be2491d52f09;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnIfaces.lhs b/ghc/compiler/rename/RnIfaces.lhs index 797e180..7311439 100644 --- a/ghc/compiler/rename/RnIfaces.lhs +++ b/ghc/compiler/rename/RnIfaces.lhs @@ -344,12 +344,9 @@ recordSlurp ifaces@(Ifaces { iDecls = (decls_map, n_slurped), new_vslurp | isModuleInThisPackage mod = (imp_mods, addOneToNameSet imp_names main_name) | otherwise = (extendModuleSet imp_mods mod, imp_names) -recordLocalSlurps local_avails +recordLocalSlurps new_names = getIfacesRn `thenRn` \ ifaces -> - let - new_slurped_names = foldl addAvailToNameSet (iSlurp ifaces) local_avails - in - setIfacesRn (ifaces { iSlurp = new_slurped_names }) + setIfacesRn (ifaces { iSlurp = iSlurp ifaces `unionNameSets` new_names }) \end{code} @@ -603,19 +600,13 @@ data ImportDeclResult | HereItIs (Module, RdrNameTyClDecl) importDecl name - = -- STEP 1: Check if it was loaded before beginning this module - if isLocalName name then - traceRn (text "Already (local)" <+> ppr name) `thenRn_` - returnRn AlreadySlurped - else - - -- STEP 2: Check if we've slurped it in while compiling this module + = -- STEP 1: Check if we've slurped it in while compiling this module getIfacesRn `thenRn` \ ifaces -> if name `elemNameSet` iSlurp ifaces then returnRn AlreadySlurped else - -- STEP 3: Check if it's already in the type environment + -- STEP 2: Check if it's already in the type environment getTypeEnvRn `thenRn` \ lookup -> case lookup name of { Just ty_thing | name `elemNameEnv` wiredInThingEnv @@ -629,13 +620,13 @@ importDecl name Nothing -> - -- STEP 4: OK, we have to slurp it in from an interface file + -- STEP 3: OK, we have to slurp it in from an interface file -- First load the interface file traceRn nd_doc `thenRn_` loadHomeInterface nd_doc name `thenRn_` getIfacesRn `thenRn` \ ifaces -> - -- STEP 5: Get the declaration out + -- STEP 4: Get the declaration out let (decls_map, _) = iDecls ifaces in