Commit e794c5cc authored by simonpj's avatar simonpj
Browse files

[project @ 2004-10-07 16:08:36 by simonpj]

Wibbles to hi-boot files and newtypes
parent b4d045ae
...@@ -108,6 +108,8 @@ loadHiBootInterface ...@@ -108,6 +108,8 @@ loadHiBootInterface
= do { eps <- getEps = do { eps <- getEps
; mod <- getModule ; mod <- getModule
; traceIf (text "loadBootIface" <+> ppr mod)
-- We're read all the direct imports by now, so eps_is_boot will -- We're read all the direct imports by now, so eps_is_boot will
-- record if any of our imports mention us by way of hi-boot file -- record if any of our imports mention us by way of hi-boot file
; case lookupModuleEnv (eps_is_boot eps) mod of { ; case lookupModuleEnv (eps_is_boot eps) mod of {
...@@ -196,6 +198,8 @@ loadInterface doc_str mod_name from ...@@ -196,6 +198,8 @@ loadInterface doc_str mod_name from
= do { -- Read the state = do { -- Read the state
(eps,hpt) <- getEpsAndHpt (eps,hpt) <- getEpsAndHpt
; traceIf (text "Considering whether to load" <+> ppr mod_name <+> ppr from)
-- Check whether we have the interface already -- Check whether we have the interface already
; case lookupIfaceByModName hpt (eps_PIT eps) mod_name of { ; case lookupIfaceByModName hpt (eps_PIT eps) mod_name of {
Just iface Just iface
...@@ -268,8 +272,6 @@ loadInterface doc_str mod_name from ...@@ -268,8 +272,6 @@ loadInterface doc_str mod_name from
mi_insts = panic "No mi_insts in PIT", mi_insts = panic "No mi_insts in PIT",
mi_rules = panic "No mi_rules in PIT" } } mi_rules = panic "No mi_rules in PIT" } }
; traceIf (text "Extending PTE" <+> ppr (map fst (concat new_eps_decls)))
; updateEps_ $ \ eps -> ; updateEps_ $ \ eps ->
eps { eps_PIT = extendModuleEnv (eps_PIT eps) mod final_iface, eps { eps_PIT = extendModuleEnv (eps_PIT eps) mod final_iface,
eps_PTE = addDeclsToPTE (eps_PTE eps) new_eps_decls, eps_PTE = addDeclsToPTE (eps_PTE eps) new_eps_decls,
......
...@@ -858,14 +858,15 @@ checkVersions source_unchanged iface ...@@ -858,14 +858,15 @@ checkVersions source_unchanged iface
-- Source code unchanged and no errors yet... carry on -- Source code unchanged and no errors yet... carry on
-- First put the dependent-module info in the envt, just temporarily, -- First put the dependent-module info, read from the old interface, into the envt,
-- so that when we look for interfaces we look for the right one (.hi or .hi-boot) -- so that when we look for interfaces we look for the right one (.hi or .hi-boot)
--
-- It's just temporary because either the usage check will succeed -- It's just temporary because either the usage check will succeed
-- (in which case we are done with this module) or it'll fail (in which -- (in which case we are done with this module) or it'll fail (in which
-- case we'll compile the module from scratch anyhow). -- case we'll compile the module from scratch anyhow).
; mode <- getGhciMode --
; ifM (isOneShot mode) -- We do this regardless of compilation mode
(updateEps_ $ \eps -> eps { eps_is_boot = mod_deps }) ; updateEps_ $ \eps -> eps { eps_is_boot = mod_deps }
; checkList [checkModUsage u | u <- mi_usages iface] ; checkList [checkModUsage u | u <- mi_usages iface]
} }
......
...@@ -161,9 +161,10 @@ tcRnModule hsc_env (L loc (HsModule maybe_mod exports ...@@ -161,9 +161,10 @@ tcRnModule hsc_env (L loc (HsModule maybe_mod exports
do { -- Deal with imports; sets tcg_rdr_env, tcg_imports do { -- Deal with imports; sets tcg_rdr_env, tcg_imports
(rdr_env, imports) <- rnImports import_decls ; (rdr_env, imports) <- rnImports import_decls ;
-- In one-shot mode, record boot-file info in the EPS -- Record boot-file info in the EPS, so that it's
ifM (isOneShot (hsc_mode hsc_env)) $ -- visible to loadHiBootInterface in tcRnSrcDecls,
updateEps_ (\eps -> eps { eps_is_boot = imp_dep_mods imports }) ; -- and any other incrementally-performed imports
updateEps_ (\eps -> eps { eps_is_boot = imp_dep_mods imports }) ;
-- Update the gbl env -- Update the gbl env
updGblEnv ( \ gbl -> gbl { tcg_rdr_env = rdr_env, updGblEnv ( \ gbl -> gbl { tcg_rdr_env = rdr_env,
......
...@@ -115,7 +115,8 @@ tcTyAndClassDecls boot_names decls ...@@ -115,7 +115,8 @@ tcTyAndClassDecls boot_names decls
= do { -- First check for cyclic type synonysm or classes = do { -- First check for cyclic type synonysm or classes
-- See notes with checkCycleErrs -- See notes with checkCycleErrs
checkCycleErrs decls checkCycleErrs decls
; mod <- getModule
; traceTc (text "tcTyAndCl" <+> ppr mod <+> ppr boot_names)
; (syn_tycons, alg_tyclss) <- fixM (\ ~(rec_syn_tycons, rec_alg_tyclss) -> ; (syn_tycons, alg_tyclss) <- fixM (\ ~(rec_syn_tycons, rec_alg_tyclss) ->
do { let { -- Calculate variances and rec-flag do { let { -- Calculate variances and rec-flag
; (syn_decls, alg_decls) = partition (isSynDecl . unLoc) decls } ; (syn_decls, alg_decls) = partition (isSynDecl . unLoc) decls }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment