StgSyn

ghc-7.10.3: The GHC API

Safe Haskell | None
Language | Haskell2010

StgSyn

Synopsis

- data GenStgArg occ
  - = StgVarArg occ
  - | StgLitArg Literal
- type GenStgLiveVars occ = UniqSet occ
- 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]
  - | StgOpApp StgOp [GenStgArg occ] Type
  - | StgLam [bndr] StgExpr
  - | StgCase (GenStgExpr bndr occ) (GenStgLiveVars occ) (GenStgLiveVars occ) bndr SRT AltType [GenStgAlt bndr occ]
  - | StgLet (GenStgBinding bndr occ) (GenStgExpr bndr occ)
  - | StgLetNoEscape (GenStgLiveVars occ) (GenStgLiveVars occ) (GenStgBinding bndr occ) (GenStgExpr bndr occ)
  - | StgTick (Tickish bndr) (GenStgExpr bndr occ)
- data GenStgRhs bndr occ
  - = StgRhsClosure CostCentreStack StgBinderInfo [occ] !UpdateFlag SRT [bndr] (GenStgExpr bndr occ)
  - | StgRhsCon CostCentreStack DataCon [GenStgArg occ]
- type GenStgAlt bndr occ = (AltCon, [bndr], [Bool], GenStgExpr bndr occ)
- data AltType
  - = PolyAlt
  - | UbxTupAlt Int
  - | AlgAlt TyCon
  - | PrimAlt TyCon
- 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 StgLiveVars = GenStgLiveVars Id
- type StgBinding = GenStgBinding Id Id
- type StgExpr = GenStgExpr Id Id
- type StgRhs = GenStgRhs Id Id
- type StgAlt = GenStgAlt Id Id
- data StgOp
  - = StgPrimOp PrimOp
  - | StgPrimCallOp PrimCall
  - | StgFCallOp ForeignCall Unique
- data SRT
  - = NoSRT
  - | SRTEntries IdSet
  - | SRT !Int !Int !Bitmap
- stgBindHasCafRefs :: GenStgBinding 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)
- pprStgBinding :: StgBinding -> SDoc
- pprStgBindings :: [StgBinding] -> SDoc
- pprStgLVs :: Outputable occ => GenStgLiveVars occ -> SDoc

# Documentation

data GenStgArg occ

Constructors

StgVarArg occ |
StgLitArg Literal |

Instances

Outputable bdee => Outputable (GenStgArg bdee) |

type GenStgLiveVars occ = UniqSet occ

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) |

data GenStgExpr bndr occ

Constructors

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

Instances

(OutputableBndr bndr, Outputable bdee, Ord bdee) => Outputable (GenStgExpr bndr bdee) |

data GenStgRhs bndr occ

Constructors

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

Instances

(OutputableBndr bndr, Outputable bdee, Ord bdee) => Outputable (GenStgRhs bndr bdee) |

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

data AltType

Constructors

PolyAlt |
UbxTupAlt Int |
AlgAlt TyCon |
PrimAlt TyCon |

Instances

Outputable AltType |

data UpdateFlag

Constructors

ReEntrant |
Updatable |
SingleEntry |

Instances

Outputable UpdateFlag |

isUpdatable :: UpdateFlag -> Bool

data StgBinderInfo

noBinderInfo :: StgBinderInfo

stgSatOcc :: StgBinderInfo

stgUnsatOcc :: StgBinderInfo

satCallsOnly :: StgBinderInfo -> Bool

combineStgBinderInfo :: StgBinderInfo -> StgBinderInfo -> StgBinderInfo

type StgArg = GenStgArg Id

type StgLiveVars = GenStgLiveVars Id

type StgBinding = GenStgBinding Id Id

type StgExpr = GenStgExpr Id Id

type StgRhs = GenStgRhs Id Id

type StgAlt = GenStgAlt Id Id

data StgOp

Constructors

StgPrimOp PrimOp |
StgPrimCallOp PrimCall |
StgFCallOp ForeignCall Unique |

data SRT

Constructors

NoSRT |
SRTEntries IdSet |
SRT !Int !Int !Bitmap |

stgBindHasCafRefs :: GenStgBinding 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 becase we have lost the type arguments.

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

Strip ticks of a given type from an STG expression

pprStgBinding :: StgBinding -> SDoc

pprStgBindings :: [StgBinding] -> SDoc

pprStgLVs :: Outputable occ => GenStgLiveVars occ -> SDoc