From 73933773ed314b8958752ca628ae54c2de4dae7f Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Sun, 10 Mar 2019 01:58:12 +0000 Subject: [PATCH] Print module to stderr --- Main.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Main.hs b/Main.hs index 37c6cbc..2d838d3 100644 --- a/Main.hs +++ b/Main.hs @@ -5,6 +5,7 @@ module Main where import qualified AST import qualified Data.Text.Lazy.IO as Text import Foreign.Ptr +import System.IO import LLVM.Context import LLVM.CodeModel import LLVM.ExecutionEngine @@ -23,7 +24,7 @@ main = do ast <- read <$> getContents let mdl = buildModule "main" $ function "expr" [] float $ \_ -> build ast >>= ret - Text.putStrLn (ppllvm mdl) + Text.hPutStrLn stderr (ppllvm mdl) withContext $ \ctx -> withMCJIT ctx Nothing Nothing Nothing Nothing $ \mcjit -> withModuleFromAST ctx mdl $ \mdl' -> -- 2.30.2