Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/4c5dd2798a2742f597c01ba65d4fcd44c36c4f1d

>---------------------------------------------------------------

commit 4c5dd2798a2742f597c01ba65d4fcd44c36c4f1d
Author: Ian Lynagh <[email protected]>
Date:   Tue Jun 12 13:46:06 2012 +0100

    Redefine pprPanicFastInt in terms of panicDoc

>---------------------------------------------------------------

 compiler/utils/Outputable.lhs |    5 +----
 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 1649bb0..9aff080 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 71233fb..a459199 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



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to