X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FLoadIface.lhs;h=6211176f87515f639891a07e31edb6e04d021afe;hb=9b2a5189130a54e30e8e513e99807e27793dce4a;hp=a2afdccd44c9b93cf635e5d57ad3ad5bf4085729;hpb=df61ac588d1e7132acea67596ca3d735a308eafb;p=ghc-hetmet.git diff --git a/compiler/iface/LoadIface.lhs b/compiler/iface/LoadIface.lhs index a2afdcc..6211176 100644 --- a/compiler/iface/LoadIface.lhs +++ b/compiler/iface/LoadIface.lhs @@ -52,12 +52,14 @@ import SrcLoc import Maybes import ErrUtils import Finder -import UniqFM +import LazyUniqFM import StaticFlags import Outputable import BinIface import Panic +import Util +import Control.Monad import Data.List import Data.Maybe import Data.IORef @@ -114,14 +116,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 +517,8 @@ readIface :: Module -> FilePath -> IsBootInterface readIface wanted_mod file_path is_hi_boot_file = do { dflags <- getDOpts - ; res <- tryMostM $ readBinIface file_path + ; res <- tryMostM $ + readBinIface CheckHiWay QuietBinIFaceReading file_path ; case res of Right iface | wanted_mod == actual_mod -> return (Succeeded iface) @@ -610,10 +613,10 @@ ifaceStats eps -- | Read binary interface, and print it out showIface :: HscEnv -> FilePath -> IO () showIface hsc_env filename = do - -- skip the version check; we don't want to worry about profiled vs. + -- skip the hi way check; we don't want to worry about profiled vs. -- non-profiled interfaces, for example. - writeIORef v_IgnoreHiWay True - iface <- initTcRnIf 's' hsc_env () () $ readBinIface filename + iface <- initTcRnIf 's' hsc_env () () $ + readBinIface IgnoreHiWay TraceBinIFaceReading filename printDump (pprModIface iface) \end{code}