diff --git a/src/Codegen/Codegen.hs b/src/Codegen/Codegen.hs index b32f73f..8c7c1d3 100644 --- a/src/Codegen/Codegen.hs +++ b/src/Codegen/Codegen.hs @@ -1,7 +1,7 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} -module Codegen.Codegen (compile) where +module Codegen.Codegen (generateCode) where import Auxiliary (snoc) import Codegen.LlvmIr (CallingConvention (..), LLVMComp (..), @@ -131,8 +131,8 @@ test v = Program [ An easy way to actually "compile" this output is to Simply pipe it to LLI -} -compile :: Program -> Err String -compile (Program scs) = do +generateCode :: Program -> Err String +generateCode (Program scs) = do let codegen = initCodeGenerator scs llvmIrToString . instructions <$> execStateT (compileScs scs) codegen diff --git a/src/Main.hs b/src/Main.hs index 313d952..01d4f1d 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -2,7 +2,7 @@ module Main where -import Codegen.Codegen (compile) +import Codegen.Codegen (generateCode) import GHC.IO.Handle.Text (hPutStrLn) import Grammar.ErrM (Err) import Grammar.Par (myLexer, pProgram) @@ -51,7 +51,7 @@ main' debug s = do printToErr $ printTree lifted printToErr "\n -- Printing compiler output to stdout --" - compiled <- fromCompilerErr $ compile lifted + compiled <- fromCompilerErr $ generateCode lifted --putStrLn compiled check <- doesPathExist "output"