Safe Haskell | None |
---|---|
Language | Haskell2010 |
C code generator. This module can convert a correct ImpCode program to an equivalent C program.
Synopsis
- compileProg :: MonadFreshNames m => Text -> Prog MCMem -> m (Warnings, CParts)
- generateContext :: CompilerM op () ()
- data CParts = CParts {}
- asLibrary :: CParts -> (Text, Text, Text)
- asExecutable :: CParts -> Text
- asServer :: CParts -> Text
- operations :: Operations Multicore ()
- cliOptions :: [Option]
Documentation
compileProg :: MonadFreshNames m => Text -> Prog MCMem -> m (Warnings, CParts) Source #
Compile the program to ImpCode with multicore operations.
generateContext :: CompilerM op () () Source #
Generate the multicore context definitions. This is exported because the WASM backend needs it.
The result of compilation to C is multiple parts, which can be put together in various ways. The obvious way is to concatenate all of them, which yields a CLI program. Another is to compile the library part by itself, and use the header file to call into it.
asLibrary :: CParts -> (Text, Text, Text) Source #
Produce header, implementation, and manifest files.
asExecutable :: CParts -> Text Source #
As executable with command-line interface.
operations :: Operations Multicore () Source #
Operations for generating multicore code.
cliOptions :: [Option] Source #
Multicore-related command line options.