summaryrefslogtreecommitdiff
path: root/compiler/profiling
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-08-21 10:44:54 +0200
committerBen Gamari <ben@smart-cactus.org>2015-08-21 15:44:21 +0200
commit2f29ebbb6f8c914f2bba624f3edcc259274df8af (patch)
treec523018ed23dd32e45697fe177d6df5ad4b59b50 /compiler/profiling
parent3452473b4bb180ba327520067b8c6f2a8d6c4f4b (diff)
downloadhaskell-2f29ebbb6f8c914f2bba624f3edcc259274df8af.tar.gz
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
Diffstat (limited to 'compiler/profiling')
-rw-r--r--compiler/profiling/CostCentre.hs14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/profiling/CostCentre.hs b/compiler/profiling/CostCentre.hs
index cce8394565..f3bbd50e26 100644
--- a/compiler/profiling/CostCentre.hs
+++ b/compiler/profiling/CostCentre.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE BangPatterns, DeriveDataTypeable #-}
+{-# LANGUAGE DeriveDataTypeable #-}
module CostCentre (
CostCentre(..), CcName, IsCafCC(..),
-- All abstract except to friend: ParseIface.y
@@ -26,7 +26,6 @@ import Name
import Module
import Unique
import Outputable
-import FastTypes
import SrcLoc
import FastString
import Util
@@ -87,13 +86,14 @@ cmpCostCentre NormalCC {cc_key = n1, cc_mod = m1}
cmpCostCentre other_1 other_2
= let
- !tag1 = tag_CC other_1
- !tag2 = tag_CC other_2
+ tag1 = tag_CC other_1
+ tag2 = tag_CC other_2
in
- if tag1 <# tag2 then LT else GT
+ if tag1 < tag2 then LT else GT
where
- tag_CC (NormalCC {}) = _ILIT(0)
- tag_CC (AllCafsCC {}) = _ILIT(1)
+ tag_CC :: CostCentre -> Int
+ tag_CC (NormalCC {}) = 0
+ tag_CC (AllCafsCC {}) = 1
-----------------------------------------------------------------------------