summaryrefslogtreecommitdiff
path: root/compiler/profiling/CostCentre.lhs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/profiling/CostCentre.lhs')
-rw-r--r--compiler/profiling/CostCentre.lhs16
1 files changed, 10 insertions, 6 deletions
diff --git a/compiler/profiling/CostCentre.lhs b/compiler/profiling/CostCentre.lhs
index 9545b2eb89..2a44121dfd 100644
--- a/compiler/profiling/CostCentre.lhs
+++ b/compiler/profiling/CostCentre.lhs
@@ -24,7 +24,7 @@ module CostCentre (
isCafCCS, isCafCC, isSccCountCC, sccAbleCC, ccFromThisModule,
pprCostCentreCore,
- costCentreUserName,
+ costCentreUserName, costCentreUserNameFS,
cmpCostCentre -- used for removing dups in a list
) where
@@ -280,9 +280,13 @@ ppCostCentreLbl (NormalCC {cc_name = n, cc_mod = m, cc_is_caf = is_caf})
-- This is the name to go in the user-displayed string,
-- recorded in the cost centre declaration
costCentreUserName :: CostCentre -> String
-costCentreUserName (NoCostCentre) = "NO_CC"
-costCentreUserName (AllCafsCC {}) = "CAF"
-costCentreUserName (NormalCC {cc_name = name, cc_is_caf = is_caf})
- = case is_caf of { CafCC -> "CAF:"; _ -> "" } ++ unpackFS name
-
+costCentreUserName = unpackFS . costCentreUserNameFS
+
+costCentreUserNameFS :: CostCentre -> FastString
+costCentreUserNameFS (NoCostCentre) = mkFastString "NO_CC"
+costCentreUserNameFS (AllCafsCC {}) = mkFastString "CAF"
+costCentreUserNameFS (NormalCC {cc_name = name, cc_is_caf = is_caf})
+ = case is_caf of
+ CafCC -> mkFastString "CAF:" `appendFS` name
+ _ -> name
\end{code}