ghc-7.6.3: The GHC API

Safe Haskell | None

CostCentre

Synopsis

- data CostCentre
  - = NormalCC {
    - cc_key :: !Int
    - cc_name :: CcName
    - cc_mod :: Module
    - cc_loc :: SrcSpan
    - cc_is_caf :: IsCafCC
    }
  - | AllCafsCC {
    - cc_mod :: Module
    - cc_loc :: SrcSpan
    }
- type CcName = FastString
- data IsCafCC
  - = NotCafCC
  - | CafCC
- data CostCentreStack
- type CollectedCCs = ([CostCentre], [CostCentre], [CostCentreStack])
- noCCS :: CostCentreStack
- currentCCS :: CostCentreStack
- dontCareCCS :: CostCentreStack
- noCCSAttached :: CostCentreStack -> Bool
- isCurrentCCS :: CostCentreStack -> Bool
- maybeSingletonCCS :: CostCentreStack -> Maybe CostCentre
- mkUserCC :: FastString -> Module -> SrcSpan -> Unique -> CostCentre
- mkAutoCC :: Id -> Module -> IsCafCC -> CostCentre
- mkAllCafsCC :: Module -> SrcSpan -> CostCentre
- mkSingletonCCS :: CostCentre -> CostCentreStack
- isCafCCS :: CostCentreStack -> Bool
- isCafCC :: CostCentre -> Bool
- isSccCountCC :: CostCentre -> Bool
- sccAbleCC :: CostCentre -> Bool
- ccFromThisModule :: CostCentre -> Module -> Bool
- pprCostCentreCore :: CostCentre -> SDoc
- costCentreUserName :: CostCentre -> String
- costCentreUserNameFS :: CostCentre -> FastString
- costCentreSrcSpan :: CostCentre -> SrcSpan
- cmpCostCentre :: CostCentre -> CostCentre -> Ordering

# Documentation

data CostCentre

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

Instances

Eq CostCentre |
Data CostCentre |
Ord CostCentre |
Typeable CostCentre |
Outputable CostCentre |
Binary CostCentre |

type CcName = FastString

data IsCafCC

Constructors

NotCafCC |
CafCC |

Instances

Eq IsCafCC |
Data IsCafCC |
Ord IsCafCC |
Typeable IsCafCC |
Binary IsCafCC |

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

Instances

Eq CostCentreStack |
Ord CostCentreStack |
Outputable CostCentreStack |

type CollectedCCs = ([CostCentre], [CostCentre], [CostCentreStack])

noCCS :: CostCentreStack

currentCCS :: CostCentreStack

dontCareCCS :: CostCentreStack

noCCSAttached :: CostCentreStack -> Bool

isCurrentCCS :: CostCentreStack -> Bool

maybeSingletonCCS :: CostCentreStack -> Maybe CostCentre

mkUserCC :: FastString -> Module -> SrcSpan -> Unique -> CostCentre

mkAutoCC :: Id -> Module -> IsCafCC -> CostCentre

mkAllCafsCC :: Module -> SrcSpan -> CostCentre

mkSingletonCCS :: CostCentre -> CostCentreStack

isCafCCS :: CostCentreStack -> Bool

isCafCC :: CostCentre -> Bool

isSccCountCC :: CostCentre -> Bool

Is this a cost-centre which records scc counts

sccAbleCC :: CostCentre -> Bool

Is this a cost-centre which can be sccd ?

ccFromThisModule :: CostCentre -> Module -> Bool

pprCostCentreCore :: CostCentre -> SDoc

costCentreUserName :: CostCentre -> String

costCentreUserNameFS :: CostCentre -> FastString

costCentreSrcSpan :: CostCentre -> SrcSpan

cmpCostCentre :: CostCentre -> CostCentre -> Ordering