diff options
author | simonpj <unknown> | 2000-10-23 16:43:42 +0000 |
---|---|---|
committer | simonpj <unknown> | 2000-10-23 16:43:42 +0000 |
commit | ebef357f943e8fce48adb73053082204cc892f99 (patch) | |
tree | e52c39ce24f8f04b400ef415b5bc710bd916b895 /ghc | |
parent | d2cca44eae15bbbd3b86889448e796bc785dfa52 (diff) | |
download | haskell-ebef357f943e8fce48adb73053082204cc892f99.tar.gz |
[project @ 2000-10-23 16:43:42 by simonpj]
A tiny bit more
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/compiler/main/HscTypes.lhs | 11 | ||||
-rw-r--r-- | ghc/compiler/rename/Rename.lhs | 14 |
2 files changed, 17 insertions, 8 deletions
diff --git a/ghc/compiler/main/HscTypes.lhs b/ghc/compiler/main/HscTypes.lhs index 84b129b1e1..a5d58169d4 100644 --- a/ghc/compiler/main/HscTypes.lhs +++ b/ghc/compiler/main/HscTypes.lhs @@ -21,11 +21,13 @@ module HscTypes ( WhetherHasOrphans, ImportVersion, WhatsImported(..), PersistentRenamerState(..), IsBootInterface, Avails, DeclsMap, - IfaceInsts, IfaceRules, Deprecations(..), GatedDecl, + IfaceInsts, IfaceRules, GatedDecl, OrigNameEnv(..), OrigNameNameEnv, OrigNameIParamEnv, AvailEnv, AvailInfo, GenAvailInfo(..), PersistentCompilerState(..), + Deprecations(..), lookupDeprec, + InstEnv, ClsInstEnv, DFunId, GlobalRdrEnv, RdrAvailInfo, @@ -266,6 +268,13 @@ data Deprecations = NoDeprecs | DeprecSome (NameEnv DeprecTxt) -- Some things deprecated -- Just "big" names +lookupDeprec :: ModIface -> Name -> Maybe DeprecTxt +lookupDeprec iface name + = case mi_deprecs iface of + NoDeprecs -> Nothing + DeprecAll txt -> Just txt + DeprecSome env -> lookupNameEnv env name + type InstEnv = UniqFM ClsInstEnv -- Maps Class to instances for that class type ClsInstEnv = [(TyVarSet, [Type], DFunId)] -- The instances for a particular class type DFunId = Id diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs index 3aaffac1d6..8790ef0843 100644 --- a/ghc/compiler/rename/Rename.lhs +++ b/ghc/compiler/rename/Rename.lhs @@ -66,7 +66,9 @@ import IO ( openFile, IOMode(..) ) import HscTypes ( Finder, PersistentCompilerState, HomeIfaceTable, HomeSymbolTable, ModIface(..), TyThing(..), GlobalRdrEnv, AvailEnv, Avails, GenAvailInfo(..), AvailInfo, - Provenance(..), pprNameProvenance, ImportReason(..) ) + Provenance(..), pprNameProvenance, ImportReason(..), + lookupDeprec + ) import List ( partition, nub ) \end{code} @@ -765,8 +767,8 @@ reportUnusedNames mod_name direct_import_mods not (maybeToBool (lookupFM minimal_imports m)), m /= pRELUDE_Name] - module_unused :: ModuleName -> Bool - module_unused mod = mod `elem` unused_imp_mods + module_unused :: Module -> Bool + module_unused mod = moduleName mod `elem` unused_imp_mods warnDeprecations used_names @@ -786,15 +788,13 @@ warnDeprecations used_names where lookup_deprec hit pit n = case lookupModuleEnv hit mod of - Just iface -> lookup_iface iface n + Just iface -> lookupDeprec iface n Nothing -> case lookupModuleEnv pit mod of - Just iface -> lookup_iface iface n + Just iface -> lookupDeprec iface n Nothing -> pprPanic "warnDeprecations:" (ppr n) where mod = nameModule n - lookup_iface iface n = lookupNameEnv (mi_deprecs iface) n - -- ToDo: deal with original imports with 'qualified' and 'as M' clauses printMinimalImports mod_name imps = doptRn Opt_D_dump_minimal_imports `thenRn` \ dump_minimal -> |