diff options
author | Brandon Chinn <brandonchinn178@gmail.com> | 2022-06-16 13:30:47 -0700 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-06-22 08:23:28 -0400 |
commit | 19606c4208db191165285b79ebc1efe7fb7f4ae4 (patch) | |
tree | b664c74cdefd9ebd401ba0c90c9cb9ddfe744204 /compiler | |
parent | ecc9aedc1f199a1a7ad8ab3babcc080f414d0978 (diff) | |
download | haskell-19606c4208db191165285b79ebc1efe7fb7f4ae4.tar.gz |
Use lookupNameCache instead of lookupOrigIO
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/Iface/Env.hs | 6 | ||||
-rw-r--r-- | compiler/GHC/Plugins.hs | 6 | ||||
-rw-r--r-- | compiler/GHC/Runtime/Heap/Inspect.hs | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/compiler/GHC/Iface/Env.hs b/compiler/GHC/Iface/Env.hs index 9edc0edd32..eeef41ecc1 100644 --- a/compiler/GHC/Iface/Env.hs +++ b/compiler/GHC/Iface/Env.hs @@ -6,7 +6,7 @@ module GHC.Iface.Env ( newGlobalBinder, newInteractiveBinder, externaliseName, lookupIfaceTop, - lookupOrig, lookupOrigIO, lookupOrigNameCache, + lookupOrig, lookupNameCache, lookupOrigNameCache, newIfaceName, newIfaceNames, extendIfaceIdEnv, extendIfaceTyVarEnv, tcIfaceLclId, tcIfaceTyVar, lookupIfaceVar, @@ -146,10 +146,6 @@ lookupOrig mod occ = do traceIf (text "lookup_orig" <+> ppr mod <+> ppr occ) liftIO $ lookupNameCache (hsc_NC hsc_env) mod occ -lookupOrigIO :: HscEnv -> Module -> OccName -> IO Name -lookupOrigIO hsc_env mod occ - = lookupNameCache (hsc_NC hsc_env) mod occ - lookupNameCache :: NameCache -> Module -> OccName -> IO Name -- Lookup up the (Module,OccName) in the NameCache -- If you find it, return it; if not, allocate a fresh original name and extend diff --git a/compiler/GHC/Plugins.hs b/compiler/GHC/Plugins.hs index 9c384317d2..097feefee8 100644 --- a/compiler/GHC/Plugins.hs +++ b/compiler/GHC/Plugins.hs @@ -135,7 +135,7 @@ import GHC.Types.Unique ( Unique, Uniquable(..) ) import GHC.Data.FastString import Data.Maybe -import GHC.Iface.Env ( lookupOrigIO ) +import GHC.Iface.Env ( lookupNameCache ) import GHC.Prelude import GHC.Utils.Monad ( mapMaybeM ) import GHC.ThToHs ( thRdrNameGuesses ) @@ -182,6 +182,6 @@ thNameToGhcName th_name | Just n <- isExact_maybe rdr_name -- This happens in derived code = return $ if isExternalName n then Just n else Nothing | Just (rdr_mod, rdr_occ) <- isOrig_maybe rdr_name - = do { hsc_env <- getHscEnv - ; Just <$> liftIO (lookupOrigIO hsc_env rdr_mod rdr_occ) } + = do { hsc_env <- hsc_NC <$> getHscEnv + ; Just <$> liftIO (lookupNameCache hsc_env rdr_mod rdr_occ) } | otherwise = return Nothing diff --git a/compiler/GHC/Runtime/Heap/Inspect.hs b/compiler/GHC/Runtime/Heap/Inspect.hs index 4f6e2b7057..df3cd24278 100644 --- a/compiler/GHC/Runtime/Heap/Inspect.hs +++ b/compiler/GHC/Runtime/Heap/Inspect.hs @@ -133,7 +133,7 @@ constrClosToName :: HscEnv -> GenClosure a -> IO (Either String Name) constrClosToName hsc_env ConstrClosure{pkg=pkg,modl=mod,name=occ} = do let occName = mkOccName OccName.dataName occ modName = mkModule (stringToUnit pkg) (mkModuleName mod) - Right `fmap` lookupOrigIO hsc_env modName occName + Right `fmap` lookupNameCache (hsc_NC hsc_env) modName occName constrClosToName _hsc_env clos = return (Left ("conClosToName: Expected ConstrClosure, got " ++ show (fmap (const ()) clos))) |