diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2016-09-19 10:08:29 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2016-10-21 17:07:44 +0100 |
commit | 82efad788ed331ae16b586a4fbe4c4a4f92ee638 (patch) | |
tree | 0a018bd3a71ad8332305e8778edfa181a5d789dc /compiler | |
parent | 45bfd1a65978ee282d8d2cc1ddb7e3e5f4cd4717 (diff) | |
download | haskell-82efad788ed331ae16b586a4fbe4c4a4f92ee638.tar.gz |
Comments and trivial refactoring
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/basicTypes/BasicTypes.hs | 2 | ||||
-rw-r--r-- | compiler/hsSyn/HsBinds.hs | 4 | ||||
-rw-r--r-- | compiler/simplCore/CoreMonad.hs | 16 | ||||
-rw-r--r-- | compiler/simplCore/SimplCore.hs | 16 | ||||
-rw-r--r-- | compiler/typecheck/TcInstDcls.hs | 6 |
5 files changed, 23 insertions, 21 deletions
diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs index 0429a43f5d..4f574356cf 100644 --- a/compiler/basicTypes/BasicTypes.hs +++ b/compiler/basicTypes/BasicTypes.hs @@ -987,7 +987,7 @@ data InlinePragma -- Note [InlinePragma] -- That is, inl_sat describes the number of *source-code* -- arguments the thing must be applied to. We add on the -- number of implicit, dictionary arguments when making - -- the InlineRule, and don't look at inl_sat further + -- the Unfolding, and don't look at inl_sat further , inl_act :: Activation -- Says during which phases inlining is allowed diff --git a/compiler/hsSyn/HsBinds.hs b/compiler/hsSyn/HsBinds.hs index 236892e70d..487859249f 100644 --- a/compiler/hsSyn/HsBinds.hs +++ b/compiler/hsSyn/HsBinds.hs @@ -593,6 +593,7 @@ ppr_monobind (AbsBinds { abs_tvs = tyvars, abs_ev_vars = dictvars pprLHsBinds val_binds ppr_monobind (AbsBindsSig { abs_tvs = tyvars , abs_ev_vars = dictvars + , abs_sig_export = poly_id , abs_sig_ev_bind = ev_bind , abs_sig_bind = bind }) = sdocWithDynFlags $ \ dflags -> @@ -600,7 +601,8 @@ ppr_monobind (AbsBindsSig { abs_tvs = tyvars hang (text "AbsBindsSig" <+> brackets (interpp'SP tyvars) <+> brackets (interpp'SP dictvars)) 2 $ braces $ vcat - [ text "Bind:" <+> ppr bind + [ text "Exported type:" <+> pprBndr LetBind poly_id + , text "Bind:" <+> ppr bind , text "Evidence:" <+> ppr ev_bind ] else ppr bind diff --git a/compiler/simplCore/CoreMonad.hs b/compiler/simplCore/CoreMonad.hs index a12607bd84..314d0945d5 100644 --- a/compiler/simplCore/CoreMonad.hs +++ b/compiler/simplCore/CoreMonad.hs @@ -239,22 +239,6 @@ runMaybe (Just x) f = f x runMaybe Nothing _ = CoreDoNothing {- -Note [RULEs enabled in SimplGently] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -RULES are enabled when doing "gentle" simplification. Two reasons: - - * We really want the class-op cancellation to happen: - op (df d1 d2) --> $cop3 d1 d2 - because this breaks the mutual recursion between 'op' and 'df' - - * I wanted the RULE - lift String ===> ... - to work in Template Haskell when simplifying - splices, so we get simpler code for literal strings - -But watch out: list fusion can prevent floating. So use phase control -to switch off those rules until after floating. - ************************************************************************ * * diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs index 8bc03929f0..0af167ef3e 100644 --- a/compiler/simplCore/SimplCore.hs +++ b/compiler/simplCore/SimplCore.hs @@ -367,6 +367,22 @@ addPluginPasses builtin_passes #endif {- +Note [RULEs enabled in SimplGently] +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +RULES are enabled when doing "gentle" simplification. Two reasons: + + * We really want the class-op cancellation to happen: + op (df d1 d2) --> $cop3 d1 d2 + because this breaks the mutual recursion between 'op' and 'df' + + * I wanted the RULE + lift String ===> ... + to work in Template Haskell when simplifying + splices, so we get simpler code for literal strings + +But watch out: list fusion can prevent floating. So use phase control +to switch off those rules until after floating. + ************************************************************************ * * The CoreToDo interpreter diff --git a/compiler/typecheck/TcInstDcls.hs b/compiler/typecheck/TcInstDcls.hs index c18d69d4be..ab5b75c056 100644 --- a/compiler/typecheck/TcInstDcls.hs +++ b/compiler/typecheck/TcInstDcls.hs @@ -1323,15 +1323,15 @@ tcMethodBody clas tyvars dfun_ev_vars inst_tys -- Substitute the local_meth_name for the binder -- NB: the binding is always a FunBind - ; global_meth_id <- addInlinePrags global_meth_id prags - ; spec_prags <- tcSpecPrags global_meth_id prags - -- taking instance signature into account might change the type of -- the local_meth_id ; (meth_implic, ev_binds_var, tc_bind) <- checkInstConstraints $ tcMethodBodyHelp sig_fn sel_id local_meth_id (L bind_loc lm_bind) + ; global_meth_id <- addInlinePrags global_meth_id prags + ; spec_prags <- tcSpecPrags global_meth_id prags + ; let specs = mk_meth_spec_prags global_meth_id spec_inst_prags spec_prags export = ABE { abe_poly = global_meth_id , abe_mono = local_meth_id |