diff options
author | Ian Lynagh <igloo@earth.li> | 2012-06-12 13:46:06 +0100 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2012-06-12 13:46:06 +0100 |
commit | 4c5dd2798a2742f597c01ba65d4fcd44c36c4f1d (patch) | |
tree | 57b54ab72935925e37bc1d23d2d8978047442d55 /compiler/utils | |
parent | 0fdca5de906b243635140819298b35f1210e51ce (diff) | |
download | haskell-4c5dd2798a2742f597c01ba65d4fcd44c36c4f1d.tar.gz |
Redefine pprPanicFastInt in terms of panicDoc
Diffstat (limited to 'compiler/utils')
-rw-r--r-- | compiler/utils/Outputable.lhs | 5 | ||||
-rw-r--r-- | compiler/utils/Panic.lhs | 5 |
2 files changed, 5 insertions, 5 deletions
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs index 1649bb0059..9aff080efb 100644 --- a/compiler/utils/Outputable.lhs +++ b/compiler/utils/Outputable.lhs @@ -931,10 +931,7 @@ pprDefiniteTrace str doc x = pprDebugAndThen trace str doc x pprPanicFastInt :: String -> SDoc -> FastInt -- ^ Specialization of pprPanic that can be safely used with 'FastInt' -pprPanicFastInt heading pretty_msg = - panicFastInt (show (runSDoc doc (initSDocContext PprDebug))) - where - doc = text heading <+> pretty_msg +pprPanicFastInt heading pretty_msg = panicDocFastInt heading pretty_msg warnPprTrace :: Bool -> String -> Int -> SDoc -> a -> a -- ^ Just warn about an assertion failure, recording the given file and line number. diff --git a/compiler/utils/Panic.lhs b/compiler/utils/Panic.lhs index 71233fb0a7..a459199fdb 100644 --- a/compiler/utils/Panic.lhs +++ b/compiler/utils/Panic.lhs @@ -14,7 +14,7 @@ module Panic ( pgmError, panic, sorry, panicFastInt, assertPanic, trace, - panicDoc, sorryDoc, pgmErrorDoc, + panicDoc, sorryDoc, panicDocFastInt, pgmErrorDoc, Exception.Exception(..), showException, safeShowException, try, tryMost, throwTo, @@ -213,6 +213,9 @@ pgmErrorDoc x doc = throwGhcException (PprProgramError x doc) panicFastInt :: String -> FastInt panicFastInt s = case (panic s) of () -> _ILIT(0) +panicDocFastInt :: String -> SDoc -> FastInt +panicDocFastInt s d = case (panicDoc s d) of () -> _ILIT(0) + -- | Throw an failed assertion exception for a given filename and line number. assertPanic :: String -> Int -> a |