HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.StgToCmm.ExtCode

Our extended FCode monad.

  • 3 types
  • 26 values
  • Packageghc-9.10.3
  • Exports29
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceExtCode.hs
newtypenewtype CmmParse a
#

Does a computation in the FCode monad, with a current environment and a list of local declarations. Returns the resulting list of declarations.

Instances4Monad, Functor, Applicative, MonadUnique
datadata Named
#

The environment contains variable definitions or blockids.

Constructors

  • VarN CmmExpr

    Holds CmmLit(CmmLabel ..) which gives the label type, eg, RtsLabel, ForeignLabel, CmmLabel etc.

  • FunN UnitId

    A function name from this unit

  • LabelN BlockId

    A blockid of some code or data.

valueloopDecls :: CmmParse a -> CmmParse a
#

Takes the variable declarations and imports from the monad and makes an environment, which is looped back into the computation. In this way, we can have embedded declarations that scope over the whole procedure, and imports that scope over the entire module. Discards the local declaration contained within decl'

valuenewImport :: (FastString, CLabel) -> CmmParse ()
#

Add an imported foreign label to the list of local declarations. If this is done at the start of the module the declaration will scope over the whole module.

Lookup the BlockId bound to the label with this name. If one hasn't been bound yet, create a fresh one based on the Unique of the name.

Lookup the location of a named variable. Unknown names are treated as if they had been imported from the runtime system. This saves us a lot of bother in the RTS sources, at the expense of deferring some errors to link time.