import PrelNames ( gHC_PRIM )
import DynFlags
import Outputable
-import FiniteMap
import LazyUniqFM
import Maybes ( expectJust )
import Exception ( evaluate )
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
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 =
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
-> IO (Maybe ModLocation)
lookupModLocationCache ref key = do
c <- readIORef ref
- return $! lookupFM c key
+ return $! lookupModuleEnv c key
-- -----------------------------------------------------------------------------
-- The two external entry points