1module IRTS.CodegenCommon where
5import IRTS.Defunctionalise
8import Control.Exception
10import System.Environment
12data DbgLevel = NONE | DEBUG | TRACE deriving Eq
13data OutputType = Raw | Object | Executable | MavenProject deriving (Eq, Show)
15environment :: String -> IO (Maybe String)
16environment x = Control.Exception.catch (do e <- getEnv x
18 (\y-> do return (y::SomeException); return Nothing)
20-- Everything which might be needed in a code generator - a CG can choose which
21-- level of Decls to generate code from (simplified, defunctionalised or merely
22-- lambda lifted) and has access to the list of object files, libraries, etc.
24data CodegenInfo = CodegenInfo { outputFile :: String,
25 outputType :: OutputType,
26 targetTriple :: String,
28 includes :: [FilePath],
29 importDirs :: [FilePath],
30 compileObjs :: [String],
31 compileLibs :: [String],
32 compilerFlags :: [String],
33 debugLevel :: DbgLevel,
34 simpleDecls :: [(Name, SDecl)],
35 defunDecls :: [(Name, DDecl)],
36 liftDecls :: [(Name, LDecl)],
38 exportDecls :: [ExportIFace]
41type CodeGenerator = CodegenInfo -> IO ()
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list