diff options
Diffstat (limited to 'compiler/main/CodeOutput.hs')
-rw-r--r-- | compiler/main/CodeOutput.hs | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/compiler/main/CodeOutput.hs b/compiler/main/CodeOutput.hs index 34cada3ff9..478de594ac 100644 --- a/compiler/main/CodeOutput.hs +++ b/compiler/main/CodeOutput.hs @@ -10,6 +10,8 @@ module CodeOutput( codeOutput, outputForeignStubs ) where #include "HsVersions.h" +import GhcPrelude + import AsmCodeGen ( nativeCodeGen ) import LlvmCodeGen ( llvmCodeGen ) @@ -36,7 +38,6 @@ import Control.Exception import System.Directory import System.FilePath import System.IO -import Control.Monad (forM) {- ************************************************************************ @@ -51,7 +52,7 @@ codeOutput :: DynFlags -> FilePath -> ModLocation -> ForeignStubs - -> [(ForeignSrcLang, String)] + -> [(ForeignSrcLang, FilePath)] -- ^ additional files to be compiled with with the C compiler -> [InstalledUnitId] -> Stream IO RawCmmGroup () -- Compiled C-- @@ -59,7 +60,7 @@ codeOutput :: DynFlags (Bool{-stub_h_exists-}, Maybe FilePath{-stub_c_exists-}), [(ForeignSrcLang, FilePath)]{-foreign_fps-}) -codeOutput dflags this_mod filenm location foreign_stubs foreign_files pkg_deps +codeOutput dflags this_mod filenm location foreign_stubs foreign_fps pkg_deps cmm_stream = do { @@ -87,10 +88,6 @@ codeOutput dflags this_mod filenm location foreign_stubs foreign_files pkg_deps } ; stubs_exist <- outputForeignStubs dflags this_mod location foreign_stubs - ; foreign_fps <- forM foreign_files $ \(lang, file_contents) -> do - { fp <- outputForeignFile dflags lang file_contents; - ; return (lang, fp); - } ; case hscTarget dflags of { HscAsm -> outputAsm dflags this_mod location filenm linted_cmm_stream; @@ -268,14 +265,3 @@ outputForeignStubs_help fname doc_str header footer = do writeFile fname (header ++ doc_str ++ '\n':footer ++ "\n") return True -outputForeignFile :: DynFlags -> ForeignSrcLang -> String -> IO FilePath -outputForeignFile dflags lang file_contents - = do - extension <- case lang of - LangC -> return "c" - LangCxx -> return "cpp" - LangObjc -> return "m" - LangObjcxx -> return "mm" - fp <- newTempName dflags TFL_CurrentModule extension - writeFile fp file_contents - return fp |