ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.HsToCore.Ticks

Synopsis

- data TicksConfig = TicksConfig {
  - ticks_passes :: ![TickishType]
  - ticks_profAuto :: !ProfAuto
  - ticks_countEntries :: !Bool
  }
- data Tick = Tick {
  - tick_loc :: SrcSpan
  - tick_path :: [String]
  - tick_ids :: [OccName]
  - tick_label :: BoxLabel
  }
- data TickishType
  - = ProfNotes
  - | HpcTicks
  - | Breakpoints
  - | SourceNotes
- addTicksToBinds :: Logger -> TicksConfig -> Module -> ModLocation -> NameSet -> [TyCon] -> LHsBinds GhcTc -> IO (LHsBinds GhcTc, Maybe (FilePath, SizedSeq Tick))
- isGoodSrcSpan' :: SrcSpan -> Bool
- stripTicksTopHsExpr :: HsExpr GhcTc -> ([CoreTickish], HsExpr GhcTc)

# Documentation

data TicksConfig #

Configuration for compilation pass to add tick for instrumentation to binding sites.

Constructors

TicksConfig |

Fields

- ticks_passes :: ![TickishType]

  What purposes do we need ticks for

- ticks_profAuto :: !ProfAuto

  What kind of {-# SCC #-} to add automatically

- ticks_countEntries :: !Bool

  Whether to count the entries to functions

  Requires extra synchronization which can vastly degrade performance.

data Tick #

Constructors

Tick |

Fields

- tick_loc :: SrcSpan

  Tick source span

- tick_path :: [String]

  Path to the declaration

- tick_ids :: [OccName]

  Identifiers being bound

- tick_label :: BoxLabel

  Label for the tick counter

data TickishType #

Reasons why we need ticks,

Constructors

ProfNotes | For profiling
HpcTicks | For Haskell Program Coverage
Breakpoints | For ByteCode interpreter break points
SourceNotes | For source notes

#### Instances

Instances details

Eq TickishType # |
Instance details Defined in GHC.HsToCore.Ticks Methods (==) :: TickishType -> TickishType -> Bool # (/=) :: TickishType -> TickishType -> Bool #

addTicksToBinds #

Arguments

:: Logger |
-> TicksConfig |
-> Module |
-> ModLocation | location of the current module
-> NameSet | Exported Ids. When we call addTicksToBinds, isExportedId doesn't work yet (the desugarer hasn't set it), so we have to work from this set.
-> [TyCon] | Type constructors in this module
-> LHsBinds GhcTc |
-> IO (LHsBinds GhcTc, Maybe (FilePath, SizedSeq Tick)) |

isGoodSrcSpan' :: SrcSpan -> Bool #

stripTicksTopHsExpr :: HsExpr GhcTc -> ([CoreTickish], HsExpr GhcTc) #

Strip CoreTicks from an HsExpr