diff options
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | main.hs | 21 |
2 files changed, 13 insertions, 10 deletions
@@ -5,3 +5,5 @@ main ll/gen ll/test.s ll/test + +output_gen @@ -5,9 +5,10 @@ import Control.Monad.Except import Data.Either import System.Environment import System.Exit +import qualified Data.ByteString as BS import qualified LLVM.General as General import qualified LLVM.General.Context as General --- import qualified LLVM.General.Target as General +import qualified LLVM.General.Target as General import Check import Codegen @@ -50,8 +51,8 @@ main = do putStrLn $ pshow checked llvmMod <- either die return $ codegen checked "Module" fname - -- putStrLn "Module:" - -- print llvmMod + putStrLn "Module:" + print llvmMod putStrLn "Calling withContext:" General.withContext $ \context -> do @@ -61,10 +62,10 @@ main = do llvmasm <- General.moduleLLVMAssembly genmod putStr llvmasm putStrLn "" - -- assert $ General.withHostTargetMachine $ \machine -> do - -- General.getTargetMachineTriple machine >>= putStrLn - -- putStrLn "" - -- assert (General.moduleTargetAssembly machine genmod) - -- >>= putStr - -- bs <- assert $ General.moduleObject machine genmod - -- BS.writeFile "output_gen.o" bs + assert $ General.withHostTargetMachine $ \machine -> do + General.getTargetMachineTriple machine >>= putStrLn + putStrLn "" + assert (General.moduleTargetAssembly machine genmod) + >>= putStr + bs <- assert $ General.moduleObject machine genmod + BS.writeFile "output_gen.o" bs |