GHC.Wasm.ControlFlow.FromCmm

ghc-9.10.0.20240426: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Wasm.ControlFlow.FromCmm

Synopsis

- structuredControl :: forall expr stmt m. Applicative m => Platform -> UniqSupply -> (Label -> CmmExpr -> m expr) -> (Label -> CmmActions -> m stmt) -> CmmGraph -> m (WasmControl stmt expr ('[] :: [WasmType]) '['I32])

# Documentation

structuredControl Source #

Arguments

:: forall expr stmt m. Applicative m |
=> Platform | needed for offset calculation
-> UniqSupply |
-> (Label -> CmmExpr -> m expr) | translator for expressions
-> (Label -> CmmActions -> m stmt) | translator for straight-line code
-> CmmGraph | CFG to be translated
-> m (WasmControl stmt expr ('[] :: [WasmType]) '['I32]) |

Convert a Cmm CFG to WebAssembly's structured control flow.