X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fmain%2FFinder.lhs;h=0fb27a354dc1bd32e736e18b049551eafbf9d05a;hb=f4b727487a65e6b611bbaafbd2207bd63a8df706;hp=17299fb194492508603eaf7bb6129bbbb271752c;hpb=f391c6e6b04055eac8bc878af31042e103387530;p=ghc-hetmet.git diff --git a/compiler/main/Finder.lhs b/compiler/main/Finder.lhs index 17299fb..0fb27a3 100644 --- a/compiler/main/Finder.lhs +++ b/compiler/main/Finder.lhs @@ -34,7 +34,6 @@ import Util import PrelNames ( gHC_PRIM ) import DynFlags import Outputable -import FiniteMap import LazyUniqFM import Maybes ( expectJust ) import Exception ( evaluate ) @@ -78,7 +77,7 @@ flushFinderCaches hsc_env = do flushModLocationCache :: PackageId -> IORef ModLocationCache -> IO () flushModLocationCache this_pkg ref = do - atomicModifyIORef ref $ \fm -> (filterFM is_ext fm, ()) + atomicModifyIORef ref $ \fm -> (filterModuleEnv is_ext fm, ()) _ <- evaluate =<< readIORef ref return () where is_ext mod _ | modulePackageId mod /= this_pkg = True @@ -90,7 +89,7 @@ addToFinderCache ref key val = addToModLocationCache :: IORef ModLocationCache -> Module -> ModLocation -> IO () addToModLocationCache ref key val = - atomicModifyIORef ref $ \c -> (addToFM c key val, ()) + atomicModifyIORef ref $ \c -> (extendModuleEnv c key val, ()) removeFromFinderCache :: IORef FinderCache -> ModuleName -> IO () removeFromFinderCache ref key = @@ -98,7 +97,7 @@ removeFromFinderCache ref key = removeFromModLocationCache :: IORef ModLocationCache -> Module -> IO () removeFromModLocationCache ref key = - atomicModifyIORef ref $ \c -> (delFromFM c key, ()) + atomicModifyIORef ref $ \c -> (delModuleEnv c key, ()) lookupFinderCache :: IORef FinderCache -> ModuleName -> IO (Maybe FindResult) lookupFinderCache ref key = do @@ -109,7 +108,7 @@ lookupModLocationCache :: IORef ModLocationCache -> Module -> IO (Maybe ModLocation) lookupModLocationCache ref key = do c <- readIORef ref - return $! lookupFM c key + return $! lookupModuleEnv c key -- ----------------------------------------------------------------------------- -- The two external entry points