Safe Haskell | None |
---|---|
Language | GHC2021 |
JS codegen state monad
Synopsis
- runG :: StgToJSConfig -> Module -> UniqFM Id CgStgExpr -> G a -> IO a
- emitGlobal :: JStgStat -> G ()
- addDependency :: OtherSymb -> G ()
- emitToplevel :: JStgStat -> G ()
- emitStatic :: FastString -> StaticVal -> Maybe Ident -> G ()
- emitClosureInfo :: ClosureInfo -> G ()
- emitForeign :: Maybe RealSrcSpan -> FastString -> Safety -> CCallConv -> [FastString] -> FastString -> G ()
- assertRtsStat :: G JStgStat -> G JStgStat
- getSettings :: G StgToJSConfig
- globalOccs :: JStgStat -> G [GlobalOcc]
- setGlobalIdCache :: GlobalIdCache -> G ()
- getGlobalIdCache :: G GlobalIdCache
- data GlobalOcc = GlobalOcc {
- global_ident :: !Ident
- global_id :: !Id
- global_count :: !Word
- modifyGroup :: (GenGroupState -> GenGroupState) -> G ()
- resetGroup :: G ()
Documentation
emitGlobal :: JStgStat -> G () Source #
emit a global (for the current module) toplevel statement
addDependency :: OtherSymb -> G () Source #
add a dependency on a particular symbol to the current group
emitToplevel :: JStgStat -> G () Source #
emit a top-level statement for the current binding group
emitStatic :: FastString -> StaticVal -> Maybe Ident -> G () Source #
emit static data for the binding group
emitClosureInfo :: ClosureInfo -> G () Source #
add closure info in our binding group. all heap objects must have closure info
emitForeign :: Maybe RealSrcSpan -> FastString -> Safety -> CCallConv -> [FastString] -> FastString -> G () Source #
globalOccs :: JStgStat -> G [GlobalOcc] Source #
Return number of occurrences of every global id used in the given JStgStat. Sort by increasing occurrence count.
setGlobalIdCache :: GlobalIdCache -> G () Source #
GlobalOcc | |
|
Instances
Group
modifyGroup :: (GenGroupState -> GenGroupState) -> G () Source #
resetGroup :: G () Source #
start with a new binding group