GHC.Unit.Home.ModInfo

ghc-lib-parser-9.10.1.20250103: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Unit.Home.ModInfo

Description

Info about modules in the "home" unit

Synopsis

- data HomeModInfo = HomeModInfo {
  - hm_iface :: !ModIface
  - hm_details :: ModDetails
  - hm_linkable :: !HomeModLinkable
  }
- data HomeModLinkable = HomeModLinkable {
  - homeMod_bytecode :: !(Maybe Linkable)
  - homeMod_object :: !(Maybe Linkable)
  }
- homeModInfoObject :: HomeModInfo -> Maybe Linkable
- homeModInfoByteCode :: HomeModInfo -> Maybe Linkable
- emptyHomeModInfoLinkable :: HomeModLinkable
- justBytecode :: Linkable -> HomeModLinkable
- justObjects :: Linkable -> HomeModLinkable
- bytecodeAndObjects :: Linkable -> Linkable -> HomeModLinkable
- type HomePackageTable = DModuleNameEnv HomeModInfo
- emptyHomePackageTable :: HomePackageTable
- lookupHpt :: HomePackageTable -> ModuleName -> Maybe HomeModInfo
- eltsHpt :: HomePackageTable -> [HomeModInfo]
- filterHpt :: (HomeModInfo -> Bool) -> HomePackageTable -> HomePackageTable
- allHpt :: (HomeModInfo -> Bool) -> HomePackageTable -> Bool
- anyHpt :: (HomeModInfo -> Bool) -> HomePackageTable -> Bool
- mapHpt :: (HomeModInfo -> HomeModInfo) -> HomePackageTable -> HomePackageTable
- delFromHpt :: HomePackageTable -> ModuleName -> HomePackageTable
- addToHpt :: HomePackageTable -> ModuleName -> HomeModInfo -> HomePackageTable
- addHomeModInfoToHpt :: HomeModInfo -> HomePackageTable -> HomePackageTable
- addListToHpt :: HomePackageTable -> [(ModuleName, HomeModInfo)] -> HomePackageTable
- lookupHptDirectly :: HomePackageTable -> Unique -> Maybe HomeModInfo
- lookupHptByModule :: HomePackageTable -> Module -> Maybe HomeModInfo
- listToHpt :: [(ModuleName, HomeModInfo)] -> HomePackageTable
- listHMIToHpt :: [HomeModInfo] -> HomePackageTable
- pprHPT :: HomePackageTable -> SDoc

# Documentation

data HomeModInfo #

Information about modules in the package being compiled

Constructors

HomeModInfo |
Fields hm_iface :: !ModIface The basic loaded interface file: every loaded module has one of these, even if it is imported from another package hm_details :: ModDetails Extra information that has been created from the `ModIface` for the module, typically during typechecking hm_linkable :: !HomeModLinkable The actual artifact we would like to link to access things in this module. See Note [Home module build products] `hm_linkable` might be empty: If this is an .hs-boot module Temporarily during compilation if we pruned away the old linkable because it was out of date. When re-linking a module (`HscNoRecomp`), we construct the `HomeModInfo` by building a new `ModDetails` from the old `ModIface` (only).

data HomeModLinkable #

Constructors

HomeModLinkable |
Fields homeMod_bytecode :: !(Maybe Linkable) homeMod_object :: !(Maybe Linkable)

#### Instances

Instances details

Outputable HomeModLinkable # |
Instance details Defined in GHC.Unit.Home.ModInfo Methods ppr :: HomeModLinkable -> SDoc #

homeModInfoObject :: HomeModInfo -> Maybe Linkable #

homeModInfoByteCode :: HomeModInfo -> Maybe Linkable #

emptyHomeModInfoLinkable :: HomeModLinkable #

justBytecode :: Linkable -> HomeModLinkable #

justObjects :: Linkable -> HomeModLinkable #

bytecodeAndObjects :: Linkable -> Linkable -> HomeModLinkable #

type HomePackageTable = DModuleNameEnv HomeModInfo #

Helps us find information about modules in the home package

emptyHomePackageTable :: HomePackageTable #

Constructs an empty HomePackageTable

lookupHpt :: HomePackageTable -> ModuleName -> Maybe HomeModInfo #

eltsHpt :: HomePackageTable -> [HomeModInfo] #

filterHpt :: (HomeModInfo -> Bool) -> HomePackageTable -> HomePackageTable #

allHpt :: (HomeModInfo -> Bool) -> HomePackageTable -> Bool #

anyHpt :: (HomeModInfo -> Bool) -> HomePackageTable -> Bool #

mapHpt :: (HomeModInfo -> HomeModInfo) -> HomePackageTable -> HomePackageTable #

delFromHpt :: HomePackageTable -> ModuleName -> HomePackageTable #

addToHpt :: HomePackageTable -> ModuleName -> HomeModInfo -> HomePackageTable #

addHomeModInfoToHpt :: HomeModInfo -> HomePackageTable -> HomePackageTable #

addListToHpt :: HomePackageTable -> [(ModuleName, HomeModInfo)] -> HomePackageTable #

lookupHptDirectly :: HomePackageTable -> Unique -> Maybe HomeModInfo #

lookupHptByModule :: HomePackageTable -> Module -> Maybe HomeModInfo #

listToHpt :: [(ModuleName, HomeModInfo)] -> HomePackageTable #

listHMIToHpt :: [HomeModInfo] -> HomePackageTable #

pprHPT :: HomePackageTable -> SDoc #