From 2f29ebbb6f8c914f2bba624f3edcc259274df8af Mon Sep 17 00:00:00 2001 From: Thomas Miedema Date: Fri, 21 Aug 2015 10:44:54 +0200 Subject: Refactor: delete most of the module FastTypes This reverses some of the work done in #1405, and goes back to the assumption that the bootstrap compiler understands GHC-haskell. In particular: * use MagicHash instead of _ILIT and _CLIT * pattern matching on I# if possible, instead of using iUnbox unnecessarily * use Int#/Char#/Addr# instead of the following type synonyms: - type FastInt = Int# - type FastChar = Char# - type FastPtr a = Addr# * inline the following functions: - iBox = I# - cBox = C# - fastChr = chr# - fastOrd = ord# - eqFastChar = eqChar# - shiftLFastInt = uncheckedIShiftL# - shiftR_FastInt = uncheckedIShiftRL# - shiftRLFastInt = uncheckedIShiftRL# * delete the following unused functions: - minFastInt - maxFastInt - uncheckedIShiftRA# - castFastPtr - panicDocFastInt and pprPanicFastInt * rename panicFastInt back to panic# These functions remain, since they actually do something: * iUnbox * bitAndFastInt * bitOrFastInt Test Plan: validate Reviewers: austin, bgamari Subscribers: rwbarton Differential Revision: https://phabricator.haskell.org/D1141 GHC Trac Issues: #1405 --- compiler/utils/Outputable.hs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'compiler/utils/Outputable.hs') diff --git a/compiler/utils/Outputable.hs b/compiler/utils/Outputable.hs index 948ae7d5df..93645d38fe 100644 --- a/compiler/utils/Outputable.hs +++ b/compiler/utils/Outputable.hs @@ -72,9 +72,9 @@ module Outputable ( mkUserStyle, cmdlineParserStyle, Depth(..), -- * Error handling and debugging utilities - pprPanic, pprSorry, assertPprPanic, pprPanicFastInt, pprPgmError, + pprPanic, pprSorry, assertPprPanic, pprPgmError, pprTrace, warnPprTrace, - trace, pgmError, panic, sorry, panicFastInt, assertPanic, + trace, pgmError, panic, sorry, assertPanic, pprDebugAndThen, ) where @@ -87,7 +87,6 @@ import {-# SOURCE #-} OccName( OccName ) import {-# SOURCE #-} StaticFlags( opt_PprStyle_Debug, opt_NoDebugOutput ) import FastString -import FastTypes import qualified Pretty import Util import Platform @@ -1032,10 +1031,6 @@ pprTrace str doc x | opt_NoDebugOutput = x | otherwise = pprDebugAndThen unsafeGlobalDynFlags trace (text str) doc x -pprPanicFastInt :: String -> SDoc -> FastInt --- ^ Specialization of pprPanic that can be safely used with 'FastInt' -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. -- Should typically be accessed with the WARN macros -- cgit v1.2.1