Commit 7fad107f authored by Austin Seipp's avatar Austin Seipp
Browse files

Clean up some outdated comments (#8418)


Authored-by: errge's avatarGergely Risko <gergely@risko.hu>
Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
parent ddc79b22
......@@ -7,7 +7,7 @@ module DynamicLoading (
forceLoadTyCon,
-- * Finding names
lookupRdrNameInModule,
lookupRdrNameInModuleForPlugins,
-- * Loading values
getValueSafely,
......@@ -141,8 +141,11 @@ lessUnsafeCoerce dflags context what = do
--
-- * If the module could not be found
-- * If we could not determine the imports of the module
lookupRdrNameInModule :: HscEnv -> ModuleName -> RdrName -> IO (Maybe Name)
lookupRdrNameInModule hsc_env mod_name rdr_name = do
--
-- Can only be used for lookuping up names while handling plugins.
-- This was introduced by 57d6798.
lookupRdrNameInModuleForPlugins :: HscEnv -> ModuleName -> RdrName -> IO (Maybe Name)
lookupRdrNameInModuleForPlugins hsc_env mod_name rdr_name = do
-- First find the package the module resides in by searching exposed packages and home modules
found_module <- findImportedModule hsc_env mod_name Nothing
case found_module of
......
......@@ -505,10 +505,10 @@ lookupIfaceByModule dflags hpt pit mod
-- of its own, but it doesn't seem worth the bother.
-- | Find all the instance declarations (of classes and families) that are in
-- modules imported by this one, directly or indirectly, and are in the Home
-- Package Table. This ensures that we don't see instances from modules @--make@
-- compiled before this one, but which are not below this one.
-- | Find all the instance declarations (of classes and families) from
-- the Home Package Table filtered by the provided predicate function.
-- Used in @tcRnImports@, to select the instances that are in the
-- transitive closure of imports from the currently compiled module.
hptInstances :: HscEnv -> (ModuleName -> Bool) -> ([ClsInst], [FamInst])
hptInstances hsc_env want_this_module
= let (insts, famInsts) = unzip $ flip hptAllThings hsc_env $ \mod_info -> do
......
......@@ -53,7 +53,7 @@ import Type ( mkTyConTy )
import RdrName ( mkRdrQual )
import OccName ( mkVarOcc )
import PrelNames ( pluginTyConName )
import DynamicLoading ( forceLoadTyCon, lookupRdrNameInModule, getValueSafely )
import DynamicLoading ( forceLoadTyCon, lookupRdrNameInModuleForPlugins, getValueSafely )
import Module ( ModuleName )
import Panic
#endif
......@@ -335,7 +335,7 @@ loadPlugin :: HscEnv -> ModuleName -> IO Plugin
loadPlugin hsc_env mod_name
= do { let plugin_rdr_name = mkRdrQual mod_name (mkVarOcc "plugin")
dflags = hsc_dflags hsc_env
; mb_name <- lookupRdrNameInModule hsc_env mod_name plugin_rdr_name
; mb_name <- lookupRdrNameInModuleForPlugins hsc_env mod_name plugin_rdr_name
; case mb_name of {
Nothing ->
throwGhcExceptionIO (CmdLineError $ showSDoc dflags $ hsep
......
......@@ -241,7 +241,7 @@ implicitPreludeWarn
tcRnImports :: HscEnv -> Module
-> [LImportDecl RdrName] -> TcM TcGblEnv
tcRnImports hsc_env this_mod import_decls
= do { (rn_imports, rdr_env, imports,hpc_info) <- rnImports import_decls ;
= do { (rn_imports, rdr_env, imports, hpc_info) <- rnImports import_decls ;
; let { dep_mods :: ModuleNameEnv (ModuleName, IsBootInterface)
-- Make sure we record the dependencies from the DynFlags in the EPS or we
......@@ -257,7 +257,10 @@ tcRnImports hsc_env this_mod import_decls
-- We want instance declarations from all home-package
-- modules below this one, including boot modules, except
-- ourselves. The 'except ourselves' is so that we don't
-- get the instances from this module's hs-boot file
-- get the instances from this module's hs-boot file. This
-- filtering also ensures that we don't see instances from
-- modules batch (@--make@) compiled before this one, but
-- which are not below this one.
; want_instances :: ModuleName -> Bool
; want_instances mod = mod `elemUFM` dep_mods
&& mod /= moduleName this_mod
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment