From: simonmar Date: Thu, 18 Oct 2001 08:53:03 +0000 (+0000) Subject: [project @ 2001-10-18 08:53:03 by simonmar] X-Git-Tag: Approximately_9120_patches~800 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c34157eadadf46a81b0ab7943da28748921b30ba;p=ghc-hetmet.git [project @ 2001-10-18 08:53:03 by simonmar] Eeeek! When looking for an interface for a way other than the normal way (eg. profiling) we were correctly finding the .p_hi file, but then reading the .hi file! Sigbjorn: go stand in the corner for the rest of the day. MERGE TO STABLE --- diff --git a/ghc/compiler/main/Finder.lhs b/ghc/compiler/main/Finder.lhs index f934f8b..83cf28c 100644 --- a/ghc/compiler/main/Finder.lhs +++ b/ghc/compiler/main/Finder.lhs @@ -148,6 +148,15 @@ findPackageMod mod_name hiOnly = do let imp_dirs = concatMap (\ pkg -> map ((,) pkg) (import_dirs pkg)) pkgs mod_str = moduleNameUserString mod_name basename = map (\c -> if c == '.' then '/' else c) mod_str + + mkPackageModule mod_name pkg mbFName path = + return ( mkModule mod_name (mkFastString (name pkg)) + , ModuleLocation{ ml_hspp_file = Nothing + , ml_hs_file = mbFName + , ml_hi_file = path ++ '.':package_hisuf + , ml_obj_file = Nothing + }) + searchPathExts imp_dirs basename ((package_hisuf,\ pkg fName path -> mkPackageModule mod_name pkg Nothing path) : @@ -157,13 +166,6 @@ findPackageMod mod_name hiOnly = do , ("lhs", \ pkg fName path -> mkPackageModule mod_name pkg (Just fName) path) ])) where - mkPackageModule mod_name pkg mbFName path = - return ( mkModule mod_name (mkFastString (name pkg)) - , ModuleLocation{ ml_hspp_file = Nothing - , ml_hs_file = mbFName - , ml_hi_file = path ++".hi" - , ml_obj_file = Nothing - }) findPackageModule :: ModuleName -> IO (Maybe (Module, ModuleLocation)) findPackageModule mod_name = findPackageMod mod_name True