ghc-7.4.1: The GHC API

Safe HaskellSafe-Infered

CostCentre

Synopsis

Documentation

data CostCentre Source

A Cost Centre is a single {--} annotation.

Constructors

NormalCC 

Fields

cc_key :: !Int

Two cost centres may have the same name and module but different SrcSpans, so we need a way to distinguish them easily and give them different object-code labels. So every CostCentre has a Unique that is distinct from every other CostCentre in the same module.

XXX: should really be using Unique here, but we need to derive Data below and there's no Data instance for Unique.

cc_name :: CcName

Name of the cost centre itself

cc_mod :: Module

Name of module defining this CC.

cc_loc :: SrcSpan
 
cc_is_caf :: IsCafCC
 
AllCafsCC 

Fields

cc_mod :: Module

Name of module defining this CC.

cc_loc :: SrcSpan
 

data CostCentreStack Source

A Cost Centre Stack is something that can be attached to a closure. This is either:

  • the current cost centre stack (CCCS) * a pre-defined cost centre stack (there are several pre-defined CCSs, see below).

isSccCountCC :: CostCentre -> BoolSource

Is this a cost-centre which records scc counts

sccAbleCC :: CostCentre -> BoolSource

Is this a cost-centre which can be sccd ?