From: Luke Lau Date: Sun, 10 Mar 2019 01:58:12 +0000 (+0000) Subject: Print module to stderr X-Git-Url: https://git.lukelau.me/?p=kaleidoscope-hs-old.git;a=commitdiff_plain;h=73933773ed314b8958752ca628ae54c2de4dae7f Print module to stderr --- 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' ->