[project @ 2004-01-05 12:11:42 by simonpj]
[ghc-hetmet.git] / ghc / compiler / iface / LoadIface.lhs
index 1db091f..d05d3ae 100644 (file)
@@ -5,7 +5,7 @@
 
 \begin{code}
 module LoadIface (
-       loadHomeInterface, loadInterface, loadSysInterface,
+       loadHomeInterface, loadInterface,
        loadSrcInterface, loadOrphanModules,
        readIface,      -- Used when reading the module's old interface
        predInstGates, ifaceInstGates, ifaceStats,
@@ -29,7 +29,7 @@ import HscTypes               ( HscEnv(..), ModIface(..), emptyModIface,
                          lookupIfaceByModName, emptyPackageIfaceTable,
                          IsBootInterface, mkIfaceFixCache, 
                          Pool(..), DeclPool, InstPool, 
-                         RulePool, Gated, addRuleToPool, RulePoolContents
+                         RulePool, addRuleToPool, RulePoolContents
                         )
 
 import BasicTypes      ( Version, Fixity(..), FixityDirection(..) )
@@ -60,7 +60,7 @@ import SrcLoc         ( mkSrcLoc, importedSrcLoc )
 import Maybes          ( isJust, mapCatMaybes )
 import StringBuffer     ( hGetStringBuffer )
 import FastString      ( mkFastString )
-import ErrUtils         ( Message )
+import ErrUtils         ( Message, mkLocMessage )
 import Finder          ( findModule, findPackageModule, 
                          hiBootExt, hiBootVerExt )
 import Lexer
@@ -171,14 +171,13 @@ loadInterface doc_str mod_name from
                -> returnM (Right iface) ;      -- Already loaded
                        -- The (src_imp == mi_boot iface) test checks that the already-loaded
                        -- interface isn't a boot iface.  This can conceivably happen,
-                       -- if an earlier import had a 
-                       -- before we got to real imports.   I think.
+                       -- if an earlier import had a before we got to real imports.   I think.
            other -> do
 
        { if_gbl_env <- getGblEnv
        ; let { hi_boot_file = case from of
                                ImportByUser usr_boot -> usr_boot
-                               ImportBySystem  -> sys_boot
+                               ImportBySystem        -> sys_boot
 
              ; mb_dep   = lookupModuleEnvByName (if_is_boot if_gbl_env) mod_name
              ; sys_boot = case mb_dep of
@@ -209,7 +208,7 @@ loadInterface doc_str mod_name from
        WARN(   case from of { ImportBySystem -> True; other -> False } &&
                not (isJust mb_dep) && 
                isHomeModule mod,
-               ppr mod )
+               ppr mod $$ ppr mb_dep)
 
        initIfaceLcl (moduleName mod) $ do
        --      Load the new ModIface into the External Package State
@@ -557,7 +556,7 @@ read_iface dflags wanted_mod file_path is_hi_boot_file
          Left exn     -> return (Left (text (showException exn))) ;
          Right buffer -> 
         case unP parseIface (mkPState buffer loc dflags) of
-         PFailed loc1 loc2 err -> return (Left (showPFailed loc1 loc2 err))
+         PFailed span err -> return (Left (mkLocMessage span err))
          POk _ iface 
             | wanted_mod == actual_mod -> return (Right iface)
             | otherwise                -> return (Left err)