ghc-9.6.3: The GHC API

Safe Haskell | Safe-Inferred
Language | Haskell2010

GHC.Stg.Pipeline

Synopsis

- data StgPipelineOpts = StgPipelineOpts {
  - stgPipeline_phases :: ![StgToDo]
  - stgPipeline_lint :: !(Maybe DiagOpts)
  - stgPipeline_pprOpts :: !StgPprOpts
  - stgPlatform :: !Platform
  - stgPipeline_forBytecode :: !Bool
  }
- data StgToDo
  - = StgCSE
  - | StgLiftLams StgLiftConfig
  - | StgStats
  - | StgUnarise
  - | StgBcPrep
  - | StgDoNothing
- stg2stg :: Logger -> [Var] -> StgPipelineOpts -> Module -> [StgTopBinding] -> IO ([CgStgTopBinding], StgCgInfos)
- type StgCgInfos = NameEnv TagSig

# Documentation

data StgPipelineOpts Source #

Constructors

StgPipelineOpts |

Fields

- stgPipeline_phases :: ![StgToDo]

  Spec of what stg-to-stg passes to do

- stgPipeline_lint :: !(Maybe DiagOpts)

  Should we lint the STG at various stages of the pipeline?

- stgPipeline_pprOpts :: !StgPprOpts
- stgPlatform :: !Platform
- stgPipeline_forBytecode :: !Bool

data StgToDo Source #

Optional Stg-to-Stg passes.

Constructors

StgCSE | Common subexpression elimination
StgLiftLams StgLiftConfig | Lambda lifting closure variables, trading stack/register allocation for heap allocation
StgStats |
StgUnarise | Mandatory unarise pass, desugaring unboxed tuple and sum binders
StgBcPrep | Mandatory when compiling to bytecode
StgDoNothing | Useful for building up `getStgToDo`

#### Instances

Instances details

Read StgToDo Source # |
Instance details Defined in GHC.Stg.Pipeline Methods readsPrec :: Int -> ReadS StgToDo Source # readList :: ReadS [StgToDo] Source # readPrec :: ReadPrec StgToDo Source # readListPrec :: ReadPrec [StgToDo] Source #
Show StgToDo Source # |
Instance details Defined in GHC.Stg.Pipeline Methods showsPrec :: Int -> StgToDo -> ShowS Source # show :: StgToDo -> String Source # showList :: [StgToDo] -> ShowS Source #
Eq StgToDo Source # |
Instance details Defined in GHC.Stg.Pipeline Methods (==) :: StgToDo -> StgToDo -> Bool # (/=) :: StgToDo -> StgToDo -> Bool #
Ord StgToDo Source # |
Instance details Defined in GHC.Stg.Pipeline Methods compare :: StgToDo -> StgToDo -> Ordering # (<) :: StgToDo -> StgToDo -> Bool # (<=) :: StgToDo -> StgToDo -> Bool # (>) :: StgToDo -> StgToDo -> Bool # (>=) :: StgToDo -> StgToDo -> Bool # max :: StgToDo -> StgToDo -> StgToDo # min :: StgToDo -> StgToDo -> StgToDo #

stg2stg Source #

Arguments

:: Logger |
-> [Var] | extra vars in scope from GHCi
-> StgPipelineOpts |
-> Module | module being compiled
-> [StgTopBinding] | input program
-> IO ([CgStgTopBinding], StgCgInfos) |

type StgCgInfos = NameEnv TagSig Source #

Information to be exposed in interface files which is produced by the stg2stg passes.