X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Fmain%2FHscTypes.lhs;h=00e1b4951d19c15cb98702243c53fe0ee5749a05;hb=1187e57fab2b5904a808ac973e5d04b91f880920;hp=3f9338987f4f72489aa65a5b7d1dfbf74993a2be;hpb=0c53bd0e1b02dea0bde32cd7eb8ccb5ee2d3719e;p=ghc-hetmet.git diff --git a/ghc/compiler/main/HscTypes.lhs b/ghc/compiler/main/HscTypes.lhs index 3f93389..00e1b49 100644 --- a/ghc/compiler/main/HscTypes.lhs +++ b/ghc/compiler/main/HscTypes.lhs @@ -84,6 +84,7 @@ import Type ( TyThing(..) ) import Class ( Class, classSelIds, classTyCon ) import TyCon ( TyCon, tyConSelIds, tyConDataCons ) import DataCon ( dataConImplicitIds ) +import PrelNames ( gHC_PRIM ) import Packages ( PackageIdH, PackageId, PackageConfig, HomeModules ) import DynFlags ( DynFlags(..), isOneShot ) import DriverPhases ( HscSource(..), isHsBoot, hscSourceString, Phase ) @@ -94,7 +95,7 @@ import IfaceSyn ( IfaceInst, IfaceRule, IfaceDecl(ifName) ) import FiniteMap ( FiniteMap ) import CoreSyn ( CoreRule ) -import Maybes ( orElse, fromJust, expectJust ) +import Maybes ( orElse, expectJust, expectJust ) import Outputable import SrcLoc ( SrcSpan, Located ) import UniqSupply ( UniqSupply ) @@ -275,9 +276,17 @@ hptRules hsc_env deps | -- Find each non-hi-boot module below me (mod, False) <- deps + -- unsavoury: when compiling the base package with --make, we + -- sometimes try to look up RULES for GHC.Prim. GHC.Prim won't + -- be in the HPT, because we never compile it; it's in the EPT + -- instead. ToDo: clean up, and remove this slightly bogus + -- filter: + , mod /= gHC_PRIM + -- Look it up in the HPT - , let mod_info = ASSERT( mod `elemModuleEnv` hpt ) - fromJust (lookupModuleEnv hpt mod) + , let mod_info = case lookupModuleEnv hpt mod of + Nothing -> pprPanic "hptRules" (ppr mod <+> ppr deps) + Just x -> x -- And get its dfuns , rule <- md_rules (hm_details mod_info) ] @@ -822,9 +831,16 @@ data Usage -- time round, but if someone has added a new rule you might need it this time -- The export list field is (Just v) if we depend on the export list: - -- i.e. we imported the module without saying exactly what we imported - -- We need to recompile if the module exports changes, because we might - -- now have a name clash in the importing module. + -- i.e. we imported the module directly, whether or not we + -- enumerated the things we imported, or just imported everything + -- We need to recompile if M's exports change, because + -- if the import was import M, we might now have a name clash in the + -- importing module. + -- if the import was import M(x) M might no longer export x + -- The only way we don't depend on the export list is if we have + -- import M() + -- And of course, for modules that aren't imported directly we don't + -- depend on their export lists \end{code} @@ -989,7 +1005,7 @@ showModMsg use_object mod_summary char ')']) where mod = ms_mod mod_summary - mod_str = moduleUserString mod ++ hscSourceString (ms_hsc_src mod_summary) + mod_str = moduleString mod ++ hscSourceString (ms_hsc_src mod_summary) \end{code}