X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FCodeOutput.lhs;h=25a10f6fe579dceb8f8099d03bddf91cb07b3cc5;hb=deb22436763386f46174574ed93333a9ccc8cc20;hp=06e1ee785f16a145961660ac1e3eb49dbd4ff0e1;hpb=ee565d464248078a4f2d46f98667aa4fcdc56db4;p=ghc-hetmet.git diff --git a/compiler/main/CodeOutput.lhs b/compiler/main/CodeOutput.lhs index 06e1ee7..25a10f6 100644 --- a/compiler/main/CodeOutput.lhs +++ b/compiler/main/CodeOutput.lhs @@ -13,10 +13,6 @@ import UniqSupply ( mkSplitUniqSupply ) import AsmCodeGen ( nativeCodeGen ) #endif -#ifdef ILX -import IlxGen ( ilxGen ) -#endif - #ifdef JAVA import JavaGen ( javaGen ) import qualified PrintJava @@ -30,9 +26,10 @@ import Packages import PackageConfig ( rtsPackageId ) import Util import FastString ( unpackFS ) -import Cmm ( Cmm ) +import Cmm ( RawCmm ) import HscTypes import DynFlags + import ErrUtils ( dumpIfSet_dyn, showPass, ghcExit ) import Outputable import Pretty ( Mode(..), printDoc ) @@ -58,7 +55,7 @@ codeOutput :: DynFlags -> ModLocation -> ForeignStubs -> [PackageId] - -> [Cmm] -- Compiled C-- + -> [RawCmm] -- Compiled C-- -> IO (Bool{-stub_h_exists-}, Bool{-stub_c_exists-}) codeOutput dflags this_mod location foreign_stubs pkg_deps flat_abstractC @@ -94,13 +91,6 @@ codeOutput dflags this_mod location foreign_stubs pkg_deps flat_abstractC #else panic "Java support not compiled into this ghc"; #endif - HscILX -> -#ifdef ILX - let tycons = typeEnvTyCons type_env in - outputIlx dflags filenm mod_name tycons stg_binds; -#else - panic "ILX support not compiled into this ghc"; -#endif } ; return stubs_exist } @@ -134,15 +124,15 @@ outputC dflags filenm mod location flat_absC ffi_decl_headers = case foreign_stubs of - NoStubs -> [] - ForeignStubs _ _ fdhs _ -> map unpackFS (nub fdhs) + NoStubs -> [] + ForeignStubs _ _ fdhs -> map unpackFS (nub fdhs) -- Remove duplicates, because distinct foreign import decls -- may cite the same #include. Order doesn't matter. all_headers = c_includes ++ reverse cmdline_includes ++ ffi_decl_headers - + let cc_injects = unlines (map mk_include all_headers) mk_include h_file = case h_file of @@ -173,10 +163,10 @@ outputAsm dflags filenm flat_absC #ifndef OMIT_NATIVE_CODEGEN = do ncg_uniqs <- mkSplitUniqSupply 'n' - ncg_output_d <- _scc_ "NativeCodeGen" + ncg_output_d <- {-# SCC "NativeCodeGen" #-} nativeCodeGen dflags flat_absC ncg_uniqs dumpIfSet_dyn dflags Opt_D_dump_asm "Asm code" (docToSDoc ncg_output_d) - _scc_ "OutputAsm" doOutput filenm $ + {-# SCC "OutputAsm" #-} doOutput filenm $ \f -> printDoc LeftMode f ncg_output_d where @@ -211,22 +201,6 @@ outputJava dflags filenm mod tycons core_binds %************************************************************************ %* * -\subsection{Ilx} -%* * -%************************************************************************ - -\begin{code} -#ifdef ILX -outputIlx dflags filename mod tycons stg_binds - = doOutput filename (\ f -> printForC f pp_ilx) - where - pp_ilx = ilxGen mod tycons stg_binds -#endif -\end{code} - - -%************************************************************************ -%* * \subsection{Foreign import/export} %* * %************************************************************************ @@ -243,7 +217,7 @@ outputForeignStubs dflags mod location stubs stub_h_exists <- doesFileExist stub_h return (stub_h_exists, stub_c_exists) - | ForeignStubs h_code c_code _ _ <- stubs + | ForeignStubs h_code c_code _ <- stubs = do let stub_c_output_d = pprCode CStyle c_code