From: simonmar Date: Mon, 6 May 2002 08:31:29 +0000 (+0000) Subject: [project @ 2002-05-06 08:31:29 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~2053 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=de23b5da839388fee5e78ecf008c815ad69dd45d;p=ghc-hetmet.git [project @ 2002-05-06 08:31:29 by simonmar] Slurp the usages information lazilly from the interface file. In most cases we don't need it at all: we only use it when we're loading a module's interface file to check whether the module needs recompiling. --- diff --git a/ghc/compiler/main/BinIface.hs b/ghc/compiler/main/BinIface.hs index f949171..f6e439e 100644 --- a/ghc/compiler/main/BinIface.hs +++ b/ghc/compiler/main/BinIface.hs @@ -248,7 +248,7 @@ instance Binary ModIface where put_ bh (vers_module (mi_version iface)) put_ bh (mi_orphan iface) -- no: mi_boot - put_ bh (map importVersionNameToOccName (mi_usages iface)) + lazyPut bh (map importVersionNameToOccName (mi_usages iface)) put_ bh (vers_exports (mi_version iface), map exportItemToRdrExportItem (mi_exports iface)) put_ bh (declsToVersionedDecls (dcl_tycl (mi_decls iface)) @@ -260,7 +260,7 @@ instance Binary ModIface where lazyPut bh (vers_rules (mi_version iface), dcl_rules (mi_decls iface)) lazyPut bh (deprecsToIfaceDeprecs (mi_deprecs iface)) - -- Read in an a ParsedIface, not a ModIface. See above. + -- Read in as a ParsedIface, not a ModIface. See above. get bh = error "Binary.get: ModIface" declsToVersionedDecls :: [RenamedTyClDecl] -> NameEnv Version @@ -323,7 +323,7 @@ instance Binary ParsedIface where put_ bh pkg_name put_ bh module_ver put_ bh orphan - put_ bh usages + lazyPut bh usages put_ bh exports put_ bh tycl_decls put_ bh fixities @@ -344,13 +344,13 @@ instance Binary ParsedIface where pkg_name <- get bh module_ver <- get bh orphan <- get bh - usages <- get bh - exports <- get bh - tycl_decls <- get bh - fixities <- get bh - insts <- get bh - rules <- lazyGet bh - deprecs <- lazyGet bh + usages <- {-# SCC "bin_usages" #-} lazyGet bh + exports <- {-# SCC "bin_exports" #-} get bh + tycl_decls <- {-# SCC "bin_tycldecls" #-} get bh + fixities <- {-# SCC "bin_fixities" #-} get bh + insts <- {-# SCC "bin_insts" #-} get bh + rules <- {-# SCC "bin_rules" #-} lazyGet bh + deprecs <- {-# SCC "bin_deprecs" #-} lazyGet bh return (ParsedIface { pi_mod = module_name, pi_pkg = pkg_name,