From 06fb5e3cfae85ba7318ce77bdf92ce7759c08641 Mon Sep 17 00:00:00 2001 From: simonpj Date: Sat, 29 Apr 2000 22:44:26 +0000 Subject: [PATCH] [project @ 2000-04-29 22:44:26 by simonpj] Wibble in recent RnEnv changes This meant that things fell over when you try to build the Prelude. Fixed now. --- ghc/compiler/rename/RnEnv.lhs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ghc/compiler/rename/RnEnv.lhs b/ghc/compiler/rename/RnEnv.lhs index 16f69da..561fbdb 100644 --- a/ghc/compiler/rename/RnEnv.lhs +++ b/ghc/compiler/rename/RnEnv.lhs @@ -22,7 +22,7 @@ import RnMonad import Name ( Name, Provenance(..), ExportFlag(..), NamedThing(..), ImportReason(..), getSrcLoc, mkLocalName, mkImportedLocalName, mkGlobalName, mkUnboundName, - mkIPName, isSystemName, + mkIPName, isSystemName, isWiredInName, nameOccName, setNameModule, nameModule, pprOccName, isLocallyDefined, nameUnique, nameOccName, occNameUserString, @@ -92,9 +92,15 @@ newTopBinder mod occ mk_prov -- -- It also means that if there are two defns for the same thing -- in a module, then each gets a separate SrcLoc + -- + -- There's a complication for wired-in names. We don't want to + -- forget that they are wired in even when compiling that module + -- (else we spit out redundant defns into the interface file) + -- So for them we just set the provenance Just name -> let - new_name = mkGlobalName (nameUnique name) mod occ (mk_prov new_name) + new_name | isWiredInName name = setNameProvenance name (mk_prov name) + | otherwise = mkGlobalName (nameUnique name) mod occ (mk_prov name) new_cache = addToFM cache key new_name in setNameSupplyRn (us, inst_ns, new_cache, ipcache) `thenRn_` -- 1.7.10.4