Commit 05a0a647 authored by ian@well-typed.com's avatar ian@well-typed.com

Change some "else return ()"s to use when/unless

parent aa6bc700
......@@ -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
}}
}
......
......@@ -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
}
......
......@@ -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 ),
......
......@@ -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)) }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment