projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Replace association list in AddressEnv for a FiniteMap
[ghc-hetmet.git]
/
compiler
/
ghci
/
Linker.lhs
diff --git
a/compiler/ghci/Linker.lhs
b/compiler/ghci/Linker.lhs
index
6073d6f
..
8ff654e
100644
(file)
--- a/
compiler/ghci/Linker.lhs
+++ b/
compiler/ghci/Linker.lhs
@@
-14,11
+14,11
@@
necessary.
\begin{code}
{-# OPTIONS -optc-DNON_POSIX_SOURCE -#include "Linker.h" #-}
\begin{code}
{-# OPTIONS -optc-DNON_POSIX_SOURCE -#include "Linker.h" #-}
-module Linker ( HValue, showLinkerState,
+module Linker ( HValue, getHValue, showLinkerState,
linkExpr, unload, extendLinkEnv, withExtendedLinkEnv,
extendLoadedPkgs,
linkExpr, unload, extendLinkEnv, withExtendedLinkEnv,
extendLoadedPkgs,
- linkPackages,initDynLinker
- ,recoverDataCon
+ linkPackages,initDynLinker,
+ recoverDataCon
) where
#include "HsVersions.h"
) where
#include "HsVersions.h"
@@
-195,12
+195,16
@@
recoverDCInRTS a = do
helper [] = Nothing
helper x = Just . second (drop 1) . break (==delim) $ x
in unfoldr helper
helper [] = Nothing
helper x = Just . second (drop 1) . break (==delim) $ x
in unfoldr helper
-
-removeLeadingUnderscore = if cLeadingUnderscore=="YES"
+ removeLeadingUnderscore = if cLeadingUnderscore=="YES"
then tail
else id
then tail
else id
-
+getHValue :: Name -> IO (Maybe HValue)
+getHValue name = do
+ pls <- readIORef v_PersistentLinkerState
+ case lookupNameEnv (closure_env pls) name of
+ Just (_,x) -> return$ Just x
+ _ -> return Nothing
withExtendedLinkEnv :: [(Name,HValue)] -> IO a -> IO a
withExtendedLinkEnv new_env action
withExtendedLinkEnv :: [(Name,HValue)] -> IO a -> IO a
withExtendedLinkEnv new_env action
@@
-726,7
+730,7
@@
linkSomeBCOs toplevs_only ie ce_in de_in ul_bcos
let de_additions = [(address, name) | (address, name) <- zip addresses names
, not(address `elemAddressEnv` de_in)
]
let de_additions = [(address, name) | (address, name) <- zip addresses names
, not(address `elemAddressEnv` de_in)
]
- de_out = extendAddressEnvList' de_in de_additions
+ de_out = extendAddressEnvList de_in de_additions
return ( ce_out, de_out, hvals)
where
goForRefs = getRefs []
return ( ce_out, de_out, hvals)
where
goForRefs = getRefs []