X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FOutputable.lhs;h=61ad4ddd22216a6465956639cb539d2f66480260;hb=aa9a4f1053d3c554629a2ec25955e7530c95b892;hp=b5d451ad642320aa94e6100e8733bb029ee925f1;hpb=e949a913adbc1178a799594306954f24957da5ff;p=ghc-hetmet.git diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs index b5d451a..61ad4dd 100644 --- a/compiler/utils/Outputable.lhs +++ b/compiler/utils/Outputable.lhs @@ -53,7 +53,7 @@ module Outputable ( import {-# SOURCE #-} Module( Module, ModuleName, moduleName ) import {-# SOURCE #-} OccName( OccName ) -import StaticFlags ( opt_PprStyle_Debug, opt_PprUserLength ) +import StaticFlags import FastString import FastTypes import qualified Pretty @@ -622,7 +622,9 @@ pprPanic = pprAndThen panic -- Throw an exn saying "bug in GHC" pprPgmError = pprAndThen pgmError -- Throw an exn saying "bug in pgm being compiled" -- (used for unusual pgm errors) -pprTrace = pprAndThen trace +pprTrace str doc x + | opt_NoDebugOutput = x + | otherwise = pprAndThen trace str doc x pprPanicFastInt :: String -> SDoc -> FastInt pprPanicFastInt heading pretty_msg = panicFastInt (show (doc PprDebug)) @@ -644,6 +646,7 @@ assertPprPanic file line msg msg] warnPprTrace :: Bool -> String -> Int -> SDoc -> a -> a +warnPprTrace _ _file _line _msg x | opt_NoDebugOutput = x warnPprTrace False _file _line _msg x = x warnPprTrace True file line msg x = trace (show (doc PprDebug)) x