summaryrefslogtreecommitdiff
path: root/ghc/compiler
diff options
context:
space:
mode:
authorsimonmar <unknown>1999-12-02 17:57:15 +0000
committersimonmar <unknown>1999-12-02 17:57:15 +0000
commit0e9a9af906266a131ede746ed860a381a6b0eabc (patch)
treea2e6aec9c270c6afd6df522c1dbaa7c579b053b1 /ghc/compiler
parentb79fa717a965a0808bb74f34a14ba86e080193c5 (diff)
downloadhaskell-0e9a9af906266a131ede746ed860a381a6b0eabc.tar.gz
[project @ 1999-12-02 17:57:13 by simonmar]
Change the convention for cost-centre labels to be <name>_cc and cost-centre stacks to be <name>_ccs. This makes cost-centre labels more consistent with our other naming conventions, and fixes some problems caused by cost-centre labels being misinterpreted by the mangler. This fixes one cause of profiled programs crashing; if you're seeing this symptom then this patch may help.
Diffstat (limited to 'ghc/compiler')
-rw-r--r--ghc/compiler/absCSyn/CLabel.lhs4
-rw-r--r--ghc/compiler/profiling/CostCentre.lhs10
2 files changed, 8 insertions, 6 deletions
diff --git a/ghc/compiler/absCSyn/CLabel.lhs b/ghc/compiler/absCSyn/CLabel.lhs
index 644a13d364..3d0ade9842 100644
--- a/ghc/compiler/absCSyn/CLabel.lhs
+++ b/ghc/compiler/absCSyn/CLabel.lhs
@@ -1,7 +1,7 @@
%
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-% $Id: CLabel.lhs,v 1.29 1999/11/02 15:05:40 simonmar Exp $
+% $Id: CLabel.lhs,v 1.30 1999/12/02 17:57:13 simonmar Exp $
%
\section[CLabel]{@CLabel@: Information to make C Labels}
@@ -371,6 +371,8 @@ internal names. <type> is one of the following:
static_info Static Constructor info table
sel_info Selector info table
sel_entry Selector entry code
+ cc Cost centre
+ ccs Cost centre stack
\begin{code}
-- specialised for PprAsm: saves lots of arg passing in NCG
diff --git a/ghc/compiler/profiling/CostCentre.lhs b/ghc/compiler/profiling/CostCentre.lhs
index ac69699f7a..5d0ef9108d 100644
--- a/ghc/compiler/profiling/CostCentre.lhs
+++ b/ghc/compiler/profiling/CostCentre.lhs
@@ -302,7 +302,7 @@ instance Outputable CostCentreStack where
OverheadCCS -> ptext SLIT("CCS_OVERHEAD")
DontCareCCS -> ptext SLIT("CCS_DONTZuCARE")
SubsumedCCS -> ptext SLIT("CCS_SUBSUMED")
- SingletonCCS cc -> ptext SLIT("CCS_") <> ppr cc
+ SingletonCCS cc -> ppr cc <> ptext SLIT("_ccs")
pprCostCentreStackDecl :: CostCentreStack -> SDoc
pprCostCentreStackDecl ccs@(SingletonCCS cc)
@@ -363,11 +363,11 @@ pp_caf other = empty
-- Printing as a C label
-ppCostCentreLbl (NoCostCentre) = text "CC_NONE"
-ppCostCentreLbl (AllCafsCC {cc_mod = m}) = text "CC_CAFs_" <> pprModuleName m
+ppCostCentreLbl (NoCostCentre) = text "NONE_cc"
+ppCostCentreLbl (AllCafsCC {cc_mod = m}) = pprModuleName m <> text "_CAFs_cc"
ppCostCentreLbl (NormalCC {cc_name = n, cc_mod = m, cc_is_caf = is_caf})
- = text "CC_" <> text (case is_caf of { CafCC -> "CAF_"; _ -> "" })
- <> pprModuleName m <> ptext n
+ = pprModuleName m <> ptext n <>
+ text (case is_caf of { CafCC -> "_CAF"; _ -> "" }) <> text "_cc"
-- This is the name to go in the user-displayed string,
-- recorded in the cost centre declaration