Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/e9f5a88a0b05991a0fe691027863ac8e3461e08a

>---------------------------------------------------------------

commit e9f5a88a0b05991a0fe691027863ac8e3461e08a
Author: Simon Peyton Jones <simo...@microsoft.com>
Date:   Fri Sep 2 09:11:50 2011 +0100

    More debug info on provenance with -dppr-debug

>---------------------------------------------------------------

 compiler/basicTypes/RdrName.lhs |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/compiler/basicTypes/RdrName.lhs b/compiler/basicTypes/RdrName.lhs
index 5a8ef67..7f7d048 100644
--- a/compiler/basicTypes/RdrName.lhs
+++ b/compiler/basicTypes/RdrName.lhs
@@ -67,6 +67,7 @@ import SrcLoc
 import FastString
 import Outputable
 import Util
+import StaticFlags( opt_PprStyle_Debug )
 
 import Data.Data
 \end{code}
@@ -715,8 +716,11 @@ pprNameProvenance (GRE {gre_name = name, gre_prov = 
LocalDef})
   = ptext (sLit "defined at") <+> ppr (nameSrcLoc name)
 pprNameProvenance (GRE {gre_name = name, gre_prov = Imported whys})
   = case whys of
-       (why:_) -> sep [ppr why, ppr_defn_site why name]
+       (why:_) | opt_PprStyle_Debug -> vcat (map pp_why whys)
+                | otherwise          -> pp_why why
        [] -> panic "pprNameProvenance"
+  where
+    pp_why why = sep [ppr why, ppr_defn_site why name]
 
 -- If we know the exact definition point (which we may do with GHCi)
 -- then show that too.  But not if it's just "imported from X".



_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to