Remove unused lookupDeprec function
authorsimonpj@microsoft.com <unknown>
Thu, 2 Nov 2006 12:04:02 +0000 (12:04 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 2 Nov 2006 12:04:02 +0000 (12:04 +0000)
compiler/main/HscTypes.lhs
compiler/rename/RnNames.lhs

index d6edaeb..a0e4857 100644 (file)
@@ -51,7 +51,7 @@ module HscTypes (
        GenAvailInfo(..), AvailInfo, RdrAvailInfo, 
        IfaceExport,
 
        GenAvailInfo(..), AvailInfo, RdrAvailInfo, 
        IfaceExport,
 
-       Deprecations, DeprecTxt, lookupDeprec, plusDeprecs,
+       Deprecations, DeprecTxt, plusDeprecs,
 
        PackageInstEnv, PackageRuleBase,
 
 
        PackageInstEnv, PackageRuleBase,
 
@@ -806,13 +806,6 @@ mkIfaceDepCache (DeprecSome pairs) = lookupOccEnv (mkOccEnv pairs) . nameOccName
 emptyIfaceDepCache :: Name -> Maybe DeprecTxt
 emptyIfaceDepCache n = Nothing
 
 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
 plusDeprecs :: Deprecations -> Deprecations -> Deprecations
 plusDeprecs d NoDeprecs = d
 plusDeprecs NoDeprecs d = d
index 3671676..06cddd2 100644 (file)
@@ -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
 
     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)) <+> 
       = 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
 
            -- 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       
   = 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