[project @ 2003-12-31 08:23:25 by simonpj]
authorsimonpj <unknown>
Wed, 31 Dec 2003 08:23:27 +0000 (08:23 +0000)
committersimonpj <unknown>
Wed, 31 Dec 2003 08:23:27 +0000 (08:23 +0000)
commit7473349e010c1f8f5d78afbe2b7c66345818406c
tree4155444775f951ec0a1aaf7db98b4560c866bf38
parent94a28821c91acc060baa966a64e23e1dbff3d069
[project @ 2003-12-31 08:23:25 by simonpj]
-----------------------------
        Improve deprecation reporting
-----------------------------

[PS: the 1.31 commit of basicTypes/RdrName.lhs
 also belongs in this commit.]

Up to now, deprecated functions are only reported when imported
from the module defining them, but not when re-exporting.  This
seems wrong -- often a "root" module gathers exports from sub-modules.

It turned out that there was a structural problem: the deprectaions
were getting put in the GlobalRdrEnv, and it simply doesn't have
the defining-module's interface to hand.

So this commit removes gre_deprec from GRE, and moves deprecation
reporting from the individual occurrences (RnEnv.lookupGreRn) to
RnNames.reportUnusedNames.  In many ways this is a better place for it,
because there we get a global view of the entire module.  For example,
repeated use of a single deprecated thing will only give rise to one
warning instead of multiple warnings.

So here's what we now get:

  Foo.hs:3:0:
    Warning: Deprecated use of Variable `withObject'
     (imported from Foreign.Marshal, but defined in Foreign.Marshal.Utils)
     use `with' instead
ghc/compiler/basicTypes/OccName.lhs
ghc/compiler/rename/RnEnv.lhs
ghc/compiler/rename/RnNames.lhs
ghc/compiler/typecheck/TcRnDriver.lhs