Safe Haskell | None |
---|---|
Language | GHC2021 |
Synopsis
- doLateCostCenters :: LateCCEnv -> LateCCState s -> (CoreBind -> LateCCM s CoreBind) -> CoreProgram -> (CoreProgram, LateCCState s)
- getCCFlavour :: FastString -> LateCCM s CCFlavour
- insertCC :: FastString -> SrcSpan -> CoreExpr -> LateCCM s CoreExpr
Inserting cost centres
:: LateCCEnv | Environment to run the insertion in |
-> LateCCState s | Initial state to run the insertion with |
-> (CoreBind -> LateCCM s CoreBind) | Insertion method |
-> CoreProgram | Bindings to consider |
-> (CoreProgram, LateCCState s) |
Insert cost centres into the CoreProgram
using the provided environment,
initial state, and insertion method.
Helpers for defining insertion methods
getCCFlavour :: FastString -> LateCCM s CCFlavour Source #
Given the name of a cost centre, get its flavour
:: FastString | Name of the cost centre to insert |
-> SrcSpan | Source location to associate with the cost centre |
-> CoreExpr | Expression to wrap in the cost centre |
-> LateCCM s CoreExpr |
Insert a cost centre with the specified name and source span on the given expression. The inserted cost centre will be appropriately tracked in the late cost centre state.