[project @ 1996-05-17 16:02:43 by partain]
[ghc-hetmet.git] / ghc / compiler / profiling / CostCentre.lhs
index f9d5a61..2740a5b 100644 (file)
@@ -27,16 +27,18 @@ module CostCentre (
        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}
@@ -226,7 +228,7 @@ setToAbleCostCentre :: CostCentre -> Bool
   -- 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"
@@ -269,10 +271,7 @@ cmpCostCentre DontCareCC             DontCareCC          = EQ_
 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
@@ -400,8 +399,8 @@ uppCostCentre sty print_as_string cc
        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 _       = ""