Don't import FastString in HsVersions.h
[ghc-hetmet.git] / compiler / iface / LoadIface.lhs
index f41f5da..feb51d1 100644 (file)
@@ -57,7 +57,10 @@ import StaticFlags
 import Outputable
 import BinIface
 import Panic
+import Util
+import FastString
 
+import Control.Monad
 import Data.List
 import Data.Maybe
 import Data.IORef
@@ -114,14 +117,14 @@ loadOrphanModules mods isFamInstMod
 -- | Loads the interface for a given Name.
 loadInterfaceForName :: SDoc -> Name -> TcRn ModIface
 loadInterfaceForName doc name
-  = do { 
-#ifdef DEBUG
-               -- Should not be called with a name from the module being compiled
-         this_mod <- getModule
-       ; ASSERT2( not (nameIsLocalOrFrom this_mod name), ppr name <+> parens doc )
-#endif
-         initIfaceTcRn $ loadSysInterface doc (nameModule name)
-    }
+  = do { 
+    when debugIsOn $ do
+        -- Should not be called with a name from the module being compiled
+        { this_mod <- getModule
+        ; MASSERT2( not (nameIsLocalOrFrom this_mod name), ppr name <+> parens doc )
+        }
+  ; initIfaceTcRn $ loadSysInterface doc (nameModule name)
+  }
 
 -- | An 'IfM' function to load the home interface for a wired-in thing,
 -- so that we're sure that we see its instance declarations and rules
@@ -515,7 +518,8 @@ readIface :: Module -> FilePath -> IsBootInterface
 
 readIface wanted_mod file_path is_hi_boot_file
   = do { dflags <- getDOpts
-        ; res <- tryMostM $ readBinIface CheckHiWay file_path
+        ; res <- tryMostM $
+                 readBinIface CheckHiWay QuietBinIFaceReading file_path
        ; case res of
            Right iface 
                | wanted_mod == actual_mod -> return (Succeeded iface)
@@ -612,7 +616,8 @@ showIface :: HscEnv -> FilePath -> IO ()
 showIface hsc_env filename = do
    -- skip the hi way check; we don't want to worry about profiled vs.
    -- non-profiled interfaces, for example.
-   iface <- initTcRnIf 's' hsc_env () () $ readBinIface IgnoreHiWay filename
+   iface <- initTcRnIf 's' hsc_env () () $
+       readBinIface IgnoreHiWay TraceBinIFaceReading filename
    printDump (pprModIface iface)
 \end{code}
 
@@ -623,7 +628,6 @@ pprModIface iface
  = vcat [ ptext SLIT("interface")
                <+> ppr (mi_module iface) <+> pp_boot 
                <+> ppr (mi_mod_vers iface) <+> pp_sub_vers
-               <+> ppr (mi_mod_vers iface)
                <+> (if mi_orphan iface then ptext SLIT("[orphan module]") else empty)
                <+> (if mi_finsts iface then ptext SLIT("[family instance module]") else empty)
                <+> (if mi_hpc    iface then ptext SLIT("[hpc]") else empty)