[project @ 2000-11-13 12:43:20 by sewardj]
[ghc-hetmet.git] / ghc / compiler / compMan / CmLink.lhs
index 3ec42dd..c645192 100644 (file)
@@ -12,14 +12,11 @@ module CmLink ( Linkable(..),  Unlinked(..),
                 PersistentLinkerState{-abstractly!-}, emptyPLS )
 where
 
-import StgInterp       ( linkIModules, ClosureEnv, ItblEnv )
-import Linker          ( loadObj, resolveObjs )
+
+import Interpreter
 import CmStaticInfo    ( PackageConfigInfo )
 import Module          ( ModuleName, PackageName )
-import InterpSyn       ( UnlinkedIBind, HValue, binder )
-import Module          ( Module )
 import Outputable      ( SDoc )
-import FiniteMap       ( emptyFM )
 import Digraph         ( SCC(..), flattenSCC )
 import Outputable
 import Panic           ( panic )
@@ -30,6 +27,8 @@ import Panic          ( panic )
 \begin{code}
 data PersistentLinkerState 
    = PersistentLinkerState {
+
+#ifdef GHCI
        -- Current global mapping from RdrNames to closure addresses
         closure_env :: ClosureEnv,
 
@@ -42,6 +41,10 @@ data PersistentLinkerState
 
        -- notionally here, but really lives in the C part of the linker:
        --            object_symtab :: FiniteMap String Addr
+#else
+       dummy :: ()     --  sigh, can't have an empty record
+#endif
+
      }
 
 data LinkResult 
@@ -59,7 +62,7 @@ instance Outputable Unlinked where
    ppr (DotO path)   = text "DotO" <+> text path
    ppr (DotA path)   = text "DotA" <+> text path
    ppr (DotDLL path) = text "DotDLL" <+> text path
-   ppr (Trees binds _) = text "Trees" <+> ppr (map binder binds)
+   ppr (Trees binds _) = text "Trees" <+> ppr binds
 
 
 isObject (DotO _) = True
@@ -79,8 +82,12 @@ instance Outputable Linkable where
    ppr (LP package_nm)       = text "LinkableP" <+> ptext package_nm
 
 emptyPLS :: IO PersistentLinkerState
+#ifdef GHCI
 emptyPLS = return (PersistentLinkerState { closure_env = emptyFM, 
                                            itbl_env    = emptyFM })
+#else
+emptyPLS = return (PersistentLinkerState {})
+#endif
 \end{code}
 
 \begin{code}