[project @ 2005-05-19 11:15:40 by simonpj]
authorsimonpj <unknown>
Thu, 19 May 2005 11:15:44 +0000 (11:15 +0000)
committersimonpj <unknown>
Thu, 19 May 2005 11:15:44 +0000 (11:15 +0000)
commit4a5870490196e05c40a9362ac2fef0081567bffc
treecc37e04dc4452a45bf2c947f2c1fbf1afad4f42e
parentf01b31dd2e962b5d2ffcad547b3c781d41ec186b
[project @ 2005-05-19 11:15:40 by simonpj]
Tune up the reporting of unused imports

Merge to STABLE
(I think the earlier change made it across)
(PS: the commit also does some trimming of
redundant imports.  If they don't merge, just
discard them.)

My earlier fixes to the reporting of unused imports still missed
some obscure cases, some of which are now fixed by this commit.
I had to make the import-provenance data type yet richer, but in
fact it has more sharing now, so it may be cheaper on space.

There's still one infelicity. Consider
import M( x )
imoprt N( x )
where the same underlying 'x' is involved in both cases.  Currently we
don't report a redundant import, because dropping either import would
change the qualified names in scope (M.x, N.x). But if the qualified
names aren't used, the import is indeed redundant. Sadly we don't know
that, because we only know what Names are used.  Left for the future!
There's a comment in RnNames.warnDuplicateImports

This commit also trims quite a few redundant imports disovered
by the new setup.
17 files changed:
ghc/compiler/basicTypes/RdrName.lhs
ghc/compiler/deSugar/Desugar.lhs
ghc/compiler/deSugar/DsCCall.lhs
ghc/compiler/deSugar/DsExpr.lhs
ghc/compiler/deSugar/DsMonad.lhs
ghc/compiler/iface/BuildTyCl.lhs
ghc/compiler/iface/MkIface.lhs
ghc/compiler/main/DriverPipeline.hs
ghc/compiler/main/GHC.hs
ghc/compiler/main/HscMain.lhs
ghc/compiler/parser/RdrHsSyn.lhs
ghc/compiler/prelude/TysWiredIn.lhs
ghc/compiler/rename/RnEnv.lhs
ghc/compiler/rename/RnNames.lhs
ghc/compiler/simplCore/SimplCore.lhs
ghc/compiler/typecheck/Inst.lhs
ghc/compiler/typecheck/TcSimplify.lhs