HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.Types.CostCentre

  • 5 types
  • 28 values
  • Packageghc-9.10.3
  • Exports33
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceCostCentre.hs
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
Instances5Eq, Data, Ord, 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.

Instances4Eq, Data, Ord, Binary
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