ghc-9.12: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Iface.Tidy

Description

Tidying up Core

This module's purpose is to prepare the Core program for two distinct purposes: * To be serialised into the module's interface file * To feed to the code generator

The most important tasks are: * Determine which Names should ultimately be Internal and External (which may differ to whether they were originally Internal or External). See `Note [About the NameSorts]` in GHC.Types.Name. For example, in: module M where f x = x + y where y = factorial 4 could be optimized during the Core pass to: module M where y = factorial 4 f x = x + y in which case y would be changed from Internal to External.

  • Rename local identifiers to avoid name clashes, so that unfoldings etc can be serialialised using the OccName, without Uniques.

For example (x_5 means x with a Unique of `5`): f x_12 x_23 = x_12 would be changed to: f x_12 x1_23 = x_12

Documentation

data TidyOpts Source #

Constructors

TidyOpts 

Fields

data UnfoldingExposure Source #

Constructors

ExposeNone

Don't expose unfoldings

ExposeSome

Expose mandatory unfoldings and those meeting inlining thresholds.

ExposeOverloaded

Expose unfoldings useful for inlinings and those which which might be specialised. See Note [Exposing overloaded functions]

ExposeAll

Expose all unfoldings