File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import qualified CodeGenX64 as CGX64
18
18
import qualified CodeGenLLVM as CGLLVM
19
19
import qualified JITLLVM
20
20
import VarGen
21
+ import System.Process
21
22
22
23
import Data.IntMap as IntMap
23
24
import Data.Map as Map
@@ -72,7 +73,13 @@ main = do
72
73
73
74
putStrLn " * LLVM codegen *"
74
75
let mod = CGLLVM. codeGen $ Program grin
75
- CGLLVM. toLLVM (printf " %s.ll" fname) mod
76
+ llName = printf " %s.ll" fname
77
+ sName = printf " %s.s" fname
78
+ CGLLVM. toLLVM llName mod
79
+
80
+ putStrLn " * LLVM X64 codegen *"
81
+ callProcess " llc-5.0" [llName]
82
+ readFile sName >>= putStrLn
76
83
77
84
putStrLn " * LLVM JIT run *"
78
85
JITLLVM. eagerJit mod
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ executable grin
59
59
, recursion-schemes
60
60
, ansi-wl-pprint
61
61
, containers
62
+ , process
62
63
default-language : Haskell2010
63
64
64
65
test-suite grin-test
You can’t perform that action at this time.
0 commit comments