Gibbon.Passes.Codegen
Description
The final pass of the compiler: generate C code.
codegenProg :: Config -> Prog -> IO String Source #
Compile a program to C code that has the side effect of the "gibbon_main" expression in that program.
harvestStructTys :: Prog -> Set [Ty] Source #
Harvest all struct tys. All product types used anywhere in the program.
makeName :: [Ty] -> String Source #
rewriteReturns :: Tail -> [(Var, Ty)] -> Tail Source #
Replace returns with assignments to a given set of destinations.