X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FDynFlags.hs;h=2afa91d172b6ca063dd2ec89366385906be6714d;hb=493fd9dfc6a7a60a7f5fdc126e2c4b731fbb4c3c;hp=359ea39ec8806ccaa3a696278342a8ba2b32191f;hpb=97c186be0bd51ebe0fb4c28df8836f03e3dbd06d;p=ghc-hetmet.git diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index 359ea39..2afa91d 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -774,6 +774,10 @@ runWhen :: Bool -> CoreToDo -> CoreToDo runWhen True do_this = do_this runWhen False do_this = CoreDoNothing +runMaybe :: Maybe a -> (a -> CoreToDo) -> CoreToDo +runMaybe (Just x) f = f x +runMaybe Nothing _ = CoreDoNothing + getCoreToDo :: DynFlags -> [CoreToDo] getCoreToDo dflags | Just todo <- coreToDo dflags = todo -- set explicitly by user @@ -790,8 +794,7 @@ getCoreToDo dflags rule_check = ruleCheck dflags vectorisation = dopt Opt_Vectorise dflags - maybe_rule_check phase | Just s <- rule_check = CoreDoRuleCheck phase s - | otherwise = CoreDoNothing + maybe_rule_check phase = runMaybe rule_check (CoreDoRuleCheck phase) simpl_phase phase iter = CoreDoPasses [ CoreDoSimplify (SimplPhase phase) [ @@ -842,7 +845,7 @@ getCoreToDo dflags -- We run vectorisation here for now, but we might also try to run -- it later - runWhen vectorisation (CoreDoPasses [ CoreDoVectorisation, simpl_gently]), + runWhen vectorisation (CoreDoPasses [ CoreDoVectorisation, simpl_gently ]), -- Specialisation is best done before full laziness -- so that overloaded functions have all their dictionary lambdas manifest @@ -1332,7 +1335,10 @@ xFlags = [ impliedFlags :: [(DynFlag, [DynFlag])] impliedFlags = [ - ( Opt_GADTs, [Opt_RelaxedPolyRec] ) -- We want type-sig variables to be completely rigid for GADTs + ( Opt_GADTs, [Opt_RelaxedPolyRec] ) -- We want type-sig variables to + -- be completely rigid for GADTs + , ( Opt_ScopedTypeVariables, [Opt_RelaxedPolyRec] ) -- Ditto for scoped type variables; see + -- Note [Scoped tyvars] in TcBinds ] glasgowExtsFlags = [