[project @ 2001-05-18 08:46:18 by simonpj]
[ghc-hetmet.git] / ghc / compiler / rename / RnBinds.lhs
index 32e37cd..33dacd7 100644 (file)
@@ -167,16 +167,16 @@ rnTopMonoBinds mbinds sigs
        bndr_name_set = mkNameSet binder_names
     in
     renameSigsFVs (okBindSig bndr_name_set) sigs       `thenRn` \ (siglist, sig_fvs) ->
-    doptRn Opt_WarnMissingSigs                         `thenRn` \ warnMissing ->
-    let
-       type_sig_vars   = [n | Sig n _ _ <- siglist]
-       un_sigd_binders | warnMissing = nameSetToList (delListFromNameSet 
-                                                          bndr_name_set type_sig_vars)
-                       | otherwise   = []
-    in
-    mapRn_ missingSigWarn un_sigd_binders      `thenRn_`
 
-    rn_mono_binds siglist mbinds                  `thenRn` \ (final_binds, bind_fvs) ->
+    ifOptRn Opt_WarnMissingSigs (
+       let
+           type_sig_vars   = [n | Sig n _ _ <- siglist]
+           un_sigd_binders = nameSetToList (delListFromNameSet bndr_name_set type_sig_vars)
+       in
+        mapRn_ missingSigWarn un_sigd_binders
+    )                                          `thenRn_`
+
+    rn_mono_binds siglist mbinds               `thenRn` \ (final_binds, bind_fvs) ->
     returnRn (final_binds, bind_fvs `plusFV` sig_fvs)
   where
     binder_rdr_names = collectMonoBinders mbinds
@@ -524,9 +524,6 @@ renameSig (SpecInstSig ty src_loc)
     rnHsType (text "A SPECIALISE instance pragma") ty `thenRn` \ new_ty ->
     returnRn (SpecInstSig new_ty src_loc)
 
-renameSig (InlineInstSig p src_loc)
-  = returnRn (InlineInstSig p src_loc)
-
 renameSig (SpecSig v ty src_loc)
   = pushSrcLocRn src_loc $
     lookupSigOccRn v                   `thenRn` \ new_v ->
@@ -549,29 +546,6 @@ renameSig (NoInlineSig v p src_loc)
     returnRn (NoInlineSig new_v p src_loc)
 \end{code}
 
-\begin{code}
-renameIE :: (RdrName -> RnMS Name) -> IE RdrName -> RnMS (IE Name, FreeVars)
-renameIE lookup_occ_nm (IEVar v)
-  = lookup_occ_nm v            `thenRn` \ new_v ->
-    returnRn (IEVar new_v, unitFV new_v)
-
-renameIE lookup_occ_nm (IEThingAbs v)
-  = lookup_occ_nm v            `thenRn` \ new_v ->
-    returnRn (IEThingAbs new_v, unitFV new_v)
-
-renameIE lookup_occ_nm (IEThingAll v)
-  = lookup_occ_nm v            `thenRn` \ new_v ->
-    returnRn (IEThingAll new_v, unitFV new_v)
-
-renameIE lookup_occ_nm (IEThingWith v vs)
-  = lookup_occ_nm v            `thenRn` \ new_v ->
-    mapRn lookup_occ_nm vs     `thenRn` \ new_vs ->
-    returnRn (IEThingWith new_v new_vs, plusFVs [ unitFV x | x <- new_v:new_vs ])
-
-renameIE lookup_occ_nm (IEModuleContents m)
-  = returnRn (IEModuleContents m, emptyFVs)
-\end{code}
-
 
 %************************************************************************
 %*                                                                     *