diff options
| -rw-r--r-- | compiler/codeGen/StgCmmBind.hs | 3 | ||||
| -rw-r--r-- | compiler/codeGen/StgCmmLayout.hs | 3 | ||||
| -rw-r--r-- | compiler/main/DynFlags.hs | 5 | ||||
| -rw-r--r-- | compiler/typecheck/TcRnMonad.lhs | 12 |
4 files changed, 11 insertions, 12 deletions
diff --git a/compiler/codeGen/StgCmmBind.hs b/compiler/codeGen/StgCmmBind.hs index 02d3d0246f..89d27dd161 100644 --- a/compiler/codeGen/StgCmmBind.hs +++ b/compiler/codeGen/StgCmmBind.hs @@ -468,8 +468,7 @@ closureCodeBody top_lvl bndr cl_info cc args arity body fv_details { fv_bindings <- mapM bind_fv fv_details -- Load free vars out of closure *after* -- heap check, to reduce live vars over check - ; if node_points then load_fvs node lf_info fv_bindings - else return () + ; when node_points $ load_fvs node lf_info fv_bindings ; void $ cgExpr body }} } diff --git a/compiler/codeGen/StgCmmLayout.hs b/compiler/codeGen/StgCmmLayout.hs index 69a0d1a0cf..fa80edc96c 100644 --- a/compiler/codeGen/StgCmmLayout.hs +++ b/compiler/codeGen/StgCmmLayout.hs @@ -61,6 +61,7 @@ import Util import Data.List import Outputable import FastString +import Control.Monad ------------------------------------------------------------------------ -- Call and return sequences @@ -86,7 +87,7 @@ emitReturn results do { adjustHpBackwards ; emit (mkReturnSimple dflags results updfr_off) } AssignTo regs adjust -> - do { if adjust then adjustHpBackwards else return () + do { when adjust adjustHpBackwards ; emitMultiAssign regs results } ; return AssignedDirectly } diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 70ade2ad78..080539a68c 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -2424,9 +2424,8 @@ xFlags = [ ( "MultiWayIf", Opt_MultiWayIf, nop ), ( "MonoLocalBinds", Opt_MonoLocalBinds, nop ), ( "RelaxedPolyRec", Opt_RelaxedPolyRec, - \ turn_on -> if not turn_on - then deprecate "You can't turn off RelaxedPolyRec any more" - else return () ), + \ turn_on -> unless turn_on + $ deprecate "You can't turn off RelaxedPolyRec any more" ), ( "ExtendedDefaultRules", Opt_ExtendedDefaultRules, nop ), ( "ImplicitParams", Opt_ImplicitParams, nop ), ( "ScopedTypeVariables", Opt_ScopedTypeVariables, nop ), diff --git a/compiler/typecheck/TcRnMonad.lhs b/compiler/typecheck/TcRnMonad.lhs index 8b84d552f1..3cfc7044c6 100644 --- a/compiler/typecheck/TcRnMonad.lhs +++ b/compiler/typecheck/TcRnMonad.lhs @@ -285,16 +285,16 @@ unsetWOptM flag = updEnv (\ env@(Env { env_top = top }) -> -- | Do it flag is true ifDOptM :: DynFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl () -ifDOptM flag thing_inside = do { b <- doptM flag ; - if b then thing_inside else return () } +ifDOptM flag thing_inside = do b <- doptM flag + when b thing_inside ifWOptM :: WarningFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl () -ifWOptM flag thing_inside = do { b <- woptM flag ; - if b then thing_inside else return () } +ifWOptM flag thing_inside = do b <- woptM flag + when b thing_inside ifXOptM :: ExtensionFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl () -ifXOptM flag thing_inside = do { b <- xoptM flag ; - if b then thing_inside else return () } +ifXOptM flag thing_inside = do b <- xoptM flag + when b thing_inside getGhcMode :: TcRnIf gbl lcl GhcMode getGhcMode = do { env <- getTopEnv; return (ghcMode (hsc_dflags env)) } |
