ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

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 Source #

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 Source #

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 Source #

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 Source # |
Instance details Defined in GHC.HsToCore.Ticks Methods (==) :: TickishType -> TickishType -> Bool # (/=) :: TickishType -> TickishType -> Bool #

addTicksToBinds Source #

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 Source #

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

Strip CoreTicks from an HsExpr