summaryrefslogtreecommitdiff
path: root/compiler/main
diff options
context:
space:
mode:
authorThomas Schilling <nominolo@googlemail.com>2008-10-28 18:22:02 +0000
committerThomas Schilling <nominolo@googlemail.com>2008-10-28 18:22:02 +0000
commitc0ac8b6b2192d296fc28bfc8eb566123e8d72bf0 (patch)
treebaffd1580e32a3b1404855660ae51ee3b0e6afab /compiler/main
parent9761825a6ee1c7c0b7115b9b7f58bd3b3e8cb5fe (diff)
downloadhaskell-c0ac8b6b2192d296fc28bfc8eb566123e8d72bf0.tar.gz
Minor refactoring.
Diffstat (limited to 'compiler/main')
-rw-r--r--compiler/main/GHC.hs4
-rw-r--r--compiler/main/HscTypes.lhs2
2 files changed, 2 insertions, 4 deletions
diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs
index e8ea87c6b3..a6a5e1d4c7 100644
--- a/compiler/main/GHC.hs
+++ b/compiler/main/GHC.hs
@@ -2413,9 +2413,7 @@ isDictonaryId id
-- 'setContext'.
lookupGlobalName :: GhcMonad m => Name -> m (Maybe TyThing)
lookupGlobalName name = withSession $ \hsc_env -> do
- eps <- liftIO $ readIORef (hsc_EPS hsc_env)
- return $! lookupType (hsc_dflags hsc_env)
- (hsc_HPT hsc_env) (eps_PTE eps) name
+ liftIO $ lookupTypeHscEnv hsc_env name
findGlobalAnns :: (GhcMonad m, Typeable a) => ([Word8] -> a) -> AnnTarget Name -> m [a]
findGlobalAnns deserialize target = withSession $ \hsc_env -> do
diff --git a/compiler/main/HscTypes.lhs b/compiler/main/HscTypes.lhs
index 03bcca5e1e..22f5a9caf1 100644
--- a/compiler/main/HscTypes.lhs
+++ b/compiler/main/HscTypes.lhs
@@ -1344,7 +1344,7 @@ lookupType dflags hpt pte name
lookupTypeHscEnv :: HscEnv -> Name -> IO (Maybe TyThing)
lookupTypeHscEnv hsc_env name = do
eps <- readIORef (hsc_EPS hsc_env)
- return $ lookupType dflags hpt (eps_PTE eps) name
+ return $! lookupType dflags hpt (eps_PTE eps) name
where
dflags = hsc_dflags hsc_env
hpt = hsc_HPT hsc_env