[commit: ghc] ghc-generics1: Only output generic instances with -ddump-deriv when there is something to output (f5f2210)
José Pedro Magalhães
jpm at cs.uu.nl
Sun Apr 22 14:21:23 CEST 2012
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : ghc-generics1
http://hackage.haskell.org/trac/ghc/changeset/f5f22107e1fcfecdfaab1a8d99af4b1763d3a4cb
>---------------------------------------------------------------
commit f5f22107e1fcfecdfaab1a8d99af4b1763d3a4cb
Author: Jose Pedro Magalhaes <jpm at cs.uu.nl>
Date: Sun Apr 22 10:49:00 2012 +0200
Only output generic instances with -ddump-deriv when there is something to output
>---------------------------------------------------------------
compiler/typecheck/TcDeriv.lhs | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/compiler/typecheck/TcDeriv.lhs b/compiler/typecheck/TcDeriv.lhs
index 0e2f855..512b21f 100644
--- a/compiler/typecheck/TcDeriv.lhs
+++ b/compiler/typecheck/TcDeriv.lhs
@@ -335,9 +335,10 @@ tcDeriving tycl_decls inst_decls deriv_decls
; (inst_info, rn_binds, rn_dus) <-
renameDeriv is_boot (inst_infos ++ (bagToList extraInstances)) binds
- ; dflags <- getDynFlags
- ; liftIO (dumpIfSet_dyn dflags Opt_D_dump_deriv "Derived instances"
- (ddump_deriving inst_info rn_binds newTyCons famInsts))
+ ; dflags <- getDynFlags
+ ; unless (isEmptyBag inst_info) $
+ liftIO (dumpIfSet_dyn dflags Opt_D_dump_deriv "Derived instances"
+ (ddump_deriving inst_info rn_binds newTyCons famInsts))
; let all_tycons = map ATyCon (bagToList newTyCons)
; gbl_env <- tcExtendGlobalEnv all_tycons $
More information about the Cvs-ghc
mailing list