X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Frename%2FRename.lhs;h=0cb23f06dd4c70d7ff9e6d463b957db4b9714261;hb=87fe9c34612b5149ae8c8307567cb4cf54db82f2;hp=614882a528802cb44935dfab137fcfb8e4f77a8b;hpb=9dd6e1c216993624a2cd74b62ca0f0569c02c26b;p=ghc-hetmet.git diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs index 614882a..0cb23f0 100644 --- a/ghc/compiler/rename/Rename.lhs +++ b/ghc/compiler/rename/Rename.lhs @@ -14,7 +14,7 @@ import RnHsSyn ( RenamedHsModule, RenamedHsDecl, extractHsTyNames ) import CmdLineOpts ( opt_HiMap, opt_WarnNameShadowing, opt_D_show_rn_trace, opt_D_dump_rn, opt_D_show_rn_stats, - opt_WarnUnusedNames + opt_WarnUnusedBinds, opt_WarnUnusedImports ) import RnMonad import RnNames ( getGlobalNames ) @@ -33,7 +33,7 @@ import Name ( Name, PrintUnqualified, Provenance, ExportFlag(..), ) import TysWiredIn ( unitTyCon, intTyCon, doubleTyCon ) import TyCon ( TyCon ) -import PrelMods ( mAIN, gHC_MAIN ) +import PrelMods ( mAIN, pREL_MAIN ) import PrelInfo ( ioTyCon_NAME ) import ErrUtils ( pprBagOfErrors, pprBagOfWarnings, doIfSet, dumpIfSet, ghcExit @@ -174,7 +174,7 @@ addImplicits mod_name -- Add occurrences for IO or PrimIO implicit_main | mod_name == mAIN - || mod_name == gHC_MAIN = [ioTyCon_NAME] + || mod_name == pREL_MAIN = [ioTyCon_NAME] | otherwise = [] \end{code} @@ -266,10 +266,6 @@ rn_data_decl mode (tycon_name,ty_decl) = rn_iface_decl mod_name mode (TyD ty_dec \begin{code} reportUnusedNames explicit_avail_names - | not opt_WarnUnusedNames - = returnRn () - - | otherwise = getSlurpedNames `thenRn` \ slurped_names -> let unused = explicit_avail_names `minusNameSet` slurped_names @@ -277,19 +273,19 @@ reportUnusedNames explicit_avail_names imports_by_module = equivClasses cmp imported_unused name1 `cmp` name2 = nameModule name1 `compare` nameModule name2 - pp_imp = sep [text "For information: the following unqualified imports are unused:", + pp_imp = sep [text "Warning: the following unqualified imports are unused:", nest 4 (vcat (map pp_group imports_by_module))] pp_group (n:ns) = sep [hcat [text "Module ", pprModule (nameModule n), char ':'], nest 4 (sep (map (pprOccName . nameOccName) (n:ns)))] - pp_local = sep [text "For information: the following local top-level definitions are unused:", + pp_local = sep [text "Warning: the following local top-level definitions are unused:", nest 4 (sep (map (pprOccName . nameOccName) local_unused))] in - (if null imported_unused + (if not opt_WarnUnusedImports || null imported_unused then returnRn () else addWarnRn pp_imp) `thenRn_` - (if null local_unused + (if not opt_WarnUnusedBinds || null local_unused then returnRn () else addWarnRn pp_local)