on 4e4b7df help sign in
Idris-dev/src/IRTS/CodegenCommon.hs
31 lines 1.4 kB history raw
1module IRTS.CodegenCommon where
3import Idris.Core.TT
4import IRTS.Simplified
5import IRTS.Defunctionalise
7data DbgLevel = NONE | DEBUG | TRACE deriving Eq
8data OutputType = Raw | Object | Executable | MavenProject deriving (Eq, Show)
10-- Everything which might be needed in a code generator - a CG can choose which
11-- level of Decls to generate code from (simplified, defunctionalised or merely
12-- lambda lifted) and has access to the list of object files, libraries, etc.
14data CodegenInfo = CodegenInfo { outputFile :: String,
15 outputType :: OutputType,
16 targetTriple :: String,
17 targetCPU :: String,
18 includes :: [FilePath],
19 importDirs :: [FilePath],
20 compileObjs :: [String],
21 compileLibs :: [String],
22 compilerFlags :: [String],
23 debugLevel :: DbgLevel,
24 simpleDecls :: [(Name, SDecl)],
25 defunDecls :: [(Name, DDecl)],
26 liftDecls :: [(Name, LDecl)],
27 interfaces :: Bool,
28 exportDecls :: [ExportIFace]
29 }
31type CodeGenerator = CodegenInfo -> IO ()