From c0ac8b6b2192d296fc28bfc8eb566123e8d72bf0 Mon Sep 17 00:00:00 2001 From: Thomas Schilling Date: Tue, 28 Oct 2008 18:22:02 +0000 Subject: [PATCH] Minor refactoring. --- compiler/main/GHC.hs | 4 +--- compiler/main/HscTypes.lhs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/main/GHC.hs b/compiler/main/GHC.hs index e8ea87c..a6a5e1d 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 03bcca5..22f5a9c 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 -- 1.7.10.4