X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcRnMonad.lhs;h=0b5e4fc72a1a1f0c443d0ad6f1cf07c3cb74aae4;hp=1fa44ca308ec26c2aa184d8bebdad2486c5b3a3c;hb=afef39736dcde6f4947a6f362f9e6b3586933db4;hpb=bb3dcf3988d766149f7793b93210db5f64e91542 diff --git a/compiler/typecheck/TcRnMonad.lhs b/compiler/typecheck/TcRnMonad.lhs index 1fa44ca..0b5e4fc 100644 --- a/compiler/typecheck/TcRnMonad.lhs +++ b/compiler/typecheck/TcRnMonad.lhs @@ -50,7 +50,8 @@ import Outputable import UniqSupply ( UniqSupply, mkSplitUniqSupply, uniqFromSupply, splitUniqSupply ) import UniqFM ( unitUFM ) import Unique ( Unique ) -import DynFlags ( DynFlags(..), DynFlag(..), dopt, dopt_set, GhcMode ) +import DynFlags ( DynFlags(..), DynFlag(..), dopt, dopt_set, + dopt_unset, GhcMode ) import StaticFlags ( opt_PprStyle_Debug ) import Bag ( snocBag, unionBags ) import Panic ( showException ) @@ -268,6 +269,10 @@ setOptM :: DynFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a setOptM flag = updEnv (\ env@(Env { env_top = top }) -> env { env_top = top { hsc_dflags = dopt_set (hsc_dflags top) flag}} ) +unsetOptM :: DynFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a +unsetOptM flag = updEnv (\ env@(Env { env_top = top }) -> + env { env_top = top { hsc_dflags = dopt_unset (hsc_dflags top) flag}} ) + ifOptM :: DynFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl () -- Do it flag is true ifOptM flag thing_inside = do { b <- doptM flag; if b then thing_inside else return () }