X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRnHiFiles.lhs;h=9a1366927e375894937382f7c7b0f33a08be6d33;hb=403bcbb47a992484fdf805d2e9d0c538758abb01;hp=4e067b9de5261c27e8e7de482040095b37d2be5b;hpb=90fa6b84fdc99ba99c0b7df9691ca69d50b62530;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/RnHiFiles.lhs b/ghc/compiler/rename/RnHiFiles.lhs index 4e067b9..9a13669 100644 --- a/ghc/compiler/rename/RnHiFiles.lhs +++ b/ghc/compiler/rename/RnHiFiles.lhs @@ -49,6 +49,7 @@ import Maybes ( maybeToBool, orElse ) import StringBuffer ( hGetStringBuffer ) import FastString ( mkFastString ) import ErrUtils ( Message ) +import Finder ( findModule ) import Lex import FiniteMap import Outputable @@ -240,16 +241,16 @@ addModDeps mod new_deps mod_deps -- Loading the export list ----------------------------------------------------- -loadExports :: (Version, [ExportItem]) -> RnM d (Version, Avails) +loadExports :: (Version, [ExportItem]) -> RnM d (Version, [(ModuleName,Avails)]) loadExports (vers, items) = getModuleRn `thenRn` \ this_mod -> mapRn (loadExport this_mod) items `thenRn` \ avails_s -> - returnRn (vers, concat avails_s) + returnRn (vers, avails_s) -loadExport :: Module -> ExportItem -> RnM d [AvailInfo] +loadExport :: Module -> ExportItem -> RnM d (ModuleName, Avails) loadExport this_mod (mod, entities) - | mod == moduleName this_mod = returnRn [] + | mod == moduleName this_mod = returnRn (mod, []) -- If the module exports anything defined in this module, just ignore it. -- Reason: otherwise it looks as if there are two local definition sites -- for the thing, and an error gets reported. Easiest thing is just to @@ -267,7 +268,8 @@ loadExport this_mod (mod, entities) -- but it's a bogus thing to do! | otherwise - = mapRn (load_entity mod) entities + = mapRn (load_entity mod) entities `thenRn` \ avails -> + returnRn (mod, avails) where new_name mod occ = newGlobalName mod occ @@ -406,7 +408,7 @@ loadDeprecs m (Just (Right prs)) = setModuleRn m $ loadDeprec deprec_env (n, txt) = lookupOrigName n `thenRn` \ name -> traceRn (text "Loaded deprecation(s) for" <+> ppr name <> colon <+> ppr txt) `thenRn_` - returnRn (extendNameEnv deprec_env name txt) + returnRn (extendNameEnv deprec_env name (name,txt)) \end{code} @@ -486,13 +488,11 @@ findAndReadIface :: SDoc -> ModuleName findAndReadIface doc_str mod_name hi_boot_file = traceRn trace_msg `thenRn_` - - getFinderRn `thenRn` \ finder -> - ioToRnM (finder mod_name) `thenRn` \ maybe_found -> + ioToRnM (findModule mod_name) `thenRn` \ maybe_found -> case maybe_found of Right (Just (mod,locn)) - | hi_boot_file -> readIface mod (hi_file locn ++ "-hi-boot") + | hi_boot_file -> readIface mod (hi_file locn ++ "-boot") | otherwise -> readIface mod (hi_file locn) -- Can't find it