From f54f42974c3d209656c31012c96243119a83103f Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 20 Apr 2000 15:34:17 +0000 Subject: [PATCH] [project @ 2000-04-20 15:34:17 by simonmar] Print out cost centre names as C strings (using proper escaping for special characters etc.). --- ghc/compiler/profiling/CostCentre.lhs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ghc/compiler/profiling/CostCentre.lhs b/ghc/compiler/profiling/CostCentre.lhs index 02d732b..15cd2af 100644 --- a/ghc/compiler/profiling/CostCentre.lhs +++ b/ghc/compiler/profiling/CostCentre.lhs @@ -35,6 +35,7 @@ import Module ( Module, ModuleName, moduleName, pprModuleName, moduleNameUserString ) import Outputable +import CStrings ( pprStringInCStyle ) import Util ( thenCmp ) \end{code} @@ -358,7 +359,7 @@ 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 (NoCostCentre) = "NO_CC" -costCentreUserName (AllCafsCC {}) = "CAFs_in_..." +costCentreUserName (AllCafsCC {}) = "CAF" costCentreUserName cc@(NormalCC {cc_name = name, cc_is_caf = is_caf}) = case is_caf of { CafCC -> "CAF:"; _ -> "" } ++ decode (_UNPK_ name) \end{code} @@ -375,8 +376,8 @@ pprCostCentreDecl is_local cc hcat [ ptext SLIT("CC_DECLARE"),char '(', cc_ident, comma, - doubleQuotes (text (costCentreUserName cc)), comma, - doubleQuotes (text (moduleNameUserString mod_name)), comma, + pprStringInCStyle (costCentreUserName cc), comma, + pprStringInCStyle (moduleNameUserString mod_name), comma, ptext is_subsumed, comma, empty, -- Now always externally visible text ");"] -- 1.7.10.4