[project @ 2001-02-26 15:06:57 by simonmar]
[ghc-hetmet.git] / ghc / compiler / compMan / CmLink.lhs
index 3b3e28b..9b1045d 100644 (file)
@@ -8,6 +8,7 @@ module CmLink ( Linkable(..),  Unlinked(..),
                filterModuleLinkables, 
                findModuleLinkable_maybe,
                LinkResult(..),
+               updateClosureEnv,
                 link, 
                unload,
                 PersistentLinkerState{-abstractly!-}, emptyPLS,
@@ -23,6 +24,7 @@ import CmTypes
 import CmStaticInfo    ( GhciMode(..) )
 import Outputable      ( SDoc )
 import Digraph         ( SCC(..), flattenSCC )
+import Name            ( Name )
 import Module          ( ModuleName )
 import FiniteMap
 import Outputable
@@ -88,6 +90,11 @@ emptyPLS = return (PersistentLinkerState { closure_env = emptyFM,
 emptyPLS = return (PersistentLinkerState {})
 #endif
 
+updateClosureEnv :: PersistentLinkerState -> [(Name,HValue)] 
+       -> IO PersistentLinkerState
+updateClosureEnv pls new_bindings
+  = return pls{ closure_env = addListToFM (closure_env pls) new_bindings }
+
 -----------------------------------------------------------------------------
 -- Unloading old objects ready for a new compilation sweep.
 --