on master help sign in
Skeleton of stub-generating LLVM codegen
14ee023Benjamin Saunders
idris.cabal+2−2
@@ -110,7 +110,7 @@ Executable idris
110 IRTS.Lang, IRTS.LParser, IRTS.Bytecode, IRTS.Simplified,
110 IRTS.Lang, IRTS.LParser, IRTS.Bytecode, IRTS.Simplified,
111 IRTS.CodegenC, IRTS.Defunctionalise, IRTS.Inliner,
111 IRTS.CodegenC, IRTS.Defunctionalise, IRTS.Inliner,
112 IRTS.Compiler, IRTS.CodegenJava, IRTS.BCImp,
112 IRTS.Compiler, IRTS.CodegenJava, IRTS.BCImp,
113− IRTS.CodegenJavaScript,
113+ IRTS.CodegenJavaScript, IRTS.CodegenLLVM,
114 IRTS.CodegenCommon, IRTS.DumpBC
114 IRTS.CodegenCommon, IRTS.DumpBC
115
115
116 Paths_idris
116 Paths_idris
@@ -119,7 +119,7 @@ Executable idris
119 haskeline>=0.7, split, directory,
119 haskeline>=0.7, split, directory,
120 containers, process, transformers, filepath,
120 containers, process, transformers, filepath,
121 directory, binary, bytestring, text, pretty,
121 directory, binary, bytestring, text, pretty,
122− language-java>=0.2.2, libffi
122+ language-java>=0.2.2, libffi, llvm-general>=3.3 && <3.4
123
123
124 Extensions: MultiParamTypeClasses, FunctionalDependencies,
124 Extensions: MultiParamTypeClasses, FunctionalDependencies,
125 FlexibleInstances, TemplateHaskell
125 FlexibleInstances, TemplateHaskell
src/IRTS/Compiler.hs+3−1
@@ -10,6 +10,7 @@ import IRTS.CodegenC
10import IRTS.CodegenJava
10import IRTS.CodegenJava
11import IRTS.DumpBC
11import IRTS.DumpBC
12import IRTS.CodegenJavaScript
12import IRTS.CodegenJavaScript
13+import IRTS.CodegenLLVM
13import IRTS.Inliner
14import IRTS.Inliner
14
15
15import Idris.AbsSyntax
16import Idris.AbsSyntax
@@ -74,8 +75,9 @@ compile target f tm
74 codegenJava [] c f hdrs libs outty
75 codegenJava [] c f hdrs libs outty
75 ViaJavaScript ->
76 ViaJavaScript ->
76 codegenJavaScript JavaScript c f outty
77 codegenJavaScript JavaScript c f outty
77− ViaNode ->
78+ ViaNode ->
78 codegenJavaScript Node c f outty
79 codegenJavaScript Node c f outty
80+ ViaLLVM -> codegenLLVM c f outty
79
81
80 Bytecode -> dumpBC c f
82 Bytecode -> dumpBC c f
81 Error e -> fail $ show e
83 Error e -> fail $ show e
src/Idris/AbsSyntaxTree.hs+1
@@ -175,6 +175,7 @@ data Target = ViaC
175 | ViaJava
175 | ViaJava
176 | ViaNode
176 | ViaNode
177 | ViaJavaScript
177 | ViaJavaScript
178+ | ViaLLVM
178 | Bytecode
179 | Bytecode
179 deriving (Show, Eq)
180 deriving (Show, Eq)
180
181
src/Idris/REPL.hs+1
@@ -566,6 +566,7 @@ parseTarget "Java" = ViaJava
566parseTarget "bytecode" = Bytecode
566parseTarget "bytecode" = Bytecode
567parseTarget "javascript" = ViaJavaScript
567parseTarget "javascript" = ViaJavaScript
568parseTarget "node" = ViaNode
568parseTarget "node" = ViaNode
569+parseTarget "llvm" = ViaLLVM
569parseTarget _ = error "unknown target" -- FIXME: partial function
570parseTarget _ = error "unknown target" -- FIXME: partial function
570
571
571parseArgs :: [String] -> [Opt]
572parseArgs :: [String] -> [Opt]