HORIZON HASKELLDocslts/ghc-10.0.xaa25b892026-10-10Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · aa25b89 · 2026-10-10

Moduleghc-10.0.0.20260917GHC2024

GHC.Types.CostCentre

  • 5 types
  • 29 values
datadata CostCentre
#

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

Constructors

  • NormalCC
    • cc_flavour :: CCFlavour

      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 an associated flavour that indicates how it was generated, and flavours that allow multiple instances of the same name and module have a deterministic 0-based index.

    • cc_name :: CcName

      Name of the cost centre itself

    • cc_mod :: Module

      Name of module defining this CC.

    • cc_loc :: SrcSpan
  • AllCafsCC
Instances6Eq, Data, Ord, NFData, Outputable, Binary
datadata CCFlavour
#

The flavour of a cost centre.

Index fields represent 0-based indices giving source-code ordering of centres with the same module, name, and flavour.

Instances5Eq, Data, Ord, NFData, Binary
  • Eq CCFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentre
  • Data CCFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentre
  • Ord CCFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentre
  • NFData CCFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentre
  • Binary CCFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentre
datadata CostCentreStack
#

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).

Instances3Eq, Ord, Outputable