diff options
author | Thomas Miedema <thomasmiedema@gmail.com> | 2015-08-18 18:38:28 +0200 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-08-18 18:42:12 +0200 |
commit | 3849dac59209cc2608636ae120eac54237d882c5 (patch) | |
tree | df6a9cb2fc80dcfde31785188641b4b193016d16 /compiler/utils/Panic.hs | |
parent | e43350573b7a6f233bc7ef2a8badaeb15fb46f34 (diff) | |
download | haskell-wip/d1141.tar.gz |
Refactor: delete most of the module FastTypeswip/d1141
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
Diffstat (limited to 'compiler/utils/Panic.hs')
-rw-r--r-- | compiler/utils/Panic.hs | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/compiler/utils/Panic.hs b/compiler/utils/Panic.hs index bfb9df3ad3..e1c848d540 100644 --- a/compiler/utils/Panic.hs +++ b/compiler/utils/Panic.hs @@ -17,8 +17,8 @@ module Panic ( progName, pgmError, - panic, sorry, panicFastInt, assertPanic, trace, - panicDoc, sorryDoc, panicDocFastInt, pgmErrorDoc, + panic, sorry, assertPanic, trace, + panicDoc, sorryDoc, pgmErrorDoc, Exception.Exception(..), showException, safeShowException, try, tryMost, throwTo, @@ -30,7 +30,6 @@ module Panic ( import {-# SOURCE #-} Outputable (SDoc) import Config -import FastTypes import Exception import Control.Concurrent @@ -198,16 +197,6 @@ sorryDoc x doc = throwGhcException (PprSorry x doc) pgmErrorDoc x doc = throwGhcException (PprProgramError x doc) --- | Panic while pretending to return an unboxed int. --- You can't use the regular panic functions in expressions --- producing unboxed ints because they have the wrong kind. -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 assertPanic file line = |