X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fiface%2FMkIface.lhs;h=c00c371a3ba2243791ff562f862ae4e38f9647ea;hb=d5183f31fccf9009768eab3f9261dac6c66df59e;hp=c0b9717c64d98afa0ff8dadcc168e45307d3b2d3;hpb=23e4e1039c16bb30fec04b5006bfc0f4989239d9;p=ghc-hetmet.git diff --git a/compiler/iface/MkIface.lhs b/compiler/iface/MkIface.lhs index c0b9717..c00c371 100644 --- a/compiler/iface/MkIface.lhs +++ b/compiler/iface/MkIface.lhs @@ -704,17 +704,23 @@ computeChangedOccs ver_fn this_module old_usages eq_info -- return True if an external name has changed name_changed :: Name -> Bool name_changed nm - | Just ents <- lookupUFM usg_modmap (moduleName mod) - = case lookupUFM ents parent_occ of - Nothing -> pprPanic "computeChangedOccs" (ppr nm) - Just v -> v < new_version + | Just ents <- lookupUFM usg_modmap (moduleName mod), + Just v <- lookupUFM ents parent_occ + = v < new_version + | modulePackageId mod == this_pkg + = WARN(True, ptext SLIT("computeChangedOccs") <+> ppr nm) True + -- should really be a panic, see #1959. The problem is that the usages doesn't + -- contain all the names that might be referred to by unfoldings. So as a + -- conservative workaround we just assume these names have changed. | otherwise = False -- must be in another package where mod = nameModule nm (parent_occ, new_version) = ver_fn nm + this_pkg = modulePackageId this_module + -- Turn the usages from the old ModIface into a mapping - usg_modmap = listToUFM [ (usg_mod usg, listToUFM (usg_entities usg)) + usg_modmap = listToUFM [ (usg_name usg, listToUFM (usg_entities usg)) | usg <- old_usages ] get_local_eq_info :: GenIfaceEq NameSet -> GenIfaceEq OccSet