cmpCostCentre -- used for removing dups in a list
) where
+import Ubiq{-uitous-}
+
import Id ( externallyVisibleId, GenId, Id(..) )
import CStrings ( identToC, stringToC )
import Maybes ( Maybe(..) )
-import Outputable
+import Name ( showRdr, getOccName, RdrName )
import Pretty ( ppShow, prettyToUn )
import PprStyle ( PprStyle(..) )
import UniqSet
import Unpretty
import Util
-import Ubiq
+
showId = panic "Whoops"
pprIdInUnfolding = panic "Whoops"
\end{code}
-- be set? setToAbleCostCentre is allowed to panic on
-- "nonsense" cases, too...
-#if DEBUG
+#ifdef DEBUG
setToAbleCostCentre NoCostCentre = panic "setToAbleCC:NoCostCentre"
setToAbleCostCentre SubsumedCosts = panic "setToAbleCC:SubsumedCosts"
setToAbleCostCentre CurrentCC = panic "setToAbleCC:CurrentCC"
cmpCostCentre (NormalCC k1 m1 _ _ c1) (NormalCC k2 m2 _ _ c2)
-- first key is module name, then we use "kinds" (which include
-- names)
- = case (_CMP_STRING_ m1 m2) of
- LT_ -> LT_
- EQ_ -> cmp_kind k1 k2
- GT__ -> GT_
+ = _CMP_STRING_ m1 m2 `thenCmp` cmp_kind k1 k2
cmpCostCentre other_1 other_2
= let
do_id :: Id -> String
do_id id
= if print_as_string
- then _UNPK_ (getOccurrenceName id) -- don't want module in the name
- else showId sty id -- we really do
+ then showRdr sty (getOccName id) -- use occ name
+ else showId sty id -- we really do
do_calved IsCafCC = "/CAF"
do_calved _ = ""