summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2011-09-02 09:11:50 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2011-09-02 09:11:50 +0100
commite9f5a88a0b05991a0fe691027863ac8e3461e08a (patch)
tree160c762dc4dd9254dff01792f6c1d4c7631e7633 /compiler
parent68bcb1399c8cd17f6db641a68fd4d20fff08c01a (diff)
downloadhaskell-e9f5a88a0b05991a0fe691027863ac8e3461e08a.tar.gz
More debug info on provenance with -dppr-debug
Diffstat (limited to 'compiler')
-rw-r--r--compiler/basicTypes/RdrName.lhs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/basicTypes/RdrName.lhs b/compiler/basicTypes/RdrName.lhs
index 5a8ef67a20..7f7d04802e 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".