diff options
| author | Ian Lynagh <ian@well-typed.com> | 2012-10-08 21:55:23 +0100 |
|---|---|---|
| committer | Ian Lynagh <ian@well-typed.com> | 2012-10-08 21:55:23 +0100 |
| commit | f7cd14fd30d40ae7e904a533804f43d43dd8f439 (patch) | |
| tree | 18ba603b155348ce2761c06003c280666cbd09a4 /compiler/utils | |
| parent | a94144b81415a542defd5e7e4e7e3561d9d28a0f (diff) | |
| download | haskell-f7cd14fd30d40ae7e904a533804f43d43dd8f439.tar.gz | |
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.
Diffstat (limited to 'compiler/utils')
| -rw-r--r-- | compiler/utils/Outputable.lhs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs index 09cf6e84ec..7e5c180d1b 100644 --- a/compiler/utils/Outputable.lhs +++ b/compiler/utils/Outputable.lhs @@ -70,7 +70,7 @@ module Outputable ( pprDebugAndThen, ) where -import {-# SOURCE #-} DynFlags( DynFlags, tracingDynFlags, +import {-# SOURCE #-} DynFlags( DynFlags, targetPlatform, pprUserLength, pprCols ) import {-# SOURCE #-} Module( Module, ModuleName, moduleName ) import {-# SOURCE #-} Name( Name, nameModule ) @@ -914,7 +914,7 @@ pprTrace :: String -> SDoc -> a -> a -- ^ If debug output is on, show some 'SDoc' on the screen pprTrace str doc x | opt_NoDebugOutput = x - | otherwise = pprDebugAndThen tracingDynFlags trace str doc x + | otherwise = pprDebugAndThen unsafeGlobalDynFlags trace str doc x pprPanicFastInt :: String -> SDoc -> FastInt -- ^ Specialization of pprPanic that can be safely used with 'FastInt' @@ -927,9 +927,9 @@ warnPprTrace _ _ _ _ x | not debugIsOn = x warnPprTrace _ _file _line _msg x | opt_NoDebugOutput = x warnPprTrace False _file _line _msg x = x warnPprTrace True file line msg x - = pprDebugAndThen tracingDynFlags trace str msg x + = pprDebugAndThen unsafeGlobalDynFlags trace str msg x where - str = showSDoc tracingDynFlags (hsep [text "WARNING: file", text file <> comma, text "line", int line]) + str = showSDoc unsafeGlobalDynFlags (hsep [text "WARNING: file", text file <> comma, text "line", int line]) assertPprPanic :: String -> Int -> SDoc -> a -- ^ Panic with an assertation failure, recording the given file and line number. |
