On 08/10/2012 22:04, Ian Lynagh wrote:
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/f7cd14fd30d40ae7e904a533804f43d43dd8f439
---------------------------------------------------------------
commit f7cd14fd30d40ae7e904a533804f43d43dd8f439
Author: Ian Lynagh <i...@well-typed.com>
Date: Mon Oct 8 21:55:23 2012 +0100
Put the DynFlags in a global variable for tracing; fixes #7304
This is an ugly kludge to make a DynFlags value available for the
'trace' functions. It may not be the value we really ought to use,
but it'll be good enough for the pretty-printer to use.
Ideally we'd pass the real DynFlags down to all the trace calls,
but this will do for now at least.
So this looks like a hack, but it's no worse than pprTrace itself. I
have no problems with it, because it means I can just use pprTrace
wherever I like without having to plumb DynFlags to it.
I'd argue strongly against having to pass DynFlags to trace. The whole
point of pprTrace is that you can just throw new ones in for debugging -
there are a few static to pprTrace in the code, but those aren't the
ones we care about, it's the ability to quickly add new/temporary ones
for debugging that matters.
Cheers,
Simon
compiler/main/DynFlags.hs | 30 +++++++-----------------------
compiler/main/DynFlags.hs-boot | 2 --
compiler/main/GHC.hs | 2 +-
compiler/main/StaticFlags.hs | 21 +++++++++++++++++++++
compiler/utils/Outputable.lhs | 8 ++++----
5 files changed, 33 insertions(+), 30 deletions(-)
Diff suppressed because of size. To see it, use:
git show f7cd14fd30d40ae7e904a533804f43d43dd8f439
_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc
_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc