[project @ 2001-02-26 16:42:48 by simonmar]
authorsimonmar <unknown>
Mon, 26 Feb 2001 16:42:48 +0000 (16:42 +0000)
committersimonmar <unknown>
Mon, 26 Feb 2001 16:42:48 +0000 (16:42 +0000)
Unload temporary bindings from the ClosureEnv properly at cmLoadModule time.

ghc/compiler/compMan/CmLink.lhs
ghc/compiler/ghci/ByteCodeLink.lhs

index fb34f69..af0b8f4 100644 (file)
@@ -109,6 +109,7 @@ updateClosureEnv pls new_bindings
 --
 --     * otherwise, we unload it.
 --
+--      * we also implicitly unload all temporary bindings at this point.
 
 unload :: GhciMode
        -> DynFlags
index 7000cbf..1619758 100644 (file)
@@ -110,10 +110,13 @@ instance Outputable UnlinkedBCO where
 type ClosureEnv = FiniteMap Name HValue
 data HValue     = HValue  -- dummy type, actually a pointer to some Real Code.
 
--- remove all entries for a given set of modules from the environment
+-- remove all entries for a given set of modules from the environment;
+-- note that this removes all local names too (ie. temporary bindings from
+-- the command line).
 filterNameMap :: [ModuleName] -> FiniteMap Name a -> FiniteMap Name a
 filterNameMap mods env 
-   = filterFM (\n _ -> moduleName (nameModule n) `elem` mods) env
+   = filterFM (\n _ -> isGlobalName n && 
+                       moduleName (nameModule n) `elem` mods) env
 \end{code}
 
 %************************************************************************