X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FLinker.lhs;h=7b40c32f5e8551c05cfcb15bef9375ed6644db49;hb=7ac266d097639620e4fea22c40450c8d7822f5fb;hp=38d584a633f7cb46a94161c67654573a0f5b8998;hpb=cdce647711c0f46f5799b24de087622cb77e647f;p=ghc-hetmet.git diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index 38d584a..7b40c32 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -15,8 +15,9 @@ necessary. {-# OPTIONS -optc-DNON_POSIX_SOURCE -#include "Linker.h" #-} module Linker ( HValue, getHValue, showLinkerState, - linkExpr, unload, extendLinkEnv, withExtendedLinkEnv, - extendLoadedPkgs, + linkExpr, unload, withExtendedLinkEnv, + extendLinkEnv, deleteFromLinkEnv, + extendLoadedPkgs, linkPackages,initDynLinker, dataConInfoPtrToName ) where @@ -27,7 +28,6 @@ import ObjLink import ByteCodeLink import ByteCodeItbls import ByteCodeAsm -import RtClosureInspect import CgInfoTbls import SMRep import IfaceEnv @@ -145,6 +145,13 @@ extendLinkEnv new_bindings new_pls = pls { closure_env = new_closure_env } writeIORef v_PersistentLinkerState new_pls +deleteFromLinkEnv :: [Name] -> IO () +deleteFromLinkEnv to_remove + = do pls <- readIORef v_PersistentLinkerState + let new_closure_env = delListFromNameEnv (closure_env pls) to_remove + new_pls = pls { closure_env = new_closure_env } + writeIORef v_PersistentLinkerState new_pls + -- | Given a data constructor, find its internal name. -- The info tables for data constructors have a field which records the source name -- of the constructor as a CString. The format is: