{-# 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
import ByteCodeLink
import ByteCodeItbls
import ByteCodeAsm
-import RtClosureInspect
import CgInfoTbls
import SMRep
import IfaceEnv
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:
| mi_boot iface
= link_boot_mod_error mod
| otherwise
- = follow_deps (map (mkModule this_pkg) boot_deps ++ mods) acc_mods' acc_pkgs'
+ = follow_deps (map (mkModule this_pkg) boot_deps' ++ mods) acc_mods' acc_pkgs'
where
pkg = modulePackageId mod
iface = get_iface mod