From c0e77d22cf83cc205a6553af3b9d244e9cf045ce Mon Sep 17 00:00:00 2001 From: sudoer777 Date: Fri, 22 Sep 2023 16:38:17 -0500 Subject: [PATCH] Print generated llvm --- app/LLVMGen/Expression.hs | 6 +++--- app/Main.hs | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/LLVMGen/Expression.hs b/app/LLVMGen/Expression.hs index 0b2c4d2..e501bd0 100644 --- a/app/LLVMGen/Expression.hs +++ b/app/LLVMGen/Expression.hs @@ -1,4 +1,4 @@ -module LLVMGen.Expression () where +module LLVMGen.Expression (getLLVM) where import qualified Objects.Expression as Expr @@ -47,5 +47,5 @@ toLLVM modul = withContext $ \ctx -> do llvm <- withModuleFromAST ctx modul moduleLLVMAssembly BS.putStrLn llvm -main :: IO () -main = toLLVM module_ \ No newline at end of file +getLLVM :: IO () +getLLVM = toLLVM module_ \ No newline at end of file diff --git a/app/Main.hs b/app/Main.hs index d9407df..b75f999 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -6,6 +6,7 @@ import Eval.Expression import Objects.Expression import Parser.Expression import System.Environment +import LLVMGen.Expression import System.IO import Text.Megaparsec @@ -20,3 +21,4 @@ main = do contents <- readFile fileName let result = getResult contents print result + getLLVM