Commit 51379b89 authored by Ömer Sinan Ağacan's avatar Ömer Sinan Ağacan Committed by Marge Bot

Add a new flag -dno-typeable-binds for debugging

See the user manual entry -- this helps when debugging as generated Core
gets smaller without these bindings.
parent b0fdd7fe
Pipeline #9996 passed with stages
in 349 minutes and 3 seconds
......@@ -508,8 +508,9 @@ data GeneralFlag
| Opt_DoCmmLinting
| Opt_DoAsmLinting
| Opt_DoAnnotationLinting
| Opt_NoLlvmMangler -- hidden flag
| Opt_FastLlvm -- hidden flag
| Opt_NoLlvmMangler -- hidden flag
| Opt_FastLlvm -- hidden flag
| Opt_NoTypeableBinds
| Opt_WarnIsError -- -Werror; makes warnings fatal
| Opt_ShowWarnGroups -- Show the group a warning belongs to
......@@ -3474,6 +3475,8 @@ dynamic_flags_deps = [
(NoArg (setGeneralFlag Opt_NoLlvmMangler)) -- hidden flag
, make_ord_flag defGhcFlag "fast-llvm"
(NoArg (setGeneralFlag Opt_FastLlvm)) -- hidden flag
, make_ord_flag defGhcFlag "dno-typeable-binds"
(NoArg (setGeneralFlag Opt_NoTypeableBinds))
, make_ord_flag defGhcFlag "ddump-debug"
(setDumpFlag Opt_D_dump_debug)
, make_ord_flag defGhcFlag "ddump-json"
......
......@@ -148,7 +148,9 @@ There are many wrinkles:
-- See Note [Grand plan for Typeable] in TcTypeable.
mkTypeableBinds :: TcM TcGblEnv
mkTypeableBinds
= do { -- Create a binding for $trModule.
= do { dflags <- getDynFlags
; if gopt Opt_NoTypeableBinds dflags then getGblEnv else do
{ -- Create a binding for $trModule.
-- Do this before processing any data type declarations,
-- which need tcg_tr_module to be initialised
; tcg_env <- mkModIdBindings
......@@ -166,7 +168,7 @@ mkTypeableBinds
; traceTc "mkTypeableBinds" (ppr tycons)
; this_mod_todos <- todoForTyCons mod mod_id tycons
; mkTypeRepTodoBinds (this_mod_todos : prim_todos)
} }
} } }
where
needs_typeable_binds tc
| tc `elem` [runtimeRepTyCon, vecCountTyCon, vecElemTyCon]
......
......@@ -885,3 +885,15 @@ Checking for determinism
generates in decreasing order
* ``-dinitial-unique=1 -dunique-increment=PRIME`` - where PRIME big enough
to overflow often - nonsequential order
Other
-----
.. ghc-flag:: -dno-typeable-binds
:shortdesc: Don't generate bindings for Typeable methods
:type: dynamic
This avoid generating Typeable-related bindings for modules and types. This
is useful when debugging because it gives smaller modules and dumps, but the
compiler will panic if you try to use Typeable instances of things that you
built with this flag.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment