From fe6b0fa38eeafd116fc9d64b2443b773b2a59245 Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 14 Nov 2000 12:07:44 +0000 Subject: [PATCH] [project @ 2000-11-14 12:07:44 by simonpj] Fix another naming bug --- ghc/compiler/basicTypes/Id.lhs | 7 ------- ghc/compiler/basicTypes/Name.lhs | 3 +++ ghc/compiler/coreSyn/CoreTidy.lhs | 6 +++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/ghc/compiler/basicTypes/Id.lhs b/ghc/compiler/basicTypes/Id.lhs index 57edb62..c26f7aa 100644 --- a/ghc/compiler/basicTypes/Id.lhs +++ b/ghc/compiler/basicTypes/Id.lhs @@ -23,7 +23,6 @@ module Id ( -- Predicates omitIfaceSigForId, isDeadBinder, - exportWithOrigOccName, externallyVisibleId, isIP, isSpecPragmaId, isRecordSelector, @@ -292,12 +291,6 @@ omitIfaceSigForId' id -- the instance decl other -> False -- Don't omit! - --- Certain names must be exported with their original occ names, because --- these names are bound by either a class declaration or a data declaration --- or an explicit user export. -exportWithOrigOccName :: Id -> Bool -exportWithOrigOccName id = omitIfaceSigForId id || isExportedId id \end{code} \begin{code} diff --git a/ghc/compiler/basicTypes/Name.lhs b/ghc/compiler/basicTypes/Name.lhs index b3a6138..1a0e155 100644 --- a/ghc/compiler/basicTypes/Name.lhs +++ b/ghc/compiler/basicTypes/Name.lhs @@ -275,6 +275,9 @@ tidyTopName mod env is_exported = case sort of Global _ | is_exported -> (env, name) | otherwise -> (env, name { n_sort = new_sort }) + -- Don't change the occurrnce names of globals, because many of them + -- are bound by either a class declaration or a data declaration + -- or an explicit user export. other | is_exported -> (env', name { n_sort = Global mod, n_occ = occ' }) | otherwise -> (env', name { n_sort = new_sort, n_occ = occ' }) diff --git a/ghc/compiler/coreSyn/CoreTidy.lhs b/ghc/compiler/coreSyn/CoreTidy.lhs index 892cb26..e81b2a3 100644 --- a/ghc/compiler/coreSyn/CoreTidy.lhs +++ b/ghc/compiler/coreSyn/CoreTidy.lhs @@ -20,7 +20,7 @@ import VarEnv import VarSet import Var ( Id, Var ) import Id ( idType, idInfo, idName, isExportedId, - mkVanillaId, mkId, exportWithOrigOccName, + mkVanillaId, mkId, idStrictness, setIdStrictness, idDemandInfo, setIdDemandInfo, ) @@ -29,7 +29,7 @@ import IdInfo ( specInfo, setSpecInfo, workerInfo, setWorkerInfo, WorkerInfo(..) ) import Demand ( wwLazy ) -import Name ( getOccName, tidyTopName, mkLocalName ) +import Name ( getOccName, tidyTopName, mkLocalName, isGlobalName ) import OccName ( initTidyOccEnv, tidyOccName ) import Type ( tidyTopType, tidyType, tidyTyVar ) import Module ( Module ) @@ -100,7 +100,7 @@ tidyCorePgm dflags module_name binds_in orphans_in -- decl. tidyTopId then does a no-op on exported binders. init_tidy_env = (initTidyOccEnv avoids, emptyVarEnv) avoids = [getOccName bndr | bndr <- bindersOfBinds binds_in, - exportWithOrigOccName bndr] + isGlobalName (idName bndr)] tidyBind :: Maybe Module -- (Just m) for top level, Nothing for nested -> TidyEnv -- 1.7.10.4