Remove ILX from the GHC altogether (although I left the source file IlxGen in case...
[ghc-hetmet.git] / compiler / main / CodeOutput.lhs
index d1b2933..a66a836 100644 (file)
@@ -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
@@ -27,6 +23,7 @@ import Finder         ( mkStubPaths )
 import PprC            ( writeCs )
 import CmmLint         ( cmmLint )
 import Packages
+import PackageConfig   ( rtsPackageId )
 import Util
 import FastString      ( unpackFS )
 import Cmm             ( Cmm )
@@ -35,7 +32,7 @@ import DynFlags
 import ErrUtils                ( dumpIfSet_dyn, showPass, ghcExit )
 import Outputable
 import Pretty          ( Mode(..), printDoc )
-import Module          ( Module, ModLocation(..) )
+import Module          ( Module, ModLocation(..), moduleName )
 import List            ( nub )
 import Maybes          ( firstJust )
 
@@ -93,13 +90,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
        }
@@ -125,7 +115,7 @@ outputC dflags filenm mod location flat_absC
        --   * -#include options from the cmdline and OPTIONS pragmas
        --   * the _stub.h file, if there is one.
        --
-       pkg_configs <- getExplicitPackagesAnd dflags packages
+       pkg_configs <- getPreloadPackagesAnd dflags packages
        let pkg_names = map (showPackageId.package) pkg_configs
 
        c_includes <- getPackageCIncludes pkg_configs
@@ -156,7 +146,7 @@ outputC dflags filenm mod location flat_absC
             hPutStrLn h ("#include \"" ++ (filenameOf stub_h) ++ "\"")
          writeCs dflags h flat_absC
   where
-    (_, stub_h) = mkStubPaths dflags mod location
+    (_, stub_h) = mkStubPaths dflags (moduleName mod) location
 \end{code}
 
 
@@ -210,22 +200,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}
 %*                                                                     *
 %************************************************************************
@@ -259,12 +233,9 @@ outputForeignStubs dflags mod location stubs
                       "Foreign export header file" stub_h_output_d
 
        -- we need the #includes from the rts package for the stub files
-       let rtsid = rtsPackageId (pkgState dflags)
-           rts_includes 
-               | ExtPackage pid <- rtsid = 
-                       let rts_pkg = getPackageDetails (pkgState dflags) pid in
-                       concatMap mk_include (includes rts_pkg)
-               | otherwise = []
+       let rts_includes = 
+              let rts_pkg = getPackageDetails (pkgState dflags) rtsPackageId in
+              concatMap mk_include (includes rts_pkg)
            mk_include i = "#include \"" ++ i ++ "\"\n"
 
        stub_h_file_exists
@@ -287,7 +258,7 @@ outputForeignStubs dflags mod location stubs
 
         return (stub_h_file_exists, stub_c_file_exists)
   where
-   (stub_c, stub_h) = mkStubPaths dflags mod location
+   (stub_c, stub_h) = mkStubPaths dflags (moduleName mod) location
 
 cplusplus_hdr = "#ifdef __cplusplus\nextern \"C\" {\n#endif\n"
 cplusplus_ftr = "#ifdef __cplusplus\n}\n#endif\n"