From: simonmar Date: Wed, 16 Aug 2000 13:28:25 +0000 (+0000) Subject: [project @ 2000-08-16 13:28:25 by simonmar] X-Git-Tag: Approximately_9120_patches~3882 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=66644baa950aede979b3c45b5befbde995beef9f;p=ghc-hetmet.git [project @ 2000-08-16 13:28:25 by simonmar] Don't just pick the back edges ({-# SOURCE #-} imports) when collecting the list of imports for module initialisation. It's entirely possible that a module is only reachable from Main via {-# SOURCE #-} imports. --- diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs index 0f9fe08..68ac301 100644 --- a/ghc/compiler/rename/Rename.lhs +++ b/ghc/compiler/rename/Rename.lhs @@ -161,10 +161,14 @@ rename this_mod@(HsModule mod_name vers exports imports local_decls mod_deprec l getIfacesRn `thenRn` \ ifaces -> let direct_import_mods :: [Module] - direct_import_mods = [m | (_, _, Just (m, _, _, _, ImportByUser, _)) - <- eltsFM (iImpModInfo ifaces)] - -- Pick just the non-back-edge imports - -- (Back edges are ImportByUserSource) + direct_import_mods = [m | (_, _, Just (m, _, _, _, imp, _)) + <- eltsFM (iImpModInfo ifaces), user_import imp] + + -- *don't* just pick the forward edges. It's entirely possible + -- that a module is only reachable via back edges. + user_import ImportByUser = True + user_import ImportByUserSource = True + user_import _ = False this_module = mkThisModule mod_name