Commit d0c6c8b3 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Remove unused lookupDeprec function

parent 26a4a13d
......@@ -51,7 +51,7 @@ module HscTypes (
GenAvailInfo(..), AvailInfo, RdrAvailInfo,
IfaceExport,
Deprecations, DeprecTxt, lookupDeprec, plusDeprecs,
Deprecations, DeprecTxt, plusDeprecs,
PackageInstEnv, PackageRuleBase,
......@@ -806,13 +806,6 @@ mkIfaceDepCache (DeprecSome pairs) = lookupOccEnv (mkOccEnv pairs) . nameOccName
emptyIfaceDepCache :: Name -> Maybe DeprecTxt
emptyIfaceDepCache n = Nothing
lookupDeprec :: Deprecations -> Name -> Maybe DeprecTxt
lookupDeprec NoDeprecs name = Nothing
lookupDeprec (DeprecAll txt) name = Just txt
lookupDeprec (DeprecSome env) name = case lookupNameEnv env name of
Just (_, txt) -> Just txt
Nothing -> Nothing
plusDeprecs :: Deprecations -> Deprecations -> Deprecations
plusDeprecs d NoDeprecs = d
plusDeprecs NoDeprecs d = d
......
......@@ -918,7 +918,7 @@ reportDeprecations dflags tcg_env
check hpt pit gre@(GRE {gre_name = name, gre_prov = Imported (imp_spec:_)})
| name `elemNameSet` used_names
, Just deprec_txt <- lookupDeprec dflags hpt pit gre
, Just deprec_txt <- lookupImpDeprec dflags hpt pit gre
= addWarnAt (importSpecLoc imp_spec)
(sep [ptext SLIT("Deprecated use of") <+>
pprNonVarNameSpace (occNameSpace (nameOccName name)) <+>
......@@ -940,9 +940,10 @@ reportDeprecations dflags tcg_env
-- the defn of a non-deprecated thing, when changing a module's
-- interface
lookupDeprec :: DynFlags -> HomePackageTable -> PackageIfaceTable
-> GlobalRdrElt -> Maybe DeprecTxt
lookupDeprec dflags hpt pit gre
lookupImpDeprec :: DynFlags -> HomePackageTable -> PackageIfaceTable
-> GlobalRdrElt -> Maybe DeprecTxt
-- The name is definitely imported, so look in HPT, PIT
lookupImpDeprec dflags hpt pit gre
= case lookupIfaceByModule dflags hpt pit (nameModule name) of
Just iface -> mi_dep_fn iface name `seqMaybe` -- Bleat if the thing, *or
case gre_par gre of
......
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