Commit c21ddffb authored by dterei's avatar dterei
Browse files

Show LLVM mangler and code gen passes at v2

parent aa55fdc5
...@@ -45,6 +45,7 @@ llvmCodeGen dflags h us cmms ...@@ -45,6 +45,7 @@ llvmCodeGen dflags h us cmms
env' = funInsert lbl llvmFunTy e env' = funInsert lbl llvmFunTy e
in (d,env') in (d,env')
in do in do
showPass dflags "LlVM CodeGen"
bufh <- newBufHandle h bufh <- newBufHandle h
Prt.bufLeftRender bufh $ pprLlvmHeader Prt.bufLeftRender bufh $ pprLlvmHeader
ver <- (fromMaybe defaultLlvmVersion) `fmap` figureLlvmVersion dflags ver <- (fromMaybe defaultLlvmVersion) `fmap` figureLlvmVersion dflags
......
...@@ -14,6 +14,8 @@ module LlvmMangler ( llvmFixupAsm ) where ...@@ -14,6 +14,8 @@ module LlvmMangler ( llvmFixupAsm ) where
#include "HsVersions.h" #include "HsVersions.h"
import DynFlags ( DynFlags )
import ErrUtils ( showPass )
import LlvmCodeGen.Ppr ( infoSection ) import LlvmCodeGen.Ppr ( infoSection )
import Control.Exception import Control.Exception
...@@ -54,8 +56,9 @@ dollarPred = ((==) '$') ...@@ -54,8 +56,9 @@ dollarPred = ((==) '$')
commaPred = ((==) ',') commaPred = ((==) ',')
-- | Read in assembly file and process -- | Read in assembly file and process
llvmFixupAsm :: FilePath -> FilePath -> IO () llvmFixupAsm :: DynFlags -> FilePath -> FilePath -> IO ()
llvmFixupAsm f1 f2 = do llvmFixupAsm dflags f1 f2 = do
showPass dflags "LlVM Mangler"
r <- openBinaryFile f1 ReadMode r <- openBinaryFile f1 ReadMode
w <- openBinaryFile f2 WriteMode w <- openBinaryFile f2 WriteMode
ss <- readSections r w ss <- readSections r w
......
...@@ -1372,7 +1372,7 @@ runPhase LlvmMangle input_fn dflags ...@@ -1372,7 +1372,7 @@ runPhase LlvmMangle input_fn dflags
= do = do
let next_phase = if dopt Opt_SplitObjs dflags then Splitter else As let next_phase = if dopt Opt_SplitObjs dflags then Splitter else As
output_fn <- phaseOutputFilename next_phase output_fn <- phaseOutputFilename next_phase
io $ llvmFixupAsm input_fn output_fn io $ llvmFixupAsm dflags input_fn output_fn
return (next_phase, output_fn) return (next_phase, output_fn)
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment