Skip to content

Save the type of breakpoints in the Breakpoint tick in STG

Luite Stegeman requested to merge luite/ghc:gentickish into master

We need to preserve the type of breakpoints to be able to generate GHCi bytecode from STG instead of core (see !4412 (closed), which adds unboxed sums and tuples support to GHCi).

In !4412 (closed) I first added a Type/Maybe Type field to the StgTick constructor, which has the downside of being imprecise. We really only need to preserve the type for breakpoints, not for other ticks, for the time being.

This is an attempt to make it precise using a ttg scheme:

  1. Generalise Tickish to GenTickish pass with an XBreakpoint extension field in Breakpoint
  2. type Tickish = GenTickish 'TickishCore for the core phase. XBreakpoint is empty, so we can retain the Ord and Eq instances as before
  3. type StgTickish = GenTickish 'TickishStg, XBreakpoint is Type.
  4. CoreToStg now also converts the Tickish values.

I think the id type argument of Tickish (and now GenTickish) can now actually be dropped, and replaced by type functions of TickishPass. I haven't had time to implement this yet.

If this gets accepted, I'll rebase !4412 (closed) on top of this.

Merge request reports