diff options
author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2019-08-30 15:05:42 +0300 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-09-08 21:40:32 -0400 |
commit | 51379b89eb08252560e911ab559205ea69d21fec (patch) | |
tree | a22051d462b8040fd4bdfb71abb04b2e13c45691 /compiler | |
parent | b0fdd7fe666ae61044f041233354765c4bb68529 (diff) | |
download | haskell-51379b89eb08252560e911ab559205ea69d21fec.tar.gz |
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.
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/main/DynFlags.hs | 7 | ||||
-rw-r--r-- | compiler/typecheck/TcTypeable.hs | 6 |
2 files changed, 9 insertions, 4 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs index c4a917ff61..c2d0322cd9 100644 --- a/compiler/main/DynFlags.hs +++ b/compiler/main/DynFlags.hs @@ -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" diff --git a/compiler/typecheck/TcTypeable.hs b/compiler/typecheck/TcTypeable.hs index eb679e6daf..e2a0e66cd8 100644 --- a/compiler/typecheck/TcTypeable.hs +++ b/compiler/typecheck/TcTypeable.hs @@ -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] |