ghc-9.12.0.20241128: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Rename.Names

Synopsis

Documentation

rnImports :: [(LImportDecl GhcPs, SDoc)] -> RnM ([LImportDecl GhcRn], [ImportUserSpec], GlobalRdrEnv, ImportAvails, [(Module, IfaceDefault)], AnyHpcUsage) Source #

Process Import Decls. See rnImportDecl for a description of what the return types represent. Note: Do the non SOURCE ones first, so that we get a helpful warning for SOURCE ones that are unnecessary

data ImportUserSpec Source #

The import specification as written by the user, including the list of explicitly imported names. Used in ModIface to allow GHCi to reconstruct the top level environment on demand.

This is distinct from ImportSpec because we don't want to store the list of explicitly imported names along with each GRE

We don't want to store the entire GlobalRdrEnv for modules that are imported without explicit export lists, as these may grow to be very large. However, GlobalRdrEnvs which are the result of explicit import lists are typically quite small.

Why do we not store something like (Maybe (ImportListInterpretation, [IE GhcPs]) in such a case? Because we don't want to store source syntax including annotations in interface files.

gresFromAvails :: HscEnv -> Maybe ImportSpec -> [AvailInfo] -> [GlobalRdrElt] Source #

All the GlobalRdrElts associated with a collection of AvailInfos.

calculateAvails :: HomeUnit -> Set UnitId -> ModIface -> IsSafeImport -> IsBootInterface -> ImportedBy -> ImportAvails Source #

Calculate the ImportAvails induced by an import of a particular interface, but without imp_mods.

findChildren :: NameEnv [a] -> Name -> [a] Source #

renamePkgQual :: UnitEnv -> ModuleName -> Maybe FastString -> PkgQual Source #

Rename raw package imports

renameRawPkgQual :: UnitEnv -> ModuleName -> RawPkgQual -> PkgQual Source #

Rename raw package imports