X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FErrUtils.lhs;h=0b61295b8d5492109f3e7321b1abc63d03549e84;hb=4b0a3a1f00071367c3316e5bbdf9c1441bb03136;hp=8b3af12207957cf188c14e93f87f97787406e93e;hpb=f2cd56cf9fc310c9b587ecb5dfaee4ad6b580355;p=ghc-hetmet.git diff --git a/compiler/main/ErrUtils.lhs b/compiler/main/ErrUtils.lhs index 8b3af12..0b61295 100644 --- a/compiler/main/ErrUtils.lhs +++ b/compiler/main/ErrUtils.lhs @@ -27,9 +27,10 @@ module ErrUtils ( debugTraceMsg, ) where +-- XXX This define is a bit of a hack, and should be done more nicely +#define FAST_STRING_NOT_NEEDED 1 #include "HsVersions.h" -import Module ( ModLocation(..)) import Bag ( Bag, bagToList, isEmptyBag, emptyBag ) import SrcLoc ( SrcSpan ) import Util ( sortLe ) @@ -84,7 +85,7 @@ errMsgTc :: TyCon errMsgTc = mkTyCon "ErrMsg" {-# NOINLINE errMsgTc #-} instance Typeable ErrMsg where -#if __GLASGOW_HASKELL__ < 603 +#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ < 603 typeOf _ = mkAppTy errMsgTc [] #else typeOf _ = mkTyConApp errMsgTc [] @@ -138,7 +139,7 @@ printBagOfErrors :: DynFlags -> Bag ErrMsg -> IO () printBagOfErrors dflags bag_of_errors = sequence_ [ let style = mkErrStyle unqual in log_action dflags SevError s style (d $$ e) - | ErrMsg { errMsgSpans = s:ss, + | ErrMsg { errMsgSpans = s:_, errMsgShortDoc = d, errMsgExtraInfo = e, errMsgContext = unqual } <- sorted_errs ] @@ -156,7 +157,7 @@ printBagOfWarnings :: DynFlags -> Bag ErrMsg -> IO () printBagOfWarnings dflags bag_of_warns = sequence_ [ let style = mkErrStyle unqual in log_action dflags SevWarning s style (d $$ e) - | ErrMsg { errMsgSpans = s:ss, + | ErrMsg { errMsgSpans = s:_, errMsgShortDoc = d, errMsgExtraInfo = e, errMsgContext = unqual } <- sorted_errs ] @@ -216,6 +217,7 @@ dumpIfSet_dyn_or dflags flags hdr doc = printDump (mkDumpDoc hdr doc) | otherwise = return () +mkDumpDoc :: String -> SDoc -> SDoc mkDumpDoc hdr doc = vcat [text "", line <+> text hdr <+> line,