summaryrefslogtreecommitdiff
path: root/compiler/main
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main')
-rw-r--r--compiler/main/DynFlags.hs10
-rw-r--r--compiler/main/HscMain.hs2
-rw-r--r--compiler/main/HscTypes.hs10
3 files changed, 14 insertions, 8 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 6b066e3208..f5e2fd93aa 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -4755,6 +4755,7 @@ impliedXFlags
-- Make sure to note whether a flag is implied by -O0, -O or -O2.
optLevelFlags :: [([Int], GeneralFlag)]
+-- Default settings of flags, before any command-line overrides
optLevelFlags -- see Note [Documenting optimisation flags]
= [ ([0,1,2], Opt_DoLambdaEtaExpansion)
, ([0,1,2], Opt_DoEtaReduction) -- See Note [Eta-reduction in -O0]
@@ -4774,8 +4775,13 @@ optLevelFlags -- see Note [Documenting optimisation flags]
, ([1,2], Opt_CSE)
, ([1,2], Opt_StgCSE)
, ([2], Opt_StgLiftLams)
- , ([1,2], Opt_EnableRewriteRules) -- Off for -O0; see Note [Scoping for Builtin rules]
- -- in PrelRules
+
+ , ([1,2], Opt_EnableRewriteRules)
+ -- Off for -O0. Otherwise we desugar list literals
+ -- to 'build' but don't run the simplifier passes that
+ -- would rewrite them back to cons cells! This seems
+ -- silly, and matters for the GHCi debugger.
+
, ([1,2], Opt_FloatIn)
, ([1,2], Opt_FullLaziness)
, ([1,2], Opt_IgnoreAsserts)
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index aa4a6a4875..709999e06a 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -1895,7 +1895,7 @@ hscCompileCoreExpr' hsc_env srcspan ds_expr
= do { let dflags = hsc_dflags hsc_env
{- Simplify it -}
- ; simpl_expr <- simplifyExpr dflags ds_expr
+ ; simpl_expr <- simplifyExpr hsc_env ds_expr
{- Tidy it (temporary, until coreSat does cloning) -}
; let tidy_expr = tidyExpr emptyTidyEnv simpl_expr
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs
index 223b566031..25b2f3e172 100644
--- a/compiler/main/HscTypes.hs
+++ b/compiler/main/HscTypes.hs
@@ -2276,28 +2276,28 @@ lookupTypeHscEnv hsc_env name = do
hpt = hsc_HPT hsc_env
-- | Get the 'TyCon' from a 'TyThing' if it is a type constructor thing. Panics otherwise
-tyThingTyCon :: TyThing -> TyCon
+tyThingTyCon :: HasDebugCallStack => TyThing -> TyCon
tyThingTyCon (ATyCon tc) = tc
tyThingTyCon other = pprPanic "tyThingTyCon" (ppr other)
-- | Get the 'CoAxiom' from a 'TyThing' if it is a coercion axiom thing. Panics otherwise
-tyThingCoAxiom :: TyThing -> CoAxiom Branched
+tyThingCoAxiom :: HasDebugCallStack => TyThing -> CoAxiom Branched
tyThingCoAxiom (ACoAxiom ax) = ax
tyThingCoAxiom other = pprPanic "tyThingCoAxiom" (ppr other)
-- | Get the 'DataCon' from a 'TyThing' if it is a data constructor thing. Panics otherwise
-tyThingDataCon :: TyThing -> DataCon
+tyThingDataCon :: HasDebugCallStack => TyThing -> DataCon
tyThingDataCon (AConLike (RealDataCon dc)) = dc
tyThingDataCon other = pprPanic "tyThingDataCon" (ppr other)
-- | Get the 'ConLike' from a 'TyThing' if it is a data constructor thing.
-- Panics otherwise
-tyThingConLike :: TyThing -> ConLike
+tyThingConLike :: HasDebugCallStack => TyThing -> ConLike
tyThingConLike (AConLike dc) = dc
tyThingConLike other = pprPanic "tyThingConLike" (ppr other)
-- | Get the 'Id' from a 'TyThing' if it is a id *or* data constructor thing. Panics otherwise
-tyThingId :: TyThing -> Id
+tyThingId :: HasDebugCallStack => TyThing -> Id
tyThingId (AnId id) = id
tyThingId (AConLike (RealDataCon dc)) = dataConWrapId dc
tyThingId other = pprPanic "tyThingId" (ppr other)