[project @ 2005-07-21 08:41:23 by panne]
[ghc-hetmet.git] / ghc / compiler / main / HscMain.lhs
index ab14e17..10c946b 100644 (file)
@@ -12,7 +12,6 @@ module HscMain (
        hscParseIdentifier,
 #ifdef GHCI
        hscStmt, hscTcExpr, hscKcType,
-       hscGetInfo, GetInfoResult,
        compileExpr,
 #endif
        ) where
@@ -28,7 +27,7 @@ import Linker         ( HValue, linkExpr )
 import CoreTidy                ( tidyExpr )
 import CorePrep                ( corePrepExpr )
 import Flattening      ( flattenExpr )
-import TcRnDriver      ( tcRnStmt, tcRnExpr, tcRnGetInfo, GetInfoResult, tcRnType ) 
+import TcRnDriver      ( tcRnStmt, tcRnExpr, tcRnType ) 
 import Type            ( Type )
 import PrelNames       ( iNTERACTIVE )
 import Kind            ( Kind )
@@ -61,6 +60,7 @@ import TidyPgm                ( tidyProgram, mkBootModDetails )
 import CorePrep                ( corePrepPgm )
 import CoreToStg       ( coreToStg )
 import TyCon           ( isDataTyCon )
+import Packages                ( mkHomeModules )
 import Name            ( Name, NamedThing(..) )
 import SimplStg                ( stg2stg )
 import CodeGen         ( codeGen )
@@ -475,6 +475,7 @@ hscCodeGen dflags
        cg_tycons   = tycons,
        cg_dir_imps = dir_imps,
        cg_foreign  = foreign_stubs,
+       cg_home_mods = home_mods,
        cg_dep_pkgs = dependencies     }  = do {
 
   let { data_tycons = filter isDataTyCon tycons } ;
@@ -508,12 +509,13 @@ hscCodeGen dflags
        do
            -----------------  Convert to STG ------------------
            (stg_binds, cost_centre_info) <- {-# SCC "CoreToStg" #-}
-                        myCoreToStg dflags this_mod prepd_binds        
+                        myCoreToStg dflags home_mods this_mod prepd_binds      
 
             ------------------  Code generation ------------------
            abstractC <- {-# SCC "CodeGen" #-}
-                        codeGen dflags this_mod data_tycons foreign_stubs
-                                dir_imps cost_centre_info stg_binds
+                        codeGen dflags home_mods this_mod data_tycons
+                                foreign_stubs dir_imps cost_centre_info
+                                stg_binds
 
            ------------------  Code output -----------------------
            (stub_h_exists, stub_c_exists)
@@ -526,7 +528,7 @@ hscCodeGen dflags
 
 hscCmmFile :: DynFlags -> FilePath -> IO Bool
 hscCmmFile dflags filename = do
-  maybe_cmm <- parseCmmFile dflags filename
+  maybe_cmm <- parseCmmFile dflags (mkHomeModules []) filename
   case maybe_cmm of
     Nothing -> return False
     Just cmm -> do
@@ -566,13 +568,13 @@ myParseModule dflags src_filename maybe_src_buf
       }}
 
 
-myCoreToStg dflags this_mod prepd_binds
+myCoreToStg dflags home_mods this_mod prepd_binds
  = do 
       stg_binds <- {-# SCC "Core2Stg" #-}
-            coreToStg dflags prepd_binds
+            coreToStg home_mods prepd_binds
 
       (stg_binds2, cost_centre_info) <- {-# SCC "Core2Stg" #-}
-            stg2stg dflags this_mod stg_binds
+            stg2stg dflags home_mods this_mod stg_binds
 
       return (stg_binds2, cost_centre_info)
 \end{code}
@@ -715,34 +717,6 @@ hscParseThing parser dflags str
 
 %************************************************************************
 %*                                                                     *
-\subsection{Getting information about an identifer}
-%*                                                                     *
-%************************************************************************
-
-\begin{code}
-#ifdef GHCI
-hscGetInfo -- like hscStmt, but deals with a single identifier
-  :: HscEnv
-  -> String                    -- The identifier
-  -> IO [GetInfoResult]
-
-hscGetInfo hsc_env str
-   = do maybe_rdr_name <- hscParseIdentifier (hsc_dflags hsc_env) str
-       case maybe_rdr_name of {
-         Nothing -> return [];
-         Just (L _ rdr_name) -> do
-
-       maybe_tc_result <- tcRnGetInfo hsc_env (hsc_IC hsc_env) rdr_name
-
-       case maybe_tc_result of
-            Nothing     -> return []
-            Just things -> return things
-       }
-#endif
-\end{code}
-
-%************************************************************************
-%*                                                                     *
        Desugar, simplify, convert to bytecode, and link an expression
 %*                                                                     *
 %************************************************************************