projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Major patch to fix reporting of unused imports
[ghc-hetmet.git]
/
compiler
/
typecheck
/
TcRnMonad.lhs
diff --git
a/compiler/typecheck/TcRnMonad.lhs
b/compiler/typecheck/TcRnMonad.lhs
index
ca11d17
..
dbe822a
100644
(file)
--- a/
compiler/typecheck/TcRnMonad.lhs
+++ b/
compiler/typecheck/TcRnMonad.lhs
@@
-45,6
+45,7
@@
import Util
import System.IO
import Data.IORef
import System.IO
import Data.IORef
+import qualified Data.Set as Set
import Control.Monad
\end{code}
import Control.Monad
\end{code}
@@
-72,6
+73,7
@@
initTc hsc_env hsc_src keep_rn_syntax mod do_this
tvs_var <- newIORef emptyVarSet ;
dfuns_var <- newIORef emptyNameSet ;
keep_var <- newIORef emptyNameSet ;
tvs_var <- newIORef emptyVarSet ;
dfuns_var <- newIORef emptyNameSet ;
keep_var <- newIORef emptyNameSet ;
+ used_rdrnames_var <- newIORef Set.empty ;
th_var <- newIORef False ;
dfun_n_var <- newIORef 1 ;
type_env_var <- case hsc_type_env_var hsc_env of {
th_var <- newIORef False ;
dfun_n_var <- newIORef 1 ;
type_env_var <- case hsc_type_env_var hsc_env of {
@@
-97,9
+99,10
@@
initTc hsc_env hsc_src keep_rn_syntax mod do_this
tcg_th_used = th_var,
tcg_exports = [],
tcg_imports = emptyImportAvails,
tcg_th_used = th_var,
tcg_exports = [],
tcg_imports = emptyImportAvails,
+ tcg_used_rdrnames = used_rdrnames_var,
tcg_dus = emptyDUs,
tcg_dus = emptyDUs,
- tcg_rn_imports = maybe_rn_syntax [],
+ tcg_rn_imports = [],
tcg_rn_exports = maybe_rn_syntax [],
tcg_rn_decls = maybe_rn_syntax emptyRnGroup,
tcg_rn_exports = maybe_rn_syntax [],
tcg_rn_decls = maybe_rn_syntax emptyRnGroup,
@@
-366,9
+369,9
@@
traceOptTcRn flag doc = ifOptM flag $ do
; dumpTcRn real_doc }
dumpTcRn :: SDoc -> TcRn ()
; dumpTcRn real_doc }
dumpTcRn :: SDoc -> TcRn ()
-dumpTcRn doc = do { rdr_env <- getGlobalRdrEnv ;
- dflags <- getDOpts ;
- liftIO (printForUser stderr (mkPrintUnqualified dflags rdr_env) doc) }
+dumpTcRn doc = do { rdr_env <- getGlobalRdrEnv
+ ; dflags <- getDOpts
+ ; liftIO (printForUser stderr (mkPrintUnqualified dflags rdr_env) doc) }
debugDumpTcRn :: SDoc -> TcRn ()
debugDumpTcRn doc | opt_NoDebugOutput = return ()
debugDumpTcRn :: SDoc -> TcRn ()
debugDumpTcRn doc | opt_NoDebugOutput = return ()