X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FOutputable.lhs;h=8380c76fdec4f2085ca5e7722375d9e7c4343a58;hb=df62fe193785e1fc9786a6c7321670f99fa9a37d;hp=839eda1493ed11ca52189c8225959a05b1d36141;hpb=f9ad735f0b8a3262b273b8d126a65b4caf4d64f5;p=ghc-hetmet.git diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs index 839eda1..8380c76 100644 --- a/compiler/utils/Outputable.lhs +++ b/compiler/utils/Outputable.lhs @@ -45,9 +45,9 @@ module Outputable ( pprHsChar, pprHsString, -- error handling - pprPanic, assertPprPanic, pprPanic#, pprPgmError, + pprPanic, assertPprPanic, pprPanicFastInt, pprPgmError, pprTrace, warnPprTrace, - trace, pgmError, panic, panic#, assertPanic + trace, pgmError, panic, panicFastInt, assertPanic ) where #include "HsVersions.h" @@ -59,7 +59,6 @@ import {-# SOURCE #-} OccName( OccName ) import StaticFlags ( opt_PprStyle_Debug, opt_PprUserLength ) import FastString import FastTypes -import GHC.Ptr import qualified Pretty import Pretty ( Doc, Mode(..) ) import Panic @@ -336,7 +335,7 @@ empty :: SDoc text :: String -> SDoc char :: Char -> SDoc ftext :: FastString -> SDoc -ptext :: Ptr t -> SDoc +ptext :: LitString -> SDoc int :: Int -> SDoc integer :: Integer -> SDoc float :: Float -> SDoc @@ -446,6 +445,9 @@ instance Outputable Bool where instance Outputable Int where ppr n = int n +instance Outputable Word32 where + ppr n = integer $ fromIntegral n + instance Outputable () where ppr _ = text "()" @@ -625,8 +627,8 @@ pprPgmError = pprAndThen pgmError -- Throw an exn saying "bug in pgm being compi -- (used for unusual pgm errors) pprTrace = pprAndThen trace -pprPanic# :: String -> SDoc -> FastInt -pprPanic# heading pretty_msg = panic# (show (doc PprDebug)) +pprPanicFastInt :: String -> SDoc -> FastInt +pprPanicFastInt heading pretty_msg = panicFastInt (show (doc PprDebug)) where doc = text heading <+> pretty_msg