diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-10-19 20:35:19 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-10-19 20:35:19 +0100 |
commit | 429c81c5ae861afd0e6910b7c0d331e65e8d4022 (patch) | |
tree | cff5e73aa7cdff9d42bf8ae4234031066b5a70bb /compiler/deSugar | |
parent | 8e189a7d9924166e9bb4c4e0200fa64512a7d151 (diff) | |
parent | 6c547271343be0620503f07508b109b170562af6 (diff) | |
download | haskell-429c81c5ae861afd0e6910b7c0d331e65e8d4022.tar.gz |
Merge branch 'master' of http://darcs.haskell.org/ghc
Diffstat (limited to 'compiler/deSugar')
-rw-r--r-- | compiler/deSugar/Coverage.lhs | 14 | ||||
-rw-r--r-- | compiler/deSugar/Desugar.lhs | 8 | ||||
-rw-r--r-- | compiler/deSugar/DsExpr.lhs | 6 | ||||
-rw-r--r-- | compiler/deSugar/DsListComp.lhs | 2 | ||||
-rw-r--r-- | compiler/deSugar/DsMonad.lhs | 4 | ||||
-rw-r--r-- | compiler/deSugar/Match.lhs | 3 |
6 files changed, 19 insertions, 18 deletions
diff --git a/compiler/deSugar/Coverage.lhs b/compiler/deSugar/Coverage.lhs index 551355cb62..14e875a6ec 100644 --- a/compiler/deSugar/Coverage.lhs +++ b/compiler/deSugar/Coverage.lhs @@ -90,8 +90,8 @@ addTicksToBinds dflags mod mod_loc exports tyCons binds = , this_mod = mod , tickishType = case hscTarget dflags of HscInterpreted -> Breakpoints - _ | dopt Opt_Hpc dflags -> HpcTicks - | dopt Opt_SccProfilingOn dflags + _ | gopt Opt_Hpc dflags -> HpcTicks + | gopt Opt_SccProfilingOn dflags -> ProfNotes | otherwise -> error "addTicksToBinds: No way to annotate!" }) @@ -106,7 +106,7 @@ addTicksToBinds dflags mod mod_loc exports tyCons binds = hashNo <- writeMixEntries dflags mod count entries orig_file2 modBreaks <- mkModBreaks dflags count entries - doIfSet_dyn dflags Opt_D_dump_ticked $ + when (dopt Opt_D_dump_ticked dflags) $ log_action dflags dflags SevDump noSrcSpan defaultDumpStyle (pprLHsBinds binds1) @@ -145,7 +145,7 @@ mkModBreaks dflags count entries = do writeMixEntries :: DynFlags -> Module -> Int -> [MixEntry_] -> FilePath -> IO Int writeMixEntries dflags mod count entries filename - | not (dopt Opt_Hpc dflags) = return 0 + | not (gopt Opt_Hpc dflags) = return 0 | otherwise = do let hpc_dir = hpcDir dflags @@ -183,7 +183,7 @@ data TickDensity mkDensity :: DynFlags -> TickDensity mkDensity dflags - | dopt Opt_Hpc dflags = TickForCoverage + | gopt Opt_Hpc dflags = TickForCoverage | HscInterpreted <- hscTarget dflags = TickForBreakPoints | ProfAutoAll <- profAuto dflags = TickAllFunctions | ProfAutoTop <- profAuto dflags = TickTopFunctions @@ -269,7 +269,7 @@ addTickLHsBind (L pos (funBind@(FunBind { fun_id = (L _ id) }))) = do || id `elemVarSet` inline_ids -- See Note [inline sccs] - if inline && dopt Opt_SccProfilingOn dflags then return (L pos funBind) else do + if inline && gopt Opt_SccProfilingOn dflags then return (L pos funBind) else do (fvs, (MatchGroup matches' ty)) <- getFreeVars $ @@ -1084,7 +1084,7 @@ mkTickish boxLabel countEntries topOnly pos fvs decl_path = dflags = tte_dflags env - count = countEntries && dopt Opt_ProfCountEntries dflags + count = countEntries && gopt Opt_ProfCountEntries dflags tickish = case tickishType env of HpcTicks -> HpcTick (this_mod env) c diff --git a/compiler/deSugar/Desugar.lhs b/compiler/deSugar/Desugar.lhs index ee606808d9..9a73893b44 100644 --- a/compiler/deSugar/Desugar.lhs +++ b/compiler/deSugar/Desugar.lhs @@ -108,9 +108,9 @@ deSugar hsc_env Just ([], nilOL, [], [], NoStubs, hpcInfo, emptyModBreaks)) _ -> do - let want_ticks = dopt Opt_Hpc dflags + let want_ticks = gopt Opt_Hpc dflags || target == HscInterpreted - || (dopt Opt_SccProfilingOn dflags + || (gopt Opt_SccProfilingOn dflags && case profAuto dflags of NoProfAuto -> False _ -> True) @@ -129,7 +129,7 @@ deSugar hsc_env ; ds_rules <- mapMaybeM dsRule rules ; ds_vects <- mapM dsVect vects ; let hpc_init - | dopt Opt_Hpc dflags = hpcInitCode mod ds_hpc_info + | gopt Opt_Hpc dflags = hpcInitCode mod ds_hpc_info | otherwise = empty ; return ( ds_ev_binds , foreign_prs `appOL` core_prs `appOL` spec_prs @@ -357,7 +357,7 @@ dsRule (L loc (HsRule name act vars lhs _tv_lhs rhs _fv_rhs)) = putSrcSpanDs loc $ do { let bndrs' = [var | RuleBndr (L _ var) <- vars] - ; lhs' <- unsetDOptM Opt_EnableRewriteRules $ + ; lhs' <- unsetGOptM Opt_EnableRewriteRules $ unsetWOptM Opt_WarnIdentities $ dsLExpr lhs -- Note [Desugaring RULE left hand sides] diff --git a/compiler/deSugar/DsExpr.lhs b/compiler/deSugar/DsExpr.lhs index c4ee50f54d..fb579ab672 100644 --- a/compiler/deSugar/DsExpr.lhs +++ b/compiler/deSugar/DsExpr.lhs @@ -297,7 +297,7 @@ dsExpr (ExplicitTuple tup_args boxity) dsExpr (HsSCC cc expr@(L loc _)) = do mod_name <- getModuleDs - count <- doptM Opt_ProfCountEntries + count <- goptM Opt_ProfCountEntries uniq <- newUnique Tick (ProfNote (mkUserCC cc mod_name loc uniq) count True) <$> dsLExpr expr @@ -687,8 +687,8 @@ dsExplicitList elt_ty xs = do { dflags <- getDynFlags ; xs' <- mapM dsLExpr xs ; let (dynamic_prefix, static_suffix) = spanTail is_static xs' - ; if dopt Opt_SimpleListLiterals dflags -- -fsimple-list-literals - || not (dopt Opt_EnableRewriteRules dflags) -- Rewrite rules off + ; if gopt Opt_SimpleListLiterals dflags -- -fsimple-list-literals + || not (gopt Opt_EnableRewriteRules dflags) -- Rewrite rules off -- Don't generate a build if there are no rules to eliminate it! -- See Note [Desugaring RULE left hand sides] in Desugar || null dynamic_prefix -- Avoid build (\c n. foldr c n xs)! diff --git a/compiler/deSugar/DsListComp.lhs b/compiler/deSugar/DsListComp.lhs index b590a92057..1b81e1a248 100644 --- a/compiler/deSugar/DsListComp.lhs +++ b/compiler/deSugar/DsListComp.lhs @@ -53,7 +53,7 @@ dsListComp lquals res_ty = do [elt_ty] -> elt_ty _ -> pprPanic "dsListComp" (ppr res_ty $$ ppr lquals) - if not (dopt Opt_EnableRewriteRules dflags) || dopt Opt_IgnoreInterfacePragmas dflags + if not (gopt Opt_EnableRewriteRules dflags) || gopt Opt_IgnoreInterfacePragmas dflags -- Either rules are switched off, or we are ignoring what there are; -- Either way foldr/build won't happen, so use the more efficient -- Wadler-style desugaring diff --git a/compiler/deSugar/DsMonad.lhs b/compiler/deSugar/DsMonad.lhs index 46c7bf269b..6ed0f64a06 100644 --- a/compiler/deSugar/DsMonad.lhs +++ b/compiler/deSugar/DsMonad.lhs @@ -9,7 +9,7 @@ module DsMonad ( DsM, mapM, mapAndUnzipM, initDs, initDsTc, fixDs, - foldlM, foldrM, ifDOptM, unsetDOptM, unsetWOptM, + foldlM, foldrM, whenGOptM, unsetGOptM, unsetWOptM, Applicative(..),(<$>), newLocalName, @@ -220,7 +220,7 @@ initDs hsc_env mod rdr_env type_env thing_inside -- * 'Data.Array.Parallel.Prim' iff '-fvectorise' specified. loadDAP thing_inside = do { dapEnv <- loadOneModule dATA_ARRAY_PARALLEL_NAME checkLoadDAP paErr - ; dappEnv <- loadOneModule dATA_ARRAY_PARALLEL_PRIM_NAME (doptM Opt_Vectorise) veErr + ; dappEnv <- loadOneModule dATA_ARRAY_PARALLEL_PRIM_NAME (goptM Opt_Vectorise) veErr ; updGblEnv (\env -> env {ds_dph_env = dapEnv `plusOccEnv` dappEnv }) thing_inside } where diff --git a/compiler/deSugar/Match.lhs b/compiler/deSugar/Match.lhs index c650e103a8..75a3aa5191 100644 --- a/compiler/deSugar/Match.lhs +++ b/compiler/deSugar/Match.lhs @@ -23,6 +23,7 @@ import DynFlags import HsSyn import TcHsSyn import TcEvidence +import TcRnMonad import Check import CoreSyn import Literal @@ -301,7 +302,7 @@ match vars@(v:_) ty eqns ; let grouped = groupEquations dflags tidy_eqns -- print the view patterns that are commoned up to help debug - ; ifDOptM Opt_D_dump_view_pattern_commoning (debug grouped) + ; whenDOptM Opt_D_dump_view_pattern_commoning (debug grouped) ; match_results <- mapM match_group grouped ; return (adjustMatchResult (foldr1 (.) aux_binds) $ |