module IRTS.CodegenCommon where
import GHC.Generics (Generic)
import Idris.Core.TT
import IRTS.Simplified
import IRTS.Defunctionalise
data DbgLevel = NONE | DEBUG | TRACE deriving Eq
data OutputType = Raw | Object | Executable deriving (Eq, Show, Generic)
data CodegenInfo = CodegenInfo {
outputFile :: String
, outputType :: OutputType
, targetTriple :: String
, targetCPU :: String
, includes :: [FilePath]
, importDirs :: [FilePath]
, compileObjs :: [String]
, compileLibs :: [String]
, compilerFlags :: [String]
, debugLevel :: DbgLevel
, simpleDecls :: [(Name, SDecl)]
, defunDecls :: [(Name, DDecl)]
, liftDecls :: [(Name, LDecl)]
, interfaces :: Bool
, exportDecls :: [ExportIFace]
}
type CodeGenerator = CodegenInfo -> IO ()