StgSyn

ghc-8.6.3: The GHC API

Safe Haskell | None
Language | Haskell2010

StgSyn

Synopsis

- data GenStgArg occ
  - = StgVarArg occ
  - | StgLitArg Literal
- data GenStgTopBinding bndr occ
  - = StgTopLifted (GenStgBinding bndr occ)
  - | StgTopStringLit bndr ByteString
- data GenStgBinding bndr occ
  - = StgNonRec bndr (GenStgRhs bndr occ)
  - | StgRec [(bndr, GenStgRhs bndr occ)]
- data GenStgExpr bndr occ
  - = StgApp occ [GenStgArg occ]
  - | StgLit Literal
  - | StgConApp DataCon [GenStgArg occ] [Type]
  - | StgOpApp StgOp [GenStgArg occ] Type
  - | StgLam (NonEmpty bndr) StgExpr
  - | StgCase (GenStgExpr bndr occ) bndr AltType [GenStgAlt bndr occ]
  - | StgLet (GenStgBinding bndr occ) (GenStgExpr bndr occ)
  - | StgLetNoEscape (GenStgBinding bndr occ) (GenStgExpr bndr occ)
  - | StgTick (Tickish bndr) (GenStgExpr bndr occ)
- data GenStgRhs bndr occ
  - = StgRhsClosure CostCentreStack StgBinderInfo [occ] !UpdateFlag [bndr] (GenStgExpr bndr occ)
  - | StgRhsCon CostCentreStack DataCon [GenStgArg occ]
- type GenStgAlt bndr occ = (AltCon, [bndr], GenStgExpr bndr occ)
- data AltType
  - = PolyAlt
  - | MultiValAlt Int
  - | AlgAlt TyCon
  - | PrimAlt PrimRep
- data UpdateFlag
  - = ReEntrant
  - | Updatable
  - | SingleEntry
- isUpdatable :: UpdateFlag -> Bool
- data StgBinderInfo
- noBinderInfo :: StgBinderInfo
- stgSatOcc :: StgBinderInfo
- stgUnsatOcc :: StgBinderInfo
- satCallsOnly :: StgBinderInfo -> Bool
- combineStgBinderInfo :: StgBinderInfo -> StgBinderInfo -> StgBinderInfo
- type StgArg = GenStgArg Id
- type StgTopBinding = GenStgTopBinding Id Id
- type StgBinding = GenStgBinding Id Id
- type StgExpr = GenStgExpr Id Id
- type StgRhs = GenStgRhs Id Id
- type StgAlt = GenStgAlt Id Id
- type InStgArg = StgArg
- type InStgTopBinding = StgTopBinding
- type InStgBinding = StgBinding
- type InStgExpr = StgExpr
- type InStgRhs = StgRhs
- type InStgAlt = StgAlt
- type OutStgArg = StgArg
- type OutStgTopBinding = StgTopBinding
- type OutStgBinding = StgBinding
- type OutStgExpr = StgExpr
- type OutStgRhs = StgRhs
- type OutStgAlt = StgAlt
- data StgOp
  - = StgPrimOp PrimOp
  - | StgPrimCallOp PrimCall
  - | StgFCallOp ForeignCall Unique
- topStgBindHasCafRefs :: GenStgTopBinding bndr Id -> Bool
- stgArgHasCafRefs :: GenStgArg Id -> Bool
- stgRhsArity :: StgRhs -> Int
- isDllConApp :: DynFlags -> Module -> DataCon -> [StgArg] -> Bool
- stgArgType :: StgArg -> Type
- stripStgTicksTop :: (Tickish Id -> Bool) -> StgExpr -> ([Tickish Id], StgExpr)
- stgCaseBndrInScope :: AltType -> Bool -> Bool
- pprStgBinding :: StgBinding -> SDoc
- pprStgTopBindings :: [StgTopBinding] -> SDoc

# Documentation

data GenStgArg occ #

Constructors

StgVarArg occ |
StgLitArg Literal |

Instances

Outputable bdee => Outputable (GenStgArg bdee) # |
Instance details Defined in StgSyn Methods ppr :: GenStgArg bdee -> SDoc # pprPrec :: Rational -> GenStgArg bdee -> SDoc #

data GenStgTopBinding bndr occ #

A top-level binding.

Constructors

StgTopLifted (GenStgBinding bndr occ) |
StgTopStringLit bndr ByteString |

Instances

(OutputableBndr bndr, Outputable bdee, Ord bdee) => Outputable (GenStgTopBinding bndr bdee) # |
Instance details Defined in StgSyn Methods ppr :: GenStgTopBinding bndr bdee -> SDoc # pprPrec :: Rational -> GenStgTopBinding bndr bdee -> SDoc #

data GenStgBinding bndr occ #

Constructors

StgNonRec bndr (GenStgRhs bndr occ) |
StgRec [(bndr, GenStgRhs bndr occ)] |

Instances

(OutputableBndr bndr, Outputable bdee, Ord bdee) => Outputable (GenStgBinding bndr bdee) # |
Instance details Defined in StgSyn Methods ppr :: GenStgBinding bndr bdee -> SDoc # pprPrec :: Rational -> GenStgBinding bndr bdee -> SDoc #

data GenStgExpr bndr occ #

Constructors

StgApp occ [GenStgArg occ] |
StgLit Literal |
StgConApp DataCon [GenStgArg occ] [Type] |
StgOpApp StgOp [GenStgArg occ] Type |
StgLam (NonEmpty bndr) StgExpr |
StgCase (GenStgExpr bndr occ) bndr AltType [GenStgAlt bndr occ] |
StgLet (GenStgBinding bndr occ) (GenStgExpr bndr occ) |
StgLetNoEscape (GenStgBinding bndr occ) (GenStgExpr bndr occ) |
StgTick (Tickish bndr) (GenStgExpr bndr occ) |

Instances

(OutputableBndr bndr, Outputable bdee, Ord bdee) => Outputable (GenStgExpr bndr bdee) # |
Instance details Defined in StgSyn Methods ppr :: GenStgExpr bndr bdee -> SDoc # pprPrec :: Rational -> GenStgExpr bndr bdee -> SDoc #

data GenStgRhs bndr occ #

Constructors

StgRhsClosure CostCentreStack StgBinderInfo [occ] !UpdateFlag [bndr] (GenStgExpr bndr occ) |
StgRhsCon CostCentreStack DataCon [GenStgArg occ] |

Instances

(OutputableBndr bndr, Outputable bdee, Ord bdee) => Outputable (GenStgRhs bndr bdee) # |
Instance details Defined in StgSyn Methods ppr :: GenStgRhs bndr bdee -> SDoc # pprPrec :: Rational -> GenStgRhs bndr bdee -> SDoc #

type GenStgAlt bndr occ = (AltCon, [bndr], GenStgExpr bndr occ) #

data AltType #

Constructors

PolyAlt |
MultiValAlt Int |
AlgAlt TyCon |
PrimAlt PrimRep |

Instances

Outputable AltType # |
Instance details Defined in StgSyn Methods ppr :: AltType -> SDoc # pprPrec :: Rational -> AltType -> SDoc #

data UpdateFlag #

Constructors

ReEntrant |
Updatable |
SingleEntry |

Instances

Outputable UpdateFlag # |
Instance details Defined in StgSyn Methods ppr :: UpdateFlag -> SDoc # pprPrec :: Rational -> UpdateFlag -> SDoc #

isUpdatable :: UpdateFlag -> Bool #

data StgBinderInfo #

noBinderInfo :: StgBinderInfo #

stgSatOcc :: StgBinderInfo #

stgUnsatOcc :: StgBinderInfo #

satCallsOnly :: StgBinderInfo -> Bool #

combineStgBinderInfo :: StgBinderInfo -> StgBinderInfo -> StgBinderInfo #

type StgArg = GenStgArg Id #

type StgTopBinding = GenStgTopBinding Id Id #

type StgBinding = GenStgBinding Id Id #

type StgExpr = GenStgExpr Id Id #

type StgRhs = GenStgRhs Id Id #

type StgAlt = GenStgAlt Id Id #

type InStgArg = StgArg #

type InStgTopBinding = StgTopBinding #

type InStgBinding = StgBinding #

type InStgExpr = StgExpr #

type InStgRhs = StgRhs #

type InStgAlt = StgAlt #

type OutStgArg = StgArg #

type OutStgTopBinding = StgTopBinding #

type OutStgBinding = StgBinding #

type OutStgExpr = StgExpr #

type OutStgRhs = StgRhs #

type OutStgAlt = StgAlt #

data StgOp #

Constructors

StgPrimOp PrimOp |
StgPrimCallOp PrimCall |
StgFCallOp ForeignCall Unique |

topStgBindHasCafRefs :: GenStgTopBinding bndr Id -> Bool #

stgArgHasCafRefs :: GenStgArg Id -> Bool #

stgRhsArity :: StgRhs -> Int #

isDllConApp :: DynFlags -> Module -> DataCon -> [StgArg] -> Bool #

Does this constructor application refer to anything in a different *Windows* DLL? If so, we can't allocate it statically

stgArgType :: StgArg -> Type #

Type of an `StgArg`

Very half baked because we have lost the type arguments.

stripStgTicksTop :: (Tickish Id -> Bool) -> StgExpr -> ([Tickish Id], StgExpr) #

Strip ticks of a given type from an STG expression

stgCaseBndrInScope #

Arguments

:: AltType |
-> Bool | unarised?
-> Bool |

Given an alt type and whether the program is unarised, return whether the case binder is in scope.

Case binders of unboxed tuple or unboxed sum type always dead after the unariser has run. See Note [Post-unarisation invariants].

pprStgBinding :: StgBinding -> SDoc #

pprStgTopBindings :: [StgTopBinding] -> SDoc #