= do { eps <- getEps
; mod <- getModule
+ ; traceIf (text "loadBootIface" <+> ppr mod)
+
-- 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
; case lookupModuleEnv (eps_is_boot eps) mod of {
= do { -- Read the state
(eps,hpt) <- getEpsAndHpt
+ ; traceIf (text "Considering whether to load" <+> ppr mod_name <+> ppr from)
+
-- Check whether we have the interface already
; case lookupIfaceByModName hpt (eps_PIT eps) mod_name of {
Just iface
mi_insts = panic "No mi_insts in PIT",
mi_rules = panic "No mi_rules in PIT" } }
- ; traceIf (text "Extending PTE" <+> ppr (map fst (concat new_eps_decls)))
-
; updateEps_ $ \ eps ->
eps { eps_PIT = extendModuleEnv (eps_PIT eps) mod final_iface,
eps_PTE = addDeclsToPTE (eps_PTE eps) new_eps_decls,
-- 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)
+ --
-- 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
-- case we'll compile the module from scratch anyhow).
- ; mode <- getGhciMode
- ; ifM (isOneShot mode)
- (updateEps_ $ \eps -> eps { eps_is_boot = mod_deps })
+ --
+ -- We do this regardless of compilation mode
+ ; updateEps_ $ \eps -> eps { eps_is_boot = mod_deps }
; checkList [checkModUsage u | u <- mi_usages iface]
}
do { -- Deal with imports; sets tcg_rdr_env, tcg_imports
(rdr_env, imports) <- rnImports import_decls ;
- -- In one-shot mode, record boot-file info in the EPS
- ifM (isOneShot (hsc_mode hsc_env)) $
- updateEps_ (\eps -> eps { eps_is_boot = imp_dep_mods imports }) ;
+ -- Record boot-file info in the EPS, so that it's
+ -- visible to loadHiBootInterface in tcRnSrcDecls,
+ -- and any other incrementally-performed imports
+ updateEps_ (\eps -> eps { eps_is_boot = imp_dep_mods imports }) ;
-- Update the gbl env
updGblEnv ( \ gbl -> gbl { tcg_rdr_env = rdr_env,
= do { -- First check for cyclic type synonysm or classes
-- See notes with checkCycleErrs
checkCycleErrs decls
-
+ ; mod <- getModule
+ ; traceTc (text "tcTyAndCl" <+> ppr mod <+> ppr boot_names)
; (syn_tycons, alg_tyclss) <- fixM (\ ~(rec_syn_tycons, rec_alg_tyclss) ->
do { let { -- Calculate variances and rec-flag
; (syn_decls, alg_decls) = partition (isSynDecl . unLoc) decls }