Commit ebef357f authored by simonpj's avatar simonpj
Browse files

[project @ 2000-10-23 16:43:42 by simonpj]

A tiny bit more
parent d2cca44e
...@@ -21,11 +21,13 @@ module HscTypes ( ...@@ -21,11 +21,13 @@ module HscTypes (
WhetherHasOrphans, ImportVersion, WhatsImported(..), WhetherHasOrphans, ImportVersion, WhatsImported(..),
PersistentRenamerState(..), IsBootInterface, Avails, DeclsMap, PersistentRenamerState(..), IsBootInterface, Avails, DeclsMap,
IfaceInsts, IfaceRules, Deprecations(..), GatedDecl, IfaceInsts, IfaceRules, GatedDecl,
OrigNameEnv(..), OrigNameNameEnv, OrigNameIParamEnv, OrigNameEnv(..), OrigNameNameEnv, OrigNameIParamEnv,
AvailEnv, AvailInfo, GenAvailInfo(..), AvailEnv, AvailInfo, GenAvailInfo(..),
PersistentCompilerState(..), PersistentCompilerState(..),
Deprecations(..), lookupDeprec,
InstEnv, ClsInstEnv, DFunId, InstEnv, ClsInstEnv, DFunId,
GlobalRdrEnv, RdrAvailInfo, GlobalRdrEnv, RdrAvailInfo,
...@@ -266,6 +268,13 @@ data Deprecations = NoDeprecs ...@@ -266,6 +268,13 @@ data Deprecations = NoDeprecs
| DeprecSome (NameEnv DeprecTxt) -- Some things deprecated | DeprecSome (NameEnv DeprecTxt) -- Some things deprecated
-- Just "big" names -- 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 InstEnv = UniqFM ClsInstEnv -- Maps Class to instances for that class
type ClsInstEnv = [(TyVarSet, [Type], DFunId)] -- The instances for a particular class type ClsInstEnv = [(TyVarSet, [Type], DFunId)] -- The instances for a particular class
type DFunId = Id type DFunId = Id
......
...@@ -66,7 +66,9 @@ import IO ( openFile, IOMode(..) ) ...@@ -66,7 +66,9 @@ import IO ( openFile, IOMode(..) )
import HscTypes ( Finder, PersistentCompilerState, HomeIfaceTable, HomeSymbolTable, import HscTypes ( Finder, PersistentCompilerState, HomeIfaceTable, HomeSymbolTable,
ModIface(..), TyThing(..), ModIface(..), TyThing(..),
GlobalRdrEnv, AvailEnv, Avails, GenAvailInfo(..), AvailInfo, GlobalRdrEnv, AvailEnv, Avails, GenAvailInfo(..), AvailInfo,
Provenance(..), pprNameProvenance, ImportReason(..) ) Provenance(..), pprNameProvenance, ImportReason(..),
lookupDeprec
)
import List ( partition, nub ) import List ( partition, nub )
\end{code} \end{code}
...@@ -765,8 +767,8 @@ reportUnusedNames mod_name direct_import_mods ...@@ -765,8 +767,8 @@ reportUnusedNames mod_name direct_import_mods
not (maybeToBool (lookupFM minimal_imports m)), not (maybeToBool (lookupFM minimal_imports m)),
m /= pRELUDE_Name] m /= pRELUDE_Name]
module_unused :: ModuleName -> Bool module_unused :: Module -> Bool
module_unused mod = mod `elem` unused_imp_mods module_unused mod = moduleName mod `elem` unused_imp_mods
warnDeprecations used_names warnDeprecations used_names
...@@ -786,15 +788,13 @@ warnDeprecations used_names ...@@ -786,15 +788,13 @@ warnDeprecations used_names
where where
lookup_deprec hit pit n lookup_deprec hit pit n
= case lookupModuleEnv hit mod of = case lookupModuleEnv hit mod of
Just iface -> lookup_iface iface n Just iface -> lookupDeprec iface n
Nothing -> case lookupModuleEnv pit mod of Nothing -> case lookupModuleEnv pit mod of
Just iface -> lookup_iface iface n Just iface -> lookupDeprec iface n
Nothing -> pprPanic "warnDeprecations:" (ppr n) Nothing -> pprPanic "warnDeprecations:" (ppr n)
where where
mod = nameModule n mod = nameModule n
lookup_iface iface n = lookupNameEnv (mi_deprecs iface) n
-- ToDo: deal with original imports with 'qualified' and 'as M' clauses -- ToDo: deal with original imports with 'qualified' and 'as M' clauses
printMinimalImports mod_name imps printMinimalImports mod_name imps
= doptRn Opt_D_dump_minimal_imports `thenRn` \ dump_minimal -> = doptRn Opt_D_dump_minimal_imports `thenRn` \ dump_minimal ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment